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/3961 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3961/labels{/name} | https://api.github.com/repos/psf/requests/issues/3961/comments | https://api.github.com/repos/psf/requests/issues/3961/events | https://github.com/psf/requests/issues/3961 | 220,691,277 | MDU6SXNzdWUyMjA2OTEyNzc= | 3,961 | Use libproxy gain WPAD/PAC support for free | {
"avatar_url": "https://avatars.githubusercontent.com/u/473983?v=4",
"events_url": "https://api.github.com/users/marceloslacerda/events{/privacy}",
"followers_url": "https://api.github.com/users/marceloslacerda/followers",
"following_url": "https://api.github.com/users/marceloslacerda/following{/other_user}",
"gists_url": "https://api.github.com/users/marceloslacerda/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/marceloslacerda",
"id": 473983,
"login": "marceloslacerda",
"node_id": "MDQ6VXNlcjQ3Mzk4Mw==",
"organizations_url": "https://api.github.com/users/marceloslacerda/orgs",
"received_events_url": "https://api.github.com/users/marceloslacerda/received_events",
"repos_url": "https://api.github.com/users/marceloslacerda/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/marceloslacerda/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/marceloslacerda/subscriptions",
"type": "User",
"url": "https://api.github.com/users/marceloslacerda",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 4 | 2017-04-10T16:00:03Z | 2021-09-08T06:00:29Z | 2017-04-10T16:12:43Z | NONE | resolved | Currently requests does figuring out of whether a proxy should be used for a given URL. [WPAD/PAC](https://en.wikipedia.org/wiki/Web_Proxy_Auto-Discovery_Protocol) files describe those requirements, so if requests were to support WPAD proxy descriptions it would need to also parse it and figure what proxy to use for what URL.
On the other hand requests could delegate that task to libproxy and clean up a bunch of code (and issues) from the project. | {
"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/3961/reactions"
} | https://api.github.com/repos/psf/requests/issues/3961/timeline | null | completed | null | null | false | [
"By the way since I'm interested I could help implementing it.",
"So Requests cannot easily use libproxy because it is a binary dependency. We therefore cannot vendor it, and so cannot unconditionally rely on it being present. I would be open to a series of patches that add support, but libproxy is also not (as f... |
https://api.github.com/repos/psf/requests/issues/3960 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3960/labels{/name} | https://api.github.com/repos/psf/requests/issues/3960/comments | https://api.github.com/repos/psf/requests/issues/3960/events | https://github.com/psf/requests/issues/3960 | 220,494,809 | MDU6SXNzdWUyMjA0OTQ4MDk= | 3,960 | HTTPS isn't working if proxy is down | {
"avatar_url": "https://avatars.githubusercontent.com/u/17240507?v=4",
"events_url": "https://api.github.com/users/abriginets/events{/privacy}",
"followers_url": "https://api.github.com/users/abriginets/followers",
"following_url": "https://api.github.com/users/abriginets/following{/other_user}",
"gists_url": "https://api.github.com/users/abriginets/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/abriginets",
"id": 17240507,
"login": "abriginets",
"node_id": "MDQ6VXNlcjE3MjQwNTA3",
"organizations_url": "https://api.github.com/users/abriginets/orgs",
"received_events_url": "https://api.github.com/users/abriginets/received_events",
"repos_url": "https://api.github.com/users/abriginets/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/abriginets/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/abriginets/subscriptions",
"type": "User",
"url": "https://api.github.com/users/abriginets",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-04-09T20:01:00Z | 2021-09-08T10:00:39Z | 2017-05-25T20:29:26Z | NONE | resolved | I'm using requests with proxies and when proxy-server is down for some reason, requests make request without proxy(using the origin IP). Also, this issue appears when making https request with proxy which not support https. Could you please implement functionality, which could allow me to make proxy-only requests? | {
"avatar_url": "https://avatars.githubusercontent.com/u/17240507?v=4",
"events_url": "https://api.github.com/users/abriginets/events{/privacy}",
"followers_url": "https://api.github.com/users/abriginets/followers",
"following_url": "https://api.github.com/users/abriginets/following{/other_user}",
"gists_url": "https://api.github.com/users/abriginets/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/abriginets",
"id": 17240507,
"login": "abriginets",
"node_id": "MDQ6VXNlcjE3MjQwNTA3",
"organizations_url": "https://api.github.com/users/abriginets/orgs",
"received_events_url": "https://api.github.com/users/abriginets/received_events",
"repos_url": "https://api.github.com/users/abriginets/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/abriginets/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/abriginets/subscriptions",
"type": "User",
"url": "https://api.github.com/users/abriginets",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3960/reactions"
} | https://api.github.com/repos/psf/requests/issues/3960/timeline | null | completed | null | null | false | [
"Requests should not be making requests without the proxy when the proxy is not working. Can you show us the code you're using please?",
"I've figured it out, i guess. This happened if making request in `while True` loop. "
] |
https://api.github.com/repos/psf/requests/issues/3959 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3959/labels{/name} | https://api.github.com/repos/psf/requests/issues/3959/comments | https://api.github.com/repos/psf/requests/issues/3959/events | https://github.com/psf/requests/issues/3959 | 220,464,901 | MDU6SXNzdWUyMjA0NjQ5MDE= | 3,959 | UnicodeDecodeError on redirect response rfc1804 to non ascii location | {
"avatar_url": "https://avatars.githubusercontent.com/u/23416546?v=4",
"events_url": "https://api.github.com/users/shmuelamar/events{/privacy}",
"followers_url": "https://api.github.com/users/shmuelamar/followers",
"following_url": "https://api.github.com/users/shmuelamar/following{/other_user}",
"gists_url": "https://api.github.com/users/shmuelamar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/shmuelamar",
"id": 23416546,
"login": "shmuelamar",
"node_id": "MDQ6VXNlcjIzNDE2NTQ2",
"organizations_url": "https://api.github.com/users/shmuelamar/orgs",
"received_events_url": "https://api.github.com/users/shmuelamar/received_events",
"repos_url": "https://api.github.com/users/shmuelamar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/shmuelamar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shmuelamar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/shmuelamar",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-04-09T11:23:41Z | 2021-09-08T11:00:34Z | 2017-04-09T11:39:32Z | CONTRIBUTOR | resolved | This issue happend to me on our production servers while requesting URL from the wild using requests.
When a server returns redirect response that follows rfc1808 (i.e. Location: //URI) and the URI contains non ASCII chars, requests fails with UnicodeDecodeError.
This issue only happens on python2 (in python3 unicode is the default text string so all headers encoded into unicode, including the Location header).
test to reproduce:
```python
def test_redirect_rfc1808_to_non_ascii_location():
def redirect_resp_handler(sock):
request_content = consume_socket_content(sock, timeout=0.5)
sock.send(text_301)
return request_content
close_server = threading.Event()
server = Server(redirect_resp_handler, wait_to_close_event=close_server)
text_301 = (
u'HTTP/1.1 301 Moved Permanently\r\n'
u'Location: //{0}:{1}/?Š\r\n'
u'\r\n'.format(server.host, server.port)
).encode('utf8')
with server as (host, port):
url = u'http://{0}:{1}/'.format(host, port)
r = requests.head(url=url, allow_redirects=True)
assert r.status_code == 200
assert len(r.history) == 1
assert r.history[0].status_code == 301
close_server.set()
```
AFAIK from [here](http://stackoverflow.com/questions/4400678/what-character-encoding-should-i-use-for-a-http-header), header fields should be US-ASCII encoded and must not contain non-ASCII chars, but the internet is a wild place so this things happen.
IMHO its the server response to return the location in urlencoded format but requests shouldn't fail on this error (maybe more informative error) or at least be consistent with python2 and python3 behavior.
**I can create a PR for fixing the issue but I'm not sure what is the best solution**, options are (what I can think of):
1. raise custom exception when Location field is not ASCII (might be inconsistent with previous versions)
2. try encode the Location field to utf8 and raise exception if encoding fails
3. on python2 decode all headers into unicode, similar to python3 (might break previous versions compatibility)
**stacktrace (on master branch):**
```python
UnicodeDecodeError Traceback (most recent call last)
<ipython-input-4-24640a4df79e> in <module>()
----> 1 resp = requests.head('https://www.autobazar.eu/skoda-fabia-19-tdi-pd-rs-id9323271.html', allow_redirects=True)
/home/shmulik/so/requests/requests/api.py in head(url, **kwargs)
96
97 kwargs.setdefault('allow_redirects', False)
---> 98 return request('head', url, **kwargs)
99
100
/home/shmulik/so/requests/requests/api.py in request(method, url, **kwargs)
56 # cases, and look like a memory leak in others.
57 with sessions.Session() as session:
---> 58 return session.request(method=method, url=url, **kwargs)
59
60
/home/shmulik/so/requests/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
496 }
497 send_kwargs.update(settings)
--> 498 resp = self.send(prep, **send_kwargs)
499
500 return resp
/home/shmulik/so/requests/requests/sessions.py in send(self, request, **kwargs)
638
639 # Resolve redirects if allowed.
--> 640 history = [resp for resp in gen] if allow_redirects else []
641
642 # Shuffle things around if there's history.
/home/shmulik/so/requests/requests/sessions.py in resolve_redirects(self, resp, req, stream, timeout, verify, cert, proxies, **adapter_kwargs)
123 if url.startswith('//'):
124 parsed_rurl = urlparse(resp.url)
--> 125 url = '%s:%s' % (parsed_rurl.scheme, url)
126
127 # The scheme should be lower case...
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 120: ordinal not in range(128)
```
example response running curl (I removed the real url):
```bash
$ curl -vvv "http://some-url.com"
....
< HTTP/1.1 301 Moved Permanently
< Server: Apache
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Location: //some-url.com/Š
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8
```
Thanks,
Shmulik | {
"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/3959/reactions"
} | https://api.github.com/repos/psf/requests/issues/3959/timeline | null | completed | null | null | false | [
"Thanks for this detailed report! This is a dupe of #3888: that has some discussions about how we might handle this if you're interested in supplying a patch. Additional suggestions on that thread would be welcomed if you don't like any of the proposed approaches. ",
"thanks for the quick reply! missed it when se... |
https://api.github.com/repos/psf/requests/issues/3958 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3958/labels{/name} | https://api.github.com/repos/psf/requests/issues/3958/comments | https://api.github.com/repos/psf/requests/issues/3958/events | https://github.com/psf/requests/pull/3958 | 220,397,705 | MDExOlB1bGxSZXF1ZXN0MTE0OTQ0MTk3 | 3,958 | Fix a typo in utils | {
"avatar_url": "https://avatars.githubusercontent.com/u/5351546?v=4",
"events_url": "https://api.github.com/users/Xuanwo/events{/privacy}",
"followers_url": "https://api.github.com/users/Xuanwo/followers",
"following_url": "https://api.github.com/users/Xuanwo/following{/other_user}",
"gists_url": "https://api.github.com/users/Xuanwo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Xuanwo",
"id": 5351546,
"login": "Xuanwo",
"node_id": "MDQ6VXNlcjUzNTE1NDY=",
"organizations_url": "https://api.github.com/users/Xuanwo/orgs",
"received_events_url": "https://api.github.com/users/Xuanwo/received_events",
"repos_url": "https://api.github.com/users/Xuanwo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Xuanwo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Xuanwo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Xuanwo",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-04-08T12:46:33Z | 2021-09-06T00:07:04Z | 2017-04-08T13:18:43Z | CONTRIBUTOR | resolved | Signed-off-by: Xuanwo <xuanwo.cn@gmail.com> | {
"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/3958/reactions"
} | https://api.github.com/repos/psf/requests/issues/3958/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3958.diff",
"html_url": "https://github.com/psf/requests/pull/3958",
"merged_at": "2017-04-08T13:18:43Z",
"patch_url": "https://github.com/psf/requests/pull/3958.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3958"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3958?src=pr&el=h1) Report\n> Merging [#3958](https://codecov.io/gh/kennethreitz/requests/pull/3958?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/f061fb7e28a480e911cc49de7d41f9ec0ff5215b?src=pr&el=desc) will **not change... |
https://api.github.com/repos/psf/requests/issues/3957 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3957/labels{/name} | https://api.github.com/repos/psf/requests/issues/3957/comments | https://api.github.com/repos/psf/requests/issues/3957/events | https://github.com/psf/requests/issues/3957 | 220,169,658 | MDU6SXNzdWUyMjAxNjk2NTg= | 3,957 | comma in case: join multiple Set-Cookie Headers | {
"avatar_url": "https://avatars.githubusercontent.com/u/26567627?v=4",
"events_url": "https://api.github.com/users/jake491/events{/privacy}",
"followers_url": "https://api.github.com/users/jake491/followers",
"following_url": "https://api.github.com/users/jake491/following{/other_user}",
"gists_url": "https://api.github.com/users/jake491/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jake491",
"id": 26567627,
"login": "jake491",
"node_id": "MDQ6VXNlcjI2NTY3NjI3",
"organizations_url": "https://api.github.com/users/jake491/orgs",
"received_events_url": "https://api.github.com/users/jake491/received_events",
"repos_url": "https://api.github.com/users/jake491/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jake491/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jake491/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jake491",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 6 | 2017-04-07T10:07:24Z | 2024-05-19T18:53:53Z | 2024-05-19T18:53:53Z | NONE | null | Many web-apps send cookie in multiple Set-Cookie headers, one header for one cookie. Requests joins this headers in one big header separate by comma.
From same webapp to requests.get
```
Set-Cookie: ASP.NET_SessionId=token1; path=/; HttpOnly
Set-Cookie: Cookie1=token2; path=/ecp
Set-Cookie: X-BEResource=WIN-RBFR0BDA7V7.testlab.net~1; path=/ecp/15.0.516.30; HttpOnly
Set-Cookie: X-BackEndCookie=token3; expires=Mon, 03-Apr-2017 12:25:07 GMT; path=/ecp; HttpOnly
```
In requests:
resp.headers this look like
```
Set-Cookie: ASP.NET_SessionId=token1; path=/; HttpOnly,
Cookie1=token2; path=/ecp,
X-BEResource=WIN-RBFR0BDA7V7.testlab.net~1; path=/ecp/15.0.516.30; HttpOnly,
X-BackEndCookie=token3; expires=Thu, 06-Apr-2017 08:27:22 GMT; path=/ecp; HttpOnly
```
Firefox, IE, Chrome invalid interpreted this cookies because separater is comma but in field EXPIRES comma separate day and date.
Principal problem in modification traffic. In my opinion then server send multiple headers lib must return multiple headers | {
"avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4",
"events_url": "https://api.github.com/users/sethmlarson/events{/privacy}",
"followers_url": "https://api.github.com/users/sethmlarson/followers",
"following_url": "https://api.github.com/users/sethmlarson/following{/other_user}",
"gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sethmlarson",
"id": 18519037,
"login": "sethmlarson",
"node_id": "MDQ6VXNlcjE4NTE5MDM3",
"organizations_url": "https://api.github.com/users/sethmlarson/orgs",
"received_events_url": "https://api.github.com/users/sethmlarson/received_events",
"repos_url": "https://api.github.com/users/sethmlarson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sethmlarson",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3957/reactions"
} | https://api.github.com/repos/psf/requests/issues/3957/timeline | null | completed | null | null | false | [
"Requests makes no promises about leaving headers in the form they are received from the server. Right now, I highly recommend you use the cookiejar Requests uses to store cookies rather than extracting them from the headers: we correctly insert them in there.\r\n\r\nLonger term, we should probably add a fix to exc... |
https://api.github.com/repos/psf/requests/issues/3956 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3956/labels{/name} | https://api.github.com/repos/psf/requests/issues/3956/comments | https://api.github.com/repos/psf/requests/issues/3956/events | https://github.com/psf/requests/pull/3956 | 219,611,227 | MDExOlB1bGxSZXF1ZXN0MTE0Mzk2ODYz | 3,956 | Fixes DeprecationWarnings in Python 3.6 due to invalid escape sequences | {
"avatar_url": "https://avatars.githubusercontent.com/u/1939893?v=4",
"events_url": "https://api.github.com/users/rubendura/events{/privacy}",
"followers_url": "https://api.github.com/users/rubendura/followers",
"following_url": "https://api.github.com/users/rubendura/following{/other_user}",
"gists_url": "https://api.github.com/users/rubendura/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rubendura",
"id": 1939893,
"login": "rubendura",
"node_id": "MDQ6VXNlcjE5Mzk4OTM=",
"organizations_url": "https://api.github.com/users/rubendura/orgs",
"received_events_url": "https://api.github.com/users/rubendura/received_events",
"repos_url": "https://api.github.com/users/rubendura/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rubendura/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rubendura/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rubendura",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 10 | 2017-04-05T14:54:44Z | 2021-09-06T00:07:04Z | 2017-04-05T15:29:41Z | CONTRIBUTOR | resolved | Fixes #3954 | {
"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/3956/reactions"
} | https://api.github.com/repos/psf/requests/issues/3956/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3956.diff",
"html_url": "https://github.com/psf/requests/pull/3956",
"merged_at": "2017-04-05T15:29:41Z",
"patch_url": "https://github.com/psf/requests/pull/3956.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3956"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=h1) Report\n> Merging [#3956](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/342096a3b98e9c4466316167574dbf5054f30daa?src=pr&el=desc) will **not change... |
https://api.github.com/repos/psf/requests/issues/3955 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3955/labels{/name} | https://api.github.com/repos/psf/requests/issues/3955/comments | https://api.github.com/repos/psf/requests/issues/3955/events | https://github.com/psf/requests/issues/3955 | 219,595,430 | MDU6SXNzdWUyMTk1OTU0MzA= | 3,955 | Feature Request : Disable hostname verification | {
"avatar_url": "https://avatars.githubusercontent.com/u/965310?v=4",
"events_url": "https://api.github.com/users/johnlabarge/events{/privacy}",
"followers_url": "https://api.github.com/users/johnlabarge/followers",
"following_url": "https://api.github.com/users/johnlabarge/following{/other_user}",
"gists_url": "https://api.github.com/users/johnlabarge/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/johnlabarge",
"id": 965310,
"login": "johnlabarge",
"node_id": "MDQ6VXNlcjk2NTMxMA==",
"organizations_url": "https://api.github.com/users/johnlabarge/orgs",
"received_events_url": "https://api.github.com/users/johnlabarge/received_events",
"repos_url": "https://api.github.com/users/johnlabarge/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/johnlabarge/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/johnlabarge/subscriptions",
"type": "User",
"url": "https://api.github.com/users/johnlabarge",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 12 | 2017-04-05T14:08:54Z | 2021-09-08T08:00:30Z | 2017-07-29T23:25:45Z | NONE | resolved | It seems that this isn't always necessary, for example when I'm using pinned certs. I ran up against that issue trying to use https://github.com/kelproject/pykube and will have to use a proxy workaround. I'm using the IP address, not the hostname to contact the server per the prepackaged configuration file. I get the hostname '<IP ADDRESS>' doesn't match either of .... message. | {
"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/3955/reactions"
} | https://api.github.com/repos/psf/requests/issues/3955/timeline | null | completed | null | null | false | [
"So, ultimately this is just not very likely to happen. The utility of having certificate verification but not hostname verification is very low (basically zero) in the general case, so the *only* useful situation is for pinned certificates. In the pinned certificate case, though, the question has to be asked: why ... |
https://api.github.com/repos/psf/requests/issues/3954 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3954/labels{/name} | https://api.github.com/repos/psf/requests/issues/3954/comments | https://api.github.com/repos/psf/requests/issues/3954/events | https://github.com/psf/requests/issues/3954 | 219,581,094 | MDU6SXNzdWUyMTk1ODEwOTQ= | 3,954 | requests shows lots of DeprecationWarning on Python 3.6 | {
"avatar_url": "https://avatars.githubusercontent.com/u/1939893?v=4",
"events_url": "https://api.github.com/users/rubendura/events{/privacy}",
"followers_url": "https://api.github.com/users/rubendura/followers",
"following_url": "https://api.github.com/users/rubendura/following{/other_user}",
"gists_url": "https://api.github.com/users/rubendura/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rubendura",
"id": 1939893,
"login": "rubendura",
"node_id": "MDQ6VXNlcjE5Mzk4OTM=",
"organizations_url": "https://api.github.com/users/rubendura/orgs",
"received_events_url": "https://api.github.com/users/rubendura/received_events",
"repos_url": "https://api.github.com/users/rubendura/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rubendura/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rubendura/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rubendura",
"user_view_type": "public"
} | [
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
}
] | closed | true | null | [] | null | 26 | 2017-04-05T13:23:47Z | 2021-09-08T11:00:35Z | 2017-04-05T15:29:41Z | CONTRIBUTOR | resolved | Running tests on my project with the -Wd option now displays lots of DeprecationWarnings coming from requests.
From the Python 3.6 Changelog (https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior):
```A backslash-character pair that is not a valid escape sequence now generates a DeprecationWarning. Although this will eventually become a SyntaxError, that will not be for several Python releases. (Contributed by Emanuel Barry in bpo-27364.)```
For reference, this is the commit that fixed those DeprecationWarnings in Django 1.11: https://github.com/django/django/commit/8119b679eb85cdc0ae3d321e54d06dd0200a1e82 | {
"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/3954/reactions"
} | https://api.github.com/repos/psf/requests/issues/3954/timeline | null | completed | null | null | false | [
"Do those deprecation warnings happen to point at the location in the code where the problem arises? If so, it'd be useful to see that output.",
"They actually do:\r\n\r\n```\r\n/venv/lib/python3.6/site-packages/requests/models.py:847: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/pytho... |
https://api.github.com/repos/psf/requests/issues/3953 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3953/labels{/name} | https://api.github.com/repos/psf/requests/issues/3953/comments | https://api.github.com/repos/psf/requests/issues/3953/events | https://github.com/psf/requests/issues/3953 | 219,417,645 | MDU6SXNzdWUyMTk0MTc2NDU= | 3,953 | content-length is missing from requests | {
"avatar_url": "https://avatars.githubusercontent.com/u/618237?v=4",
"events_url": "https://api.github.com/users/cuzzasoft/events{/privacy}",
"followers_url": "https://api.github.com/users/cuzzasoft/followers",
"following_url": "https://api.github.com/users/cuzzasoft/following{/other_user}",
"gists_url": "https://api.github.com/users/cuzzasoft/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cuzzasoft",
"id": 618237,
"login": "cuzzasoft",
"node_id": "MDQ6VXNlcjYxODIzNw==",
"organizations_url": "https://api.github.com/users/cuzzasoft/orgs",
"received_events_url": "https://api.github.com/users/cuzzasoft/received_events",
"repos_url": "https://api.github.com/users/cuzzasoft/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cuzzasoft/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cuzzasoft/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cuzzasoft",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 6 | 2017-04-04T23:39:36Z | 2021-08-28T00:06:02Z | 2017-04-05T06:01:33Z | NONE | resolved | Can reproduce with the below:
```
import requests
r = requests.get('https://downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-6.0.5.zip', stream=True)
print r.headers.get('content-length')
None
```
This results in None - I'm using content-length for a download progress bar and can't get it with requests ;(
If we use something else like urllib it returns it:
```
import urllib
r = urllib.urlopen(url).info()
print r
Content-Type: application/zip
Content-Length: 541131731
```
This used to work a while back, not sure if anything changed. Reproduced with Python 2.7.13 & 3.6.0 with requests 2.13.0. | {
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3953/reactions"
} | https://api.github.com/repos/psf/requests/issues/3953/timeline | null | completed | null | null | false | [
"If you look at the headers that *are* returned, you will notice\r\n\r\n```\r\nTransfer-Encoding: chunked\r\n```\r\n\r\nIf you compare the headers that are sent, however, using `httpbin`, you might notice that Requests also sends `Accept-Encoding: gzip, deflate`. If you remove that header, e.g., \r\n\r\n```py\r\nr ... |
https://api.github.com/repos/psf/requests/issues/3952 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3952/labels{/name} | https://api.github.com/repos/psf/requests/issues/3952/comments | https://api.github.com/repos/psf/requests/issues/3952/events | https://github.com/psf/requests/pull/3952 | 218,755,757 | MDExOlB1bGxSZXF1ZXN0MTEzODEzMDMx | 3,952 | Small help in docs to indicate client side authentication | {
"avatar_url": "https://avatars.githubusercontent.com/u/1532417?v=4",
"events_url": "https://api.github.com/users/tonybaloney/events{/privacy}",
"followers_url": "https://api.github.com/users/tonybaloney/followers",
"following_url": "https://api.github.com/users/tonybaloney/following{/other_user}",
"gists_url": "https://api.github.com/users/tonybaloney/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tonybaloney",
"id": 1532417,
"login": "tonybaloney",
"node_id": "MDQ6VXNlcjE1MzI0MTc=",
"organizations_url": "https://api.github.com/users/tonybaloney/orgs",
"received_events_url": "https://api.github.com/users/tonybaloney/received_events",
"repos_url": "https://api.github.com/users/tonybaloney/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tonybaloney/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tonybaloney/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tonybaloney",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-04-02T10:32:29Z | 2021-09-07T00:06:26Z | 2017-04-02T10:41:53Z | CONTRIBUTOR | resolved | See https://github.com/kennethreitz/requests/issues/3951 | {
"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/3952/reactions"
} | https://api.github.com/repos/psf/requests/issues/3952/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3952.diff",
"html_url": "https://github.com/psf/requests/pull/3952",
"merged_at": "2017-04-02T10:41:53Z",
"patch_url": "https://github.com/psf/requests/pull/3952.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3952"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3952?src=pr&el=h1) Report\n> Merging [#3952](https://codecov.io/gh/kennethreitz/requests/pull/3952?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/993cbf57419fca7562ff0990df1bd32f748a9bfe?src=pr&el=desc) will **not change... |
https://api.github.com/repos/psf/requests/issues/3951 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3951/labels{/name} | https://api.github.com/repos/psf/requests/issues/3951/comments | https://api.github.com/repos/psf/requests/issues/3951/events | https://github.com/psf/requests/issues/3951 | 218,751,293 | MDU6SXNzdWUyMTg3NTEyOTM= | 3,951 | Request signing and access to SSLContext | {
"avatar_url": "https://avatars.githubusercontent.com/u/1532417?v=4",
"events_url": "https://api.github.com/users/tonybaloney/events{/privacy}",
"followers_url": "https://api.github.com/users/tonybaloney/followers",
"following_url": "https://api.github.com/users/tonybaloney/following{/other_user}",
"gists_url": "https://api.github.com/users/tonybaloney/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tonybaloney",
"id": 1532417,
"login": "tonybaloney",
"node_id": "MDQ6VXNlcjE1MzI0MTc=",
"organizations_url": "https://api.github.com/users/tonybaloney/orgs",
"received_events_url": "https://api.github.com/users/tonybaloney/received_events",
"repos_url": "https://api.github.com/users/tonybaloney/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tonybaloney/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tonybaloney/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tonybaloney",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 5 | 2017-04-02T08:55:19Z | 2021-09-08T11:00:36Z | 2017-04-02T10:42:00Z | CONTRIBUTOR | resolved | I've just finished porting a large project from httplib to requests, it talks to over 50 APIs with pretty much every weird and obtuse spec you could think of.
The only one I got slightly stuck on was the OpenStack Identity, Azure Management (classic) APIs and Docker when TLS is enabled. All require certificate based authentication.
In `httplib` we would use the std library and access SSLContext to wrap the connection with a signed payload. I spent a few hours researching the correct way to do this in `requests`, found that I could access them via `urllib3` and create an ssl context through a utility method https://github.com/kennethreitz/requests/blob/master/requests/packages/urllib3/util/ssl_.py#L321-L324 but didn't want to couple myself directly to the internals of a 3rd party package.
The `PoolManager` initializer has a kwarg for both `key_file` and `cert_file`, it doesn't expose those in the Session API in any way that I could see without having to write a custom adapter like this:
```python
class SignedHTTPSAdapter(HTTPAdapter):
def __init__(self, cert_file, key_file):
self.cert_file = cert_file
self.key_file = key_file
super(SignedHTTPSAdapter, self).__init__()
def init_poolmanager(self, connections, maxsize, block=False):
self.poolmanager = PoolManager(
num_pools=connections, maxsize=maxsize,
block=block,
cert_file=self.cert_file,
key_file=self.key_file)
session = requests.Session()
session.mount('https://', SignedHTTPSAdapter(cert_file, key_file))
```
I'd like to help the next person and save them the 3 hours it took me to figure this out by either making it easier, documenting the solution or the scenario.
Happy to raise PR for either
1. Lift access to set the `cert_file` and `key_file` higher up in the API so it doesn't require a custom adapter.
2. Leave it as is, document this in the advanced section, happy to contribute docs on how to make a signed request.
3. Nothing needs to change and this issue can be a reference for the next person! | {
"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/3951/reactions"
} | https://api.github.com/repos/psf/requests/issues/3951/timeline | null | completed | null | null | false | [
"Did you see the `cert` argument in the docs? It should cover what you need. ",
"Cert argument on the session initializer? http://docs.python-requests.org/en/master/api/#requests.Session.cert\r\n\r\nAh ok it can be a tuple to provide cert_file and key looking here\r\nhttps://github.com/kennethreitz/requests/blob/... |
https://api.github.com/repos/psf/requests/issues/3950 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3950/labels{/name} | https://api.github.com/repos/psf/requests/issues/3950/comments | https://api.github.com/repos/psf/requests/issues/3950/events | https://github.com/psf/requests/issues/3950 | 218,741,415 | MDU6SXNzdWUyMTg3NDE0MTU= | 3,950 | Header payload | {
"avatar_url": "https://avatars.githubusercontent.com/u/3818078?v=4",
"events_url": "https://api.github.com/users/spdd/events{/privacy}",
"followers_url": "https://api.github.com/users/spdd/followers",
"following_url": "https://api.github.com/users/spdd/following{/other_user}",
"gists_url": "https://api.github.com/users/spdd/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/spdd",
"id": 3818078,
"login": "spdd",
"node_id": "MDQ6VXNlcjM4MTgwNzg=",
"organizations_url": "https://api.github.com/users/spdd/orgs",
"received_events_url": "https://api.github.com/users/spdd/received_events",
"repos_url": "https://api.github.com/users/spdd/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/spdd/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/spdd/subscriptions",
"type": "User",
"url": "https://api.github.com/users/spdd",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-04-02T04:35:47Z | 2021-09-08T11:00:36Z | 2017-04-02T08:51:56Z | NONE | resolved | I'm trying to post image to a server like this:
```
headers = {
'Accept': '*/*',
'Content-Type': 'image/png'
}
files = { None: open('2.png', 'rb')}
response = request.post('http://server', headers = headers, files = files)
```
but in debug tool of request I see that:
```
### --9eddf6ca1dde46278024b688838539ad
Content-Disposition: form-data; filename="2.png"
PNG
binary data....
```
But server not accept this image.
if I upload image from safari browser it worked the request looks like:
```
PNG
binary data....
```
without `Content-Disposition: form-data; filename="2.png"`
How can I remove this meta info in request via requests? | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3950/reactions"
} | https://api.github.com/repos/psf/requests/issues/3950/timeline | null | completed | null | null | false | [
"You want to change to this:\r\n\r\n```python\r\nheaders = {\r\n\t'Accept': '*/*',\r\n\t'Content-Type': 'image/png'\r\n}\r\n\r\nfiles = { None: open('2.png', 'rb')}\r\nresponse = request.post('http://server', data = open('2.png', 'rb'), headers = headers)\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/3949 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3949/labels{/name} | https://api.github.com/repos/psf/requests/issues/3949/comments | https://api.github.com/repos/psf/requests/issues/3949/events | https://github.com/psf/requests/issues/3949 | 218,694,033 | MDU6SXNzdWUyMTg2OTQwMzM= | 3,949 | Redirection behaviour not consistent between Python2 & 3 | {
"avatar_url": "https://avatars.githubusercontent.com/u/7995100?v=4",
"events_url": "https://api.github.com/users/BastiTee/events{/privacy}",
"followers_url": "https://api.github.com/users/BastiTee/followers",
"following_url": "https://api.github.com/users/BastiTee/following{/other_user}",
"gists_url": "https://api.github.com/users/BastiTee/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/BastiTee",
"id": 7995100,
"login": "BastiTee",
"node_id": "MDQ6VXNlcjc5OTUxMDA=",
"organizations_url": "https://api.github.com/users/BastiTee/orgs",
"received_events_url": "https://api.github.com/users/BastiTee/received_events",
"repos_url": "https://api.github.com/users/BastiTee/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/BastiTee/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/BastiTee/subscriptions",
"type": "User",
"url": "https://api.github.com/users/BastiTee",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-04-01T12:54:05Z | 2021-09-08T11:00:37Z | 2017-04-01T15:58:16Z | NONE | resolved | Hi there,
consider this minimal test:
```
from requests import exceptions, Session
url="http://ansgar-skoda.tumblr.com/post/96703389502"
try:
s = Session()
r = s.get(url)
except exceptions.TooManyRedirects as t:
print('ERROR: {}'.format(t))
r = s.get(url, allow_redirects=False)
print('========')
print(r.status_code)
print(r.headers)
```
Calling the link in a browser or via `curl -L` will follow the redirects and return a HTTP 200 after the redirection. That's what I expect.
The code above acts according to expectation when executed with Python2 but not with Python3.
With Python3 you'll get stuck in a redirection loop that gets broken by the TooManyRedirection exception.
In both cases I installed requests 2.13.0 via pip.
I originally posted that on [Stackoverflow](http://stackoverflow.com/questions/43155127/how-to-correctly-setup-redirection-with-python-requests-for-some-corner-cases).
| {
"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/3949/reactions"
} | https://api.github.com/repos/psf/requests/issues/3949/timeline | null | completed | null | null | false | [
"Hey @BastiTee, thanks for taking the time to open this. The reason you're seeing this work in Python 2 vs Python 3 is the character encoding used. It also appears to be a dupe of #3888 but that puts more weight towards addressing this.\r\n\r\nSince Python 2 has bytes as the default representation for strings, we'r... |
https://api.github.com/repos/psf/requests/issues/3948 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3948/labels{/name} | https://api.github.com/repos/psf/requests/issues/3948/comments | https://api.github.com/repos/psf/requests/issues/3948/events | https://github.com/psf/requests/issues/3948 | 218,477,170 | MDU6SXNzdWUyMTg0NzcxNzA= | 3,948 | Requests not working in a Docker container | {
"avatar_url": "https://avatars.githubusercontent.com/u/12761574?v=4",
"events_url": "https://api.github.com/users/javixeneize/events{/privacy}",
"followers_url": "https://api.github.com/users/javixeneize/followers",
"following_url": "https://api.github.com/users/javixeneize/following{/other_user}",
"gists_url": "https://api.github.com/users/javixeneize/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/javixeneize",
"id": 12761574,
"login": "javixeneize",
"node_id": "MDQ6VXNlcjEyNzYxNTc0",
"organizations_url": "https://api.github.com/users/javixeneize/orgs",
"received_events_url": "https://api.github.com/users/javixeneize/received_events",
"repos_url": "https://api.github.com/users/javixeneize/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/javixeneize/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/javixeneize/subscriptions",
"type": "User",
"url": "https://api.github.com/users/javixeneize",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 42 | 2017-03-31T11:38:41Z | 2021-11-03T19:00:30Z | 2017-07-29T23:36:00Z | NONE | resolved | Hi
Thats the old story about SSL not working with requests, but one step further.... Docker containers
I have an application that uses requests, and it works fine in my local machine, but, when deploying it in a Docker container, i am having an error with requests module (SSL error)
[2017-03-31 11:32:29,863] ERROR in app: Exception on /send [POST]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "app.py", line 62, in sendrequest
response=sess.post(url,params, headers=h,verify=False)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 535, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
I have heard it might be related to openSSL. Any idea on how this can be resolved? Should i include any dependency?
| {
"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/3948/reactions"
} | https://api.github.com/repos/psf/requests/issues/3948/timeline | null | completed | null | null | false | [
"Can you run `openssl version` in your container?",
"This can also very definitely be related to the Python version, we'd like to know that as well.",
"Hi\r\n\r\nPython 2.7 (12)\r\nOpenssl 1.0.2g\r\n\r\nThanks",
"Are you running the same version of Requests in the container and outside? What are the two versi... |
https://api.github.com/repos/psf/requests/issues/3947 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3947/labels{/name} | https://api.github.com/repos/psf/requests/issues/3947/comments | https://api.github.com/repos/psf/requests/issues/3947/events | https://github.com/psf/requests/issues/3947 | 218,384,941 | MDU6SXNzdWUyMTgzODQ5NDE= | 3,947 | `datetime.datetime() is not JSON serializable` error | {
"avatar_url": "https://avatars.githubusercontent.com/u/18148490?v=4",
"events_url": "https://api.github.com/users/paultiplady/events{/privacy}",
"followers_url": "https://api.github.com/users/paultiplady/followers",
"following_url": "https://api.github.com/users/paultiplady/following{/other_user}",
"gists_url": "https://api.github.com/users/paultiplady/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/paultiplady",
"id": 18148490,
"login": "paultiplady",
"node_id": "MDQ6VXNlcjE4MTQ4NDkw",
"organizations_url": "https://api.github.com/users/paultiplady/orgs",
"received_events_url": "https://api.github.com/users/paultiplady/received_events",
"repos_url": "https://api.github.com/users/paultiplady/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/paultiplady/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/paultiplady/subscriptions",
"type": "User",
"url": "https://api.github.com/users/paultiplady",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-31T03:00:56Z | 2021-09-08T11:00:36Z | 2017-04-02T00:16:03Z | NONE | resolved | If I do a `request()` with JSON containing unserializable types, an exception is raised from the `json` module.
e.g. `requests.post('http://example.com', json={'time': datetime.datetime.now()})`
https://github.com/kennethreitz/requests/issues/1380 looks vaguely related, but doesn't directly cover this.
https://docs.python.org/2/library/json.html#json.JSONEncoder seems pretty well suited for this case; if it was possible to configure the json encoder class that Requests uses, then users could supply an implementation that handles their special cases.
Should be possible to either plumb the encoder through from the `request` call, or make it package-level config in some way. Would you consider a patch to make the JSONEncoder that `request` uses configurable?
(The solution of just massaging the data is viable in many cases, but for complex dicts it is going to be quite painful.) | {
"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/3947/reactions"
} | https://api.github.com/repos/psf/requests/issues/3947/timeline | null | completed | null | null | false | [
"So, we absolutely can do that, but ultimately I'm not sure that the value proposition is worth it. In 99% of use-cases the JSON argument literally only does `json.dumps` and then sets the `Content-Type` header to `application/json`. If you're not setting the JSON field *and* some other fields, you can totally repl... |
https://api.github.com/repos/psf/requests/issues/3946 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3946/labels{/name} | https://api.github.com/repos/psf/requests/issues/3946/comments | https://api.github.com/repos/psf/requests/issues/3946/events | https://github.com/psf/requests/issues/3946 | 218,329,135 | MDU6SXNzdWUyMTgzMjkxMzU= | 3,946 | requests takes a half-second to import | {
"avatar_url": "https://avatars.githubusercontent.com/u/620295?v=4",
"events_url": "https://api.github.com/users/ktdreyer/events{/privacy}",
"followers_url": "https://api.github.com/users/ktdreyer/followers",
"following_url": "https://api.github.com/users/ktdreyer/following{/other_user}",
"gists_url": "https://api.github.com/users/ktdreyer/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ktdreyer",
"id": 620295,
"login": "ktdreyer",
"node_id": "MDQ6VXNlcjYyMDI5NQ==",
"organizations_url": "https://api.github.com/users/ktdreyer/orgs",
"received_events_url": "https://api.github.com/users/ktdreyer/received_events",
"repos_url": "https://api.github.com/users/ktdreyer/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ktdreyer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ktdreyer/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ktdreyer",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 4 | 2017-03-30T21:10:30Z | 2021-09-08T11:00:37Z | 2017-03-30T23:13:21Z | NONE | resolved | I noticed it was taking a half-second just to run `--help` for my app, and narrowed it down to requests 2.12.0 taking a long time to load.
I'm on Python 2.7.13, Fedora 25.
Here is the 2.12 series:
```
$ pip install requests==2.12.0
$ time python -c 'import requests'
real 0m0.487s
user 0m0.445s
sys 0m0.040s
$ strace -e open python -c 'import requests' 2>&1 | wc -l
6836
```
0.487 seconds to import, almost 7000 open() calls.
Compared to 2.11.1:
```
$ pip install requests==2.11.1
$ time python -c 'import requests'
real 0m0.085s
user 0m0.066s
sys 0m0.019s
$ strace -e open python -c 'import requests' 2>&1 | wc -l
2321
```
under a tenth of a second to import, and 66% fewer open() calls. | {
"avatar_url": "https://avatars.githubusercontent.com/u/620295?v=4",
"events_url": "https://api.github.com/users/ktdreyer/events{/privacy}",
"followers_url": "https://api.github.com/users/ktdreyer/followers",
"following_url": "https://api.github.com/users/ktdreyer/following{/other_user}",
"gists_url": "https://api.github.com/users/ktdreyer/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ktdreyer",
"id": 620295,
"login": "ktdreyer",
"node_id": "MDQ6VXNlcjYyMDI5NQ==",
"organizations_url": "https://api.github.com/users/ktdreyer/orgs",
"received_events_url": "https://api.github.com/users/ktdreyer/received_events",
"repos_url": "https://api.github.com/users/ktdreyer/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ktdreyer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ktdreyer/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ktdreyer",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3946/reactions"
} | https://api.github.com/repos/psf/requests/issues/3946/timeline | null | completed | null | null | false | [
"Can you show us the output of `pip freeze`? Does this happen when the *only* change you make is what Requests version is installed?",
"Oh, never mind, I know what this is: this is due to the idna library we vendored in that release. Does this slowness apply up to the current 2.13 release?",
"Thanks for the poi... |
https://api.github.com/repos/psf/requests/issues/3945 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3945/labels{/name} | https://api.github.com/repos/psf/requests/issues/3945/comments | https://api.github.com/repos/psf/requests/issues/3945/events | https://github.com/psf/requests/issues/3945 | 218,265,882 | MDU6SXNzdWUyMTgyNjU4ODI= | 3,945 | response.iter_lines(decode_unicode=True) sometimes returns bytestrings | {
"avatar_url": "https://avatars.githubusercontent.com/u/26739?v=4",
"events_url": "https://api.github.com/users/peterbe/events{/privacy}",
"followers_url": "https://api.github.com/users/peterbe/followers",
"following_url": "https://api.github.com/users/peterbe/following{/other_user}",
"gists_url": "https://api.github.com/users/peterbe/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/peterbe",
"id": 26739,
"login": "peterbe",
"node_id": "MDQ6VXNlcjI2NzM5",
"organizations_url": "https://api.github.com/users/peterbe/orgs",
"received_events_url": "https://api.github.com/users/peterbe/received_events",
"repos_url": "https://api.github.com/users/peterbe/repos",
"site_admin": true,
"starred_url": "https://api.github.com/users/peterbe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/peterbe/subscriptions",
"type": "User",
"url": "https://api.github.com/users/peterbe",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-30T17:11:22Z | 2021-09-08T11:00:37Z | 2017-03-30T17:25:04Z | NONE | resolved | ```python
response = requests.get('https://s3-us-west-2.amazonaws.com/org.mozilla.crash-stats.symbols-public/v1/wntdll.pdb/D74F79EB1F8D4A45ABCD2F476CCABACC2/wntdll.sym', stream=True)
for line in response.iter_lines(decode_unicode=True):
print(type(line), repr(line[:50]))
break
response = requests.get('https://s3-us-west-2.amazonaws.com/org.mozilla.crash-stats.symbols-public/v1/ntdll.pdb/120028FA453F4CD5A6A404EC37396A582/ntdll.sym', stream=True)
for line in response.iter_lines(decode_unicode=True):
print(type(line), repr(line[:50]))
break
```
When I run this, I get this output:
```
▶ python3.5 test.py
<class 'str'> 'MODULE windows x86 D74F79EB1F8D4A45ABCD2F476CCABAC'
<class 'bytes'> b'MODULE windows x86 120028FA453F4CD5A6A404EC37396A5'
```
Here's what I get with python 2.7 (with `from __future__ import print_function`)
```
▶ python test.py
<type 'unicode'> u'MODULE windows x86 D74F79EB1F8D4A45ABCD2F476CCABAC'
<type 'str'> 'MODULE windows x86 120028FA453F4CD5A6A404EC37396A5'
```
| {
"avatar_url": "https://avatars.githubusercontent.com/u/26739?v=4",
"events_url": "https://api.github.com/users/peterbe/events{/privacy}",
"followers_url": "https://api.github.com/users/peterbe/followers",
"following_url": "https://api.github.com/users/peterbe/following{/other_user}",
"gists_url": "https://api.github.com/users/peterbe/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/peterbe",
"id": 26739,
"login": "peterbe",
"node_id": "MDQ6VXNlcjI2NzM5",
"organizations_url": "https://api.github.com/users/peterbe/orgs",
"received_events_url": "https://api.github.com/users/peterbe/received_events",
"repos_url": "https://api.github.com/users/peterbe/repos",
"site_admin": true,
"starred_url": "https://api.github.com/users/peterbe/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/peterbe/subscriptions",
"type": "User",
"url": "https://api.github.com/users/peterbe",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3945/reactions"
} | https://api.github.com/repos/psf/requests/issues/3945/timeline | null | completed | null | null | false | [
"Actually, I think it's `iter_content`, not `iter_lines` specifically. \r\n```python\r\nresponse = requests.get('https://s3-us-west-2.amazonaws.com/org.mozilla.crash-stats.symbols-public/v1/wntdll.pdb/D74F79EB1F8D4A45ABCD2F476CCABACC2/wntdll.sym', stream=True)\r\nfor chunk in response.iter_content(100, decode_unico... |
https://api.github.com/repos/psf/requests/issues/3944 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3944/labels{/name} | https://api.github.com/repos/psf/requests/issues/3944/comments | https://api.github.com/repos/psf/requests/issues/3944/events | https://github.com/psf/requests/issues/3944 | 218,113,581 | MDU6SXNzdWUyMTgxMTM1ODE= | 3,944 | Insert list of data into POST request | {
"avatar_url": "https://avatars.githubusercontent.com/u/13488059?v=4",
"events_url": "https://api.github.com/users/MaxOvcharov/events{/privacy}",
"followers_url": "https://api.github.com/users/MaxOvcharov/followers",
"following_url": "https://api.github.com/users/MaxOvcharov/following{/other_user}",
"gists_url": "https://api.github.com/users/MaxOvcharov/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MaxOvcharov",
"id": 13488059,
"login": "MaxOvcharov",
"node_id": "MDQ6VXNlcjEzNDg4MDU5",
"organizations_url": "https://api.github.com/users/MaxOvcharov/orgs",
"received_events_url": "https://api.github.com/users/MaxOvcharov/received_events",
"repos_url": "https://api.github.com/users/MaxOvcharov/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MaxOvcharov/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MaxOvcharov/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MaxOvcharov",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-30T08:06:48Z | 2021-09-08T11:00:38Z | 2017-03-30T08:10:48Z | NONE | resolved | Hi, I try to insert list of data into body of my POST request. Example from documentation:
```
POST https://apidata.mos.ru/v1/datasets
[ "Id", "Caption", "SefUrl"]
```
Result:
`[ { "Id": 1147, "Caption": "Электронная нотная библиотека города Москвы", "SefUrl": "7719028495-elektronnaya-notnaya-biblioteka-goroda-moskvy" } ]`
My version of code:
```
import pprint
import requests
from requests import Session, Request
method = 'datasets'
data_list = ["Id", "Caption", "SefUrl"']
s = Session()
req = Request('POST', 'https://apidata.mos.ru/v1/{0}'.format(method))
prepped = req.prepare()
prepped.body = data_list
esponse = s.send(prepped)
response = requests.post('https://apidata.mos.ru/v1/{0}'.format(method), data=data_list)
print response.url
if response.status_code == 200:
pprint.pprint(response.json())
else: # TODO - use custom exceptions
message = "A request to the DataMos API was unsuccessful. The server returned HTTP {0} {1}."
print message.format(response.status_code, response.reason)
```
The result is:
```
Traceback (most recent call last):
File "/home/max/bot_project/DataMosAPI/data_mos_api/test_post.py", line 12, in <module>
response = s.send(prepped)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python2.7/httplib.py", line 1057, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1097, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1053, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 901, in _send_output
self.send(message_body)
File "/usr/lib/python2.7/httplib.py", line 873, in send
self.sock.sendall(data)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 311, in sendall
sent = self._send_until_done(data[total_sent:total_sent + SSL_WRITE_BLOCKSIZE])
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 301, in _send_until_done
return self.connection.send(data)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 1253, in send
raise TypeError("data must be a memoryview, buffer or byte string")
TypeError: data must be a memoryview, buffer or byte string
```
| {
"avatar_url": "https://avatars.githubusercontent.com/u/13488059?v=4",
"events_url": "https://api.github.com/users/MaxOvcharov/events{/privacy}",
"followers_url": "https://api.github.com/users/MaxOvcharov/followers",
"following_url": "https://api.github.com/users/MaxOvcharov/following{/other_user}",
"gists_url": "https://api.github.com/users/MaxOvcharov/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MaxOvcharov",
"id": 13488059,
"login": "MaxOvcharov",
"node_id": "MDQ6VXNlcjEzNDg4MDU5",
"organizations_url": "https://api.github.com/users/MaxOvcharov/orgs",
"received_events_url": "https://api.github.com/users/MaxOvcharov/received_events",
"repos_url": "https://api.github.com/users/MaxOvcharov/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MaxOvcharov/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MaxOvcharov/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MaxOvcharov",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3944/reactions"
} | https://api.github.com/repos/psf/requests/issues/3944/timeline | null | completed | null | null | false | [
"It looks like your API is expecting you to post JSON. Try simplifying your code to this:\r\n\r\n```python\r\nimport pprint\r\nimport requests\r\nfrom requests import Session, Request\r\n\r\nmethod = 'datasets'\r\ndata_list = [\"Id\", \"Caption\", \"SefUrl\"']\r\ns = Session()\r\nresponse = requests.post('https://a... |
https://api.github.com/repos/psf/requests/issues/3943 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3943/labels{/name} | https://api.github.com/repos/psf/requests/issues/3943/comments | https://api.github.com/repos/psf/requests/issues/3943/events | https://github.com/psf/requests/pull/3943 | 217,919,936 | MDExOlB1bGxSZXF1ZXN0MTEzMjI5ODU1 | 3,943 | HTTPAdapter.send() timeout defaults | {
"avatar_url": "https://avatars.githubusercontent.com/u/6097948?v=4",
"events_url": "https://api.github.com/users/leo-b/events{/privacy}",
"followers_url": "https://api.github.com/users/leo-b/followers",
"following_url": "https://api.github.com/users/leo-b/following{/other_user}",
"gists_url": "https://api.github.com/users/leo-b/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/leo-b",
"id": 6097948,
"login": "leo-b",
"node_id": "MDQ6VXNlcjYwOTc5NDg=",
"organizations_url": "https://api.github.com/users/leo-b/orgs",
"received_events_url": "https://api.github.com/users/leo-b/received_events",
"repos_url": "https://api.github.com/users/leo-b/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/leo-b/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/leo-b/subscriptions",
"type": "User",
"url": "https://api.github.com/users/leo-b",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-03-29T15:42:47Z | 2021-09-06T00:07:05Z | 2017-04-03T15:45:12Z | CONTRIBUTOR | resolved | This PR allows to use urllib3 ``Timeout`` objects as ``timeout`` argument in ``HTTPAdapter.send()``.
Besides it omits the ``timeout`` argument when calling ``conn.urlopen()`` if ``HTTPAdapter.send()`` is called without a timeout. This allows setting a default timeout at connection pool level:
`adapter.poolmanager.connection_pool_kw['timeout'] = urllib3.Timeout(...)` | {
"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/3943/reactions"
} | https://api.github.com/repos/psf/requests/issues/3943/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3943.diff",
"html_url": "https://github.com/psf/requests/pull/3943",
"merged_at": "2017-04-03T15:45:12Z",
"patch_url": "https://github.com/psf/requests/pull/3943.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3943"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3943?src=pr&el=h1) Report\n> Merging [#3943](https://codecov.io/gh/kennethreitz/requests/pull/3943?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/993cbf57419fca7562ff0990df1bd32f748a9bfe?src=pr&el=desc) will **decrease**... |
https://api.github.com/repos/psf/requests/issues/3942 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3942/labels{/name} | https://api.github.com/repos/psf/requests/issues/3942/comments | https://api.github.com/repos/psf/requests/issues/3942/events | https://github.com/psf/requests/issues/3942 | 217,364,864 | MDU6SXNzdWUyMTczNjQ4NjQ= | 3,942 | requests.put redirect from http to https doesn't forward JSON payload | {
"avatar_url": "https://avatars.githubusercontent.com/u/21244569?v=4",
"events_url": "https://api.github.com/users/colekas-csc/events{/privacy}",
"followers_url": "https://api.github.com/users/colekas-csc/followers",
"following_url": "https://api.github.com/users/colekas-csc/following{/other_user}",
"gists_url": "https://api.github.com/users/colekas-csc/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/colekas-csc",
"id": 21244569,
"login": "colekas-csc",
"node_id": "MDQ6VXNlcjIxMjQ0NTY5",
"organizations_url": "https://api.github.com/users/colekas-csc/orgs",
"received_events_url": "https://api.github.com/users/colekas-csc/received_events",
"repos_url": "https://api.github.com/users/colekas-csc/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/colekas-csc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/colekas-csc/subscriptions",
"type": "User",
"url": "https://api.github.com/users/colekas-csc",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-03-27T20:26:25Z | 2021-09-08T11:00:39Z | 2017-03-27T21:27:30Z | NONE | resolved | Python version - 2.7.12
Requests version - 2.13.0
I was incorrectly hitting an internal server with an put http request versus an https and the json=<blah> blob doesn't appear to be passed through. The headers and params keys do appear to be passed through.
| {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3942/reactions"
} | https://api.github.com/repos/psf/requests/issues/3942/timeline | null | completed | null | null | false | [
"Hey @colekas-csc, this is intended functionality in Requests 2.13.0. When Requests receives a redirect, it strips the payload to prevent unintentional transfer of information to the wrong server. We're a tad overzealous with this right now which is why this behavior will be modified in 3.0.0, but for now we must m... |
https://api.github.com/repos/psf/requests/issues/3941 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3941/labels{/name} | https://api.github.com/repos/psf/requests/issues/3941/comments | https://api.github.com/repos/psf/requests/issues/3941/events | https://github.com/psf/requests/issues/3941 | 217,174,342 | MDU6SXNzdWUyMTcxNzQzNDI= | 3,941 | request with allow_redirect use the wrong Host in Headers ( setting the Host in headers) | {
"avatar_url": "https://avatars.githubusercontent.com/u/3280855?v=4",
"events_url": "https://api.github.com/users/JeffXue/events{/privacy}",
"followers_url": "https://api.github.com/users/JeffXue/followers",
"following_url": "https://api.github.com/users/JeffXue/following{/other_user}",
"gists_url": "https://api.github.com/users/JeffXue/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/JeffXue",
"id": 3280855,
"login": "JeffXue",
"node_id": "MDQ6VXNlcjMyODA4NTU=",
"organizations_url": "https://api.github.com/users/JeffXue/orgs",
"received_events_url": "https://api.github.com/users/JeffXue/received_events",
"repos_url": "https://api.github.com/users/JeffXue/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/JeffXue/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JeffXue/subscriptions",
"type": "User",
"url": "https://api.github.com/users/JeffXue",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-03-27T08:43:08Z | 2021-09-08T11:00:39Z | 2017-03-27T10:02:07Z | NONE | resolved | send a request with allow_redirect=true and set the Host, but auto redirect the 302 response will use the wrong Host in Headers
```
s = requests.session()
url = 'https://sso.jeffxue.com/login'
headers.update({'Host', 'sso.jeffxue.com'})
datas = {'username': 'xxxx', 'password': 'xxxxx', service: 'web'}
cookies = {'xxxx': 'xxxxx'}
r = s.post(url, data=datas, headers=headers, cookies=cookies, allow_redirects=True, timeout=10)
```
but after checking the history, found it use the wrong Host like:
first request use the right host, because i set the Host in headers
```
history request url: https://sso.jeffxue.com/login
history request headers: {'Content-Length': '52', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'keep-alive', 'Accept': '*/*', 'User-Agent': 'python-requests/2.9.1', 'Host': u'sso.jeffxue.com', 'Cookie': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/x-www-form-urlencoded'}
history response status_code: 302
history response headers: {'Content-Length': '0', 'Set-Cookie': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Business-Status': '200', 'Expires': 'Wed, 31 Dec 1969 23:59:59 GMT', 'Connection': 'keep-alive', 'Location':
'https://corp.jeffxue.com/index?ticket=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&client=web', 'Pragma': 'no-cache', 'Cache-Control': 'no-store', 'Date': 'Mon, 27 Mar 2017 07:58:02 GMT'}
```
first 302 request will redirect to the diff host(corp.jeffxue.com), but it will use the sso.jeffxue.com in headers
```
history request url: https://corp.jeffxue.com/index?ticket=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&client=web
history request headers: {'Accept-Encoding': 'gzip, deflate', 'Host': u'sso.jeffxue.com', 'Accept': '*/*', 'User-Agent': 'python-requests/2.9.1', 'Connection': 'keep-alive', 'Cookie': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/x-www-form-urlencoded'}
history response status_code: 302
history response headers: {'Content-Length': '0', 'Set-Cookie': 'xxxxxxxxxxxxxxxxxxxxxxxxx', 'Business-Status': '200', 'Connection': 'keep-alive', 'Location': 'http://sso.jeffxue.com/index?fileTicket=xxxxxxxxxxxxxxxxxxxxxxxx&client=web', 'Date': 'Mon, 27 Mar 2017 07:58:02 GMT'}
``` | {
"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/3941/reactions"
} | https://api.github.com/repos/psf/requests/issues/3941/timeline | null | completed | null | null | false | [
"Yes, this is intended behaviour.\r\n\r\nRequests assumes that if you set the host header yourself then you know better than us, and that you want us to use what you set. You will get the behaviour you want by just not setting the host header.\r\n\r\nOther headers you should not set are: Content-Length, Accept-Enco... |
https://api.github.com/repos/psf/requests/issues/3940 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3940/labels{/name} | https://api.github.com/repos/psf/requests/issues/3940/comments | https://api.github.com/repos/psf/requests/issues/3940/events | https://github.com/psf/requests/issues/3940 | 216,996,721 | MDU6SXNzdWUyMTY5OTY3MjE= | 3,940 | Disabling SSL verification at application level | {
"avatar_url": "https://avatars.githubusercontent.com/u/13354131?v=4",
"events_url": "https://api.github.com/users/rnagpal/events{/privacy}",
"followers_url": "https://api.github.com/users/rnagpal/followers",
"following_url": "https://api.github.com/users/rnagpal/following{/other_user}",
"gists_url": "https://api.github.com/users/rnagpal/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rnagpal",
"id": 13354131,
"login": "rnagpal",
"node_id": "MDQ6VXNlcjEzMzU0MTMx",
"organizations_url": "https://api.github.com/users/rnagpal/orgs",
"received_events_url": "https://api.github.com/users/rnagpal/received_events",
"repos_url": "https://api.github.com/users/rnagpal/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rnagpal/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rnagpal/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rnagpal",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 4 | 2017-03-25T19:11:24Z | 2021-09-08T11:00:39Z | 2017-03-25T19:16:08Z | NONE | resolved | Is there a way to disable SSL verification at my application level?
I'm using the requests module which allows be to disable it per request level(by setting verify to false) but I wanted to way to disable for all requests. I'm running my tests against my local emulator, so I don't need that check and hence want to disable it at my application(test) level.
I'm looking for something like process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0" as used in Node.js
I'm on Python 2.7 | {
"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/3940/reactions"
} | https://api.github.com/repos/psf/requests/issues/3940/timeline | null | completed | null | null | false | [
"Thanks for reaching out!\r\n\r\nThere is no way to do this, no. This is quite deliberate: such a setting is what I'd call an \"attractive nuisance\". Put another way, it's a setting that users are likely to attempt to use rather than solving the problem they have. Worse, it's a setting that is easily enabled and t... |
https://api.github.com/repos/psf/requests/issues/3939 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3939/labels{/name} | https://api.github.com/repos/psf/requests/issues/3939/comments | https://api.github.com/repos/psf/requests/issues/3939/events | https://github.com/psf/requests/issues/3939 | 216,629,503 | MDU6SXNzdWUyMTY2Mjk1MDM= | 3,939 | requests.exceptions.SSLError: (\"bad handshake: SysCallError(-1, 'Unexpected EOF') | {
"avatar_url": "https://avatars.githubusercontent.com/u/15217582?v=4",
"events_url": "https://api.github.com/users/a-sharma11/events{/privacy}",
"followers_url": "https://api.github.com/users/a-sharma11/followers",
"following_url": "https://api.github.com/users/a-sharma11/following{/other_user}",
"gists_url": "https://api.github.com/users/a-sharma11/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/a-sharma11",
"id": 15217582,
"login": "a-sharma11",
"node_id": "MDQ6VXNlcjE1MjE3NTgy",
"organizations_url": "https://api.github.com/users/a-sharma11/orgs",
"received_events_url": "https://api.github.com/users/a-sharma11/received_events",
"repos_url": "https://api.github.com/users/a-sharma11/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/a-sharma11/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/a-sharma11/subscriptions",
"type": "User",
"url": "https://api.github.com/users/a-sharma11",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 7 | 2017-03-24T02:45:45Z | 2021-09-08T11:00:39Z | 2017-03-24T12:25:37Z | NONE | resolved | i have a flask application that need to get some data from other web endpoints. I am getting this error when trying to make a get call using requests
Note - This only happens when running with uWSGI. if i run flask app directly, it works fine.
```
"SSLError(SSLError(SSLError(\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",),),)", "exception": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py\", line 436, in wrap_socket\n cnx.do_handshake()\n File \"/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py\", line 1426, in do_handshake\n self._raise_ssl_error(self._ssl, result)\n File \"/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py\", line 1167, in _raise_ssl_error\n raise SysCallError(-1, \"Unexpected EOF\")\nOpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py\", line 600, in urlopen\n chunked=chunked)\n File \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py\", line 345, in _make_request\n self._validate_conn(conn)\n File \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py\", line 844, in _validate_conn\n conn.connect()\n File \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py\", line 326, in connect\n ssl_context=context)\n File \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/ssl_.py\", line 324, in ssl_wrap_socket\n return context.wrap_socket(sock, server_hostname=server_hostname)\n File \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py\", line 443, in wrap_socket\n raise ssl.SSLError('bad handshake: %r' % e)\nssl.SSLError: (\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",)\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.5/dist-packages/requests/adapters.py\", line 423, in send\n timeout=timeout\n File \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py\", line 630, in urlopen\n raise SSLError(e)\nrequests.packages.urllib3.exceptions.SSLError: (\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",)\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"./utils/auth_wrap.py\", line 18, in authenticate\n user = session.get(token)\n File \"./utils/session.py\", line 12, in get\n response = requests.get(self.url, auth=HTTPBasicAuth(token, ''))\n File \"/usr/local/lib/python3.5/dist-packages/requests/api.py\", line 70, in get\n return request('get', url, params=params, **kwargs)\n File \"/usr/local/lib/python3.5/dist-packages/requests/api.py\", line 56, in request\n return session.request(method=method, url=url, **kwargs)\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 488, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 609, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/local/lib/python3.5/dist-packages/requests/adapters.py\", line 497, in send\n raise SSLError(e, request=request)\nrequests.exceptions.SSLError: (\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",)"}
[2017-03-24 02:42:02,857] ERROR in app: Exception on /api/etl/v2/config [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 436, in wrap_socket
cnx.do_handshake()
File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 1426, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 1167, in _raise_ssl_error
raise SysCallError(-1, "Unexpected EOF")
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')
```
```
RUN python3 -m pip freeze
---> Running in 5cc74c5987ed
asn1crypto==0.22.0
boto3==1.4.4
botocore==1.5.29
cffi==1.10.0
click==6.7
clickclick==1.2.1
connexion==1.1.5
cryptography==1.8.1
docutils==0.13.1
Flask==0.12
Flask-Cors==3.0.2
hvac==0.2.17
idna==2.5
itsdangerous==0.24
Jinja2==2.9.5
jmespath==0.9.2
jsonschema==2.6.0
MarkupSafe==1.0
ndg-httpsclient==0.4.2
numpy==1.12.1
packaging==16.8
pandas==0.19.2
pyasn1==0.2.3
pycparser==2.17
pycurl==7.43.0
pygobject==3.20.0
pymssql==2.1.3
pyodbc==4.0.15
pyOpenSSL==16.2.0
pyparsing==2.2.0
python-apt==1.1.0b1
python-dateutil==2.6.0
pytz==2016.10
PyYAML==3.12
requests==2.13.0
s3transfer==0.1.10
six==1.10.0
SQLAlchemy==1.1.6
strict-rfc3339==0.7
structlog==16.1.0
swagger-spec-validator==2.1.0
unattended-upgrades==0.1
uWSGI==2.0.14
Werkzeug==0.12.1
``` | {
"avatar_url": "https://avatars.githubusercontent.com/u/15217582?v=4",
"events_url": "https://api.github.com/users/a-sharma11/events{/privacy}",
"followers_url": "https://api.github.com/users/a-sharma11/followers",
"following_url": "https://api.github.com/users/a-sharma11/following{/other_user}",
"gists_url": "https://api.github.com/users/a-sharma11/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/a-sharma11",
"id": 15217582,
"login": "a-sharma11",
"node_id": "MDQ6VXNlcjE1MjE3NTgy",
"organizations_url": "https://api.github.com/users/a-sharma11/orgs",
"received_events_url": "https://api.github.com/users/a-sharma11/received_events",
"repos_url": "https://api.github.com/users/a-sharma11/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/a-sharma11/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/a-sharma11/subscriptions",
"type": "User",
"url": "https://api.github.com/users/a-sharma11",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3939/reactions"
} | https://api.github.com/repos/psf/requests/issues/3939/timeline | null | completed | null | null | false | [
"Some more context here:\r\nI have two docker containers here. 1st one is running a python flask app and the other one is a nodejs express server. They both talk to each other via docker linking. This worked great until i added uwsgi layer to my flask container.",
"I'm not a major contributor, but some advice for... |
https://api.github.com/repos/psf/requests/issues/3938 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3938/labels{/name} | https://api.github.com/repos/psf/requests/issues/3938/comments | https://api.github.com/repos/psf/requests/issues/3938/events | https://github.com/psf/requests/issues/3938 | 216,443,149 | MDU6SXNzdWUyMTY0NDMxNDk= | 3,938 | zeep lib bad handshake error | {
"avatar_url": "https://avatars.githubusercontent.com/u/13488059?v=4",
"events_url": "https://api.github.com/users/MaxOvcharov/events{/privacy}",
"followers_url": "https://api.github.com/users/MaxOvcharov/followers",
"following_url": "https://api.github.com/users/MaxOvcharov/following{/other_user}",
"gists_url": "https://api.github.com/users/MaxOvcharov/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MaxOvcharov",
"id": 13488059,
"login": "MaxOvcharov",
"node_id": "MDQ6VXNlcjEzNDg4MDU5",
"organizations_url": "https://api.github.com/users/MaxOvcharov/orgs",
"received_events_url": "https://api.github.com/users/MaxOvcharov/received_events",
"repos_url": "https://api.github.com/users/MaxOvcharov/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MaxOvcharov/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MaxOvcharov/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MaxOvcharov",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 31 | 2017-03-23T14:19:14Z | 2021-09-08T11:00:40Z | 2017-03-23T14:24:29Z | NONE | resolved | I try to create SOAP client using zeep lilb
```
import os
from zeep import Client
from zeep.wsse.signature import Signature
key_filename = "/etc/ssl/certs/cert.key.pem"
cert_filename = "/etc/ssl/certs/cert.crt.pem"
client = Client('https://37.230.149.6:10004/emias-soap-service/PGUServicesInfo2?wsdl', wsse=Signature(key_filename, cert_filename))
```
And have this exception:
```
Traceback (most recent call last):
File "/home/max/bot_project/Bots_Django/TelegramBot/bot/simple_soap_client.py", line 19, in <module>
wsse=Signature(key_filename, cert_filename))
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/client.py", line 120, in __init__
self.wsdl = Document(wsdl, self.transport, strict=strict)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/wsdl/wsdl.py", line 76, in __init__
document = self._get_xml_document(location)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/wsdl/wsdl.py", line 137, in _get_xml_document
location, self.transport, self.location, strict=self.strict)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/loader.py", line 66, in load_external
content = transport.load(url)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/transports.py", line 111, in load
content = self._load_remote_data(url)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/transports.py", line 126, in _load_remote_data
response = self.session.get(url, timeout=self.load_timeout)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)
```
How can I fix this exception and what's wrong with my code? | {
"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/3938/reactions"
} | https://api.github.com/repos/psf/requests/issues/3938/timeline | null | completed | null | null | false | [
"I also try something like this:\r\n```\r\nimport os\r\nfrom requests import Session\r\nfrom zeep import Client\r\nfrom zeep.transports import Transport\r\nfrom zeep.wsse.signature import Signature\r\n\r\nkey_filename = \"/etc/ssl/certs/cert.key.pem\"\r\ncert_filename = \"/etc/ssl/certs/cert.crt.pem\"\r\n\r\nsessio... |
https://api.github.com/repos/psf/requests/issues/3937 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3937/labels{/name} | https://api.github.com/repos/psf/requests/issues/3937/comments | https://api.github.com/repos/psf/requests/issues/3937/events | https://github.com/psf/requests/pull/3937 | 216,410,767 | MDExOlB1bGxSZXF1ZXN0MTEyMjI1ODM2 | 3,937 | [RFC] Add debugging submodule for bug reporters | {
"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 | 2017-03-23T12:25:33Z | 2021-09-06T00:06:51Z | 2017-05-27T20:45:43Z | CONTRIBUTOR | resolved | The suggested usage in a bug report would be
python -c 'from requests import _bug; _bug.print_information()'
This should generate most of the information we tend to ask for
repeatedly from bug reporters.
----
**Note** This is merely a POC and an idea I had this morning. I've done similar things in other projects with varying success. Most of the success will ride on us adding a `.github` folder with an issue template. This just makes the bug report process easier for users. | {
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3937/reactions"
} | https://api.github.com/repos/psf/requests/issues/3937/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3937.diff",
"html_url": "https://github.com/psf/requests/pull/3937",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/3937.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3937"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=h1) Report\n> Merging [#3937](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/a44284c045b43d728c2a07d4f0a064bf8714f4af?src=pr&el=desc) will **decrease**... |
https://api.github.com/repos/psf/requests/issues/3936 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3936/labels{/name} | https://api.github.com/repos/psf/requests/issues/3936/comments | https://api.github.com/repos/psf/requests/issues/3936/events | https://github.com/psf/requests/issues/3936 | 216,266,303 | MDU6SXNzdWUyMTYyNjYzMDM= | 3,936 | Prevent unicode escape in json | {
"avatar_url": "https://avatars.githubusercontent.com/u/3183314?v=4",
"events_url": "https://api.github.com/users/hrchu/events{/privacy}",
"followers_url": "https://api.github.com/users/hrchu/followers",
"following_url": "https://api.github.com/users/hrchu/following{/other_user}",
"gists_url": "https://api.github.com/users/hrchu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hrchu",
"id": 3183314,
"login": "hrchu",
"node_id": "MDQ6VXNlcjMxODMzMTQ=",
"organizations_url": "https://api.github.com/users/hrchu/orgs",
"received_events_url": "https://api.github.com/users/hrchu/received_events",
"repos_url": "https://api.github.com/users/hrchu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hrchu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hrchu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hrchu",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-03-23T02:07:59Z | 2021-09-08T11:00:40Z | 2017-03-23T08:33:24Z | NONE | resolved | ``` requests.post(url, json=payload)``` always transforms non-ascii chars in the forms of unicode escape , i.e., \uXXXX since the parameter ensure_ascii in```json.dump() ``` is True in default. It is inconvenient for global/non-ascii users, since the receiver have to de-escape it again. It will be better if requests can optionally prevent unicode escape in json. Any ideas? | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3936/reactions"
} | https://api.github.com/repos/psf/requests/issues/3936/timeline | null | completed | null | null | false | [
"JSON with escaped characters is supposed to be identical to JSON without escaped characters. There is no *general* reason to provide an escape hatch to avoid encoding, as it will only bust services that are not properly handling the JSON.\r\n\r\nThat said, the solution to fixing this is very easy:\r\n\r\n```python... |
https://api.github.com/repos/psf/requests/issues/3935 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3935/labels{/name} | https://api.github.com/repos/psf/requests/issues/3935/comments | https://api.github.com/repos/psf/requests/issues/3935/events | https://github.com/psf/requests/issues/3935 | 216,140,508 | MDU6SXNzdWUyMTYxNDA1MDg= | 3,935 | Requests and Let's Encrypt Certificates | {
"avatar_url": "https://avatars.githubusercontent.com/u/16190582?v=4",
"events_url": "https://api.github.com/users/MonsterDeveloper/events{/privacy}",
"followers_url": "https://api.github.com/users/MonsterDeveloper/followers",
"following_url": "https://api.github.com/users/MonsterDeveloper/following{/other_user}",
"gists_url": "https://api.github.com/users/MonsterDeveloper/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MonsterDeveloper",
"id": 16190582,
"login": "MonsterDeveloper",
"node_id": "MDQ6VXNlcjE2MTkwNTgy",
"organizations_url": "https://api.github.com/users/MonsterDeveloper/orgs",
"received_events_url": "https://api.github.com/users/MonsterDeveloper/received_events",
"repos_url": "https://api.github.com/users/MonsterDeveloper/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MonsterDeveloper/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MonsterDeveloper/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MonsterDeveloper",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 13 | 2017-03-22T17:04:29Z | 2021-09-08T08:00:30Z | 2017-07-29T23:37:09Z | NONE | resolved | While using Requests, I noticed strange thing: Requests doesn't accept Let's Encrypt Certificates. Only with `verify=False` library doesn't raise an exception (tested on my https Tornado server). Maybe add Let's Encrypt Authority X3 to Requests' CA?
| {
"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/3935/reactions"
} | https://api.github.com/repos/psf/requests/issues/3935/timeline | null | completed | null | null | false | [
"works fine for me!",
"tested against httpbin.org",
"Httpbin use lets encrypt?",
"I have issue like https://github.com/kennethreitz/requests/issues/2955 ",
"@MonsterDeveloper If you have an issue like #2955, have you tried examining the solution provided there? Can you tell me what server you're having trou... |
https://api.github.com/repos/psf/requests/issues/3934 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3934/labels{/name} | https://api.github.com/repos/psf/requests/issues/3934/comments | https://api.github.com/repos/psf/requests/issues/3934/events | https://github.com/psf/requests/issues/3934 | 216,074,783 | MDU6SXNzdWUyMTYwNzQ3ODM= | 3,934 | verify=/path/to/root/certs ignored | {
"avatar_url": "https://avatars.githubusercontent.com/u/5101589?v=4",
"events_url": "https://api.github.com/users/mahescho/events{/privacy}",
"followers_url": "https://api.github.com/users/mahescho/followers",
"following_url": "https://api.github.com/users/mahescho/following{/other_user}",
"gists_url": "https://api.github.com/users/mahescho/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mahescho",
"id": 5101589,
"login": "mahescho",
"node_id": "MDQ6VXNlcjUxMDE1ODk=",
"organizations_url": "https://api.github.com/users/mahescho/orgs",
"received_events_url": "https://api.github.com/users/mahescho/received_events",
"repos_url": "https://api.github.com/users/mahescho/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mahescho/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mahescho/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mahescho",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-22T14:05:56Z | 2021-09-08T11:00:41Z | 2017-03-22T14:08:21Z | NONE | resolved | I use:
requests.get(URL,verify=/path/to/root/certs
in /path/to/root/certs are some certificates and hashes:
lrwxrwxrwx 1 root root 10 Mär 22 14:43 3104f96d.0 -> cert-2.pem
lrwxrwxrwx 1 root root 10 Mär 22 14:43 33815e15.0 -> cert-1.pem
lrwxrwxrwx 1 root root 10 Mär 22 14:43 738ed572.0 -> cert-2.pem
lrwxrwxrwx 1 root root 10 Mär 22 14:43 ae8153b9.0 -> cert-1.pem
-rw-r--r-- 1 root root 2760 Mär 22 14:43 cert-1.pem
-rw-r--r-- 1 root root 2151 Mär 22 14:43 cert-2.pem
Certificate verification fails with:
ERROR [Errno 336265218] _ssl.c:351: error:140B0002:SSL
routines:SSL_CTX_use_PrivateKey_file:system lib
When I install the CA certs in the system verification works when "requests" falls back to verify. I try this on Debian 8 with "requests" 2.4.3-6. | {
"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/3934/reactions"
} | https://api.github.com/repos/psf/requests/issues/3934/timeline | null | completed | null | null | false | [
"Requests 2.4 does not support openssl certificate directories: only single files. You'd need to cat all those files into a single file and use that. That limitation was lifted in 2.9. Please upgrade Requests. :smile:",
"Thanks, pip install requests --upgrade solved the Issue."
] |
https://api.github.com/repos/psf/requests/issues/3933 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3933/labels{/name} | https://api.github.com/repos/psf/requests/issues/3933/comments | https://api.github.com/repos/psf/requests/issues/3933/events | https://github.com/psf/requests/issues/3933 | 215,854,749 | MDU6SXNzdWUyMTU4NTQ3NDk= | 3,933 | [Tracking] slow leak in latest requests with https connections | {
"avatar_url": "https://avatars.githubusercontent.com/u/4001789?v=4",
"events_url": "https://api.github.com/users/thehesiod/events{/privacy}",
"followers_url": "https://api.github.com/users/thehesiod/followers",
"following_url": "https://api.github.com/users/thehesiod/following{/other_user}",
"gists_url": "https://api.github.com/users/thehesiod/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/thehesiod",
"id": 4001789,
"login": "thehesiod",
"node_id": "MDQ6VXNlcjQwMDE3ODk=",
"organizations_url": "https://api.github.com/users/thehesiod/orgs",
"received_events_url": "https://api.github.com/users/thehesiod/received_events",
"repos_url": "https://api.github.com/users/thehesiod/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/thehesiod/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/thehesiod/subscriptions",
"type": "User",
"url": "https://api.github.com/users/thehesiod",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 15 | 2017-03-21T19:38:22Z | 2021-09-08T02:09:59Z | 2017-04-12T00:41:55Z | NONE | resolved | This seems unrelated to https://github.com/kennethreitz/requests/issues/1685 as this is specific to https connections and I'm specifically closing the session and response connections.
I've spent a few days investigating a memory leak we've seen with the requests module and narrowed it down to three issues:
1) when using pyOpenSSL with requests 2.13.0 in python 3.5.2 there's one leak:
1) with pyOpenSSL with a local server there's a leak, removing pyOpenSSL resolves leak
2) when using pyOpenSSL with requests 2.13.0 in python 3.5.3 there's two leaks:
1) same as 1.1
2) when connecting to servers on different hosts there's a leak
3) in both 3.5.2 and 3.5.3 with external hosts the script is periodically unable to contact the host due to "network is unreachable" errors, presumably because some resource has been temporarily exhausted...eventually recovering and repeating the error.
I've investigated this some and it doesn't seem to be a leak python objects (see tracemalloc util in script), or a leak sockets/file descriptors, so I believe it's a native leak in either python or openssl given the behavior changed between 3.5.2. and 3.5.3. In our 3.5.2 tests we were using libssl1.0.1 and 3.5.3 libssl1.1.0 and upgrading libssl did not fix the issue.
I've created a test file here: https://gist.github.com/thehesiod/5dbd7f2bffbe0b850980e865f5649338
and a docker cloud image here: `amohr/testing:stretch_request_leak` based on:
```
FROM debian:stretch
COPY request_https_leak.py /tmp/request_https_leak.py
RUN apt-get update && \
apt-get install -y python3.5 python3-pip git
RUN python3 -m pip install requests git+git://github.com/thehesiod/pyca.git@fix-py3#egg=calib setproctitle requests psutil
```
it constantly updates three files in the directory it's run from:
- mprofile_*.dat: memory usage by number of requests
- nprofile_*.dat: number of net connections by number of requests
- fprofile_*.dat: number of file descriptors by number of requests
you can plot the memory usage with the python module: memory_profiler with `mprof plot [FILENAME]`
Here's an example run from the image above running for 15,000 requests....while it seems to stabilize I've noticed that running it for a long time it continues with a fairly constant long term line...I think the python malloc just starts requesting larger chunks over time.

btw x-axis in the plots generated is request num, not time.
Also in the script is the ability to switch to a local server (which is one of the issues), when it generates the temp certs, hit enter for everything except common-name, and just put the name it tells you to put there.
Next steps I think are attempting to try a native python ssl socket to see if the problem reproduces there to see if this is a native ssl issue (would be good to test aiohttp as well to see if it doesn't reproduce if they have a work-around, and if it does they should know), and then a full valgrind investigation to see what's leaking the memory. | {
"avatar_url": "https://avatars.githubusercontent.com/u/4001789?v=4",
"events_url": "https://api.github.com/users/thehesiod/events{/privacy}",
"followers_url": "https://api.github.com/users/thehesiod/followers",
"following_url": "https://api.github.com/users/thehesiod/following{/other_user}",
"gists_url": "https://api.github.com/users/thehesiod/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/thehesiod",
"id": 4001789,
"login": "thehesiod",
"node_id": "MDQ6VXNlcjQwMDE3ODk=",
"organizations_url": "https://api.github.com/users/thehesiod/orgs",
"received_events_url": "https://api.github.com/users/thehesiod/received_events",
"repos_url": "https://api.github.com/users/thehesiod/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/thehesiod/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/thehesiod/subscriptions",
"type": "User",
"url": "https://api.github.com/users/thehesiod",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3933/reactions"
} | https://api.github.com/repos/psf/requests/issues/3933/timeline | null | completed | null | null | false | [
"Thanks for this report! It's very detailed, which is a good start. I'd like to confirm some things:\r\n\r\n1. You used 3.5.2 and 3.5.3, with libssl 1.0.1 and 1.1.0 respectively. You said, however, that \"upgrading libssl didn't fix the problem\". Did that mean just moving to the latest libssl in those releases, or... |
https://api.github.com/repos/psf/requests/issues/3932 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3932/labels{/name} | https://api.github.com/repos/psf/requests/issues/3932/comments | https://api.github.com/repos/psf/requests/issues/3932/events | https://github.com/psf/requests/issues/3932 | 215,754,690 | MDU6SXNzdWUyMTU3NTQ2OTA= | 3,932 | ConnectionError not handled by requests | {
"avatar_url": "https://avatars.githubusercontent.com/u/1035294?v=4",
"events_url": "https://api.github.com/users/fabiocaccamo/events{/privacy}",
"followers_url": "https://api.github.com/users/fabiocaccamo/followers",
"following_url": "https://api.github.com/users/fabiocaccamo/following{/other_user}",
"gists_url": "https://api.github.com/users/fabiocaccamo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/fabiocaccamo",
"id": 1035294,
"login": "fabiocaccamo",
"node_id": "MDQ6VXNlcjEwMzUyOTQ=",
"organizations_url": "https://api.github.com/users/fabiocaccamo/orgs",
"received_events_url": "https://api.github.com/users/fabiocaccamo/received_events",
"repos_url": "https://api.github.com/users/fabiocaccamo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/fabiocaccamo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/fabiocaccamo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/fabiocaccamo",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-03-21T14:17:41Z | 2021-09-08T11:00:41Z | 2017-03-21T14:27:51Z | NONE | resolved | **ConnectionError not handled by requests
('Connection aborted.', gaierror(-2, 'Name or service not known'))**
This happened when I tried to load an image from an old tumblr url:
```
url = 'http://41.media.tumblr.com/facde6697dff1c78fcfadbc653a8a295/tumblr_mlc3qpepqL1son6j8o1_1280.jpg'
r = requests.get(url, stream = True)
if r.status_code != requests.codes.ok:
print('not an exception')
```
I expected that r.status_code == requests.codes.ok returned False instead of throwing the exception.
| {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3932/reactions"
} | https://api.github.com/repos/psf/requests/issues/3932/timeline | null | completed | null | null | false | [
"Why? There is no response to get there. It doesn't 404, it's returning NXDOMAIN on the DNS lookup. This is entirely expected behaviour."
] |
https://api.github.com/repos/psf/requests/issues/3931 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3931/labels{/name} | https://api.github.com/repos/psf/requests/issues/3931/comments | https://api.github.com/repos/psf/requests/issues/3931/events | https://github.com/psf/requests/issues/3931 | 215,537,110 | MDU6SXNzdWUyMTU1MzcxMTA= | 3,931 | idea - `Response.response_flow` or `Response.response_chain` convenience method | {
"avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4",
"events_url": "https://api.github.com/users/jvanasco/events{/privacy}",
"followers_url": "https://api.github.com/users/jvanasco/followers",
"following_url": "https://api.github.com/users/jvanasco/following{/other_user}",
"gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jvanasco",
"id": 204779,
"login": "jvanasco",
"node_id": "MDQ6VXNlcjIwNDc3OQ==",
"organizations_url": "https://api.github.com/users/jvanasco/orgs",
"received_events_url": "https://api.github.com/users/jvanasco/received_events",
"repos_url": "https://api.github.com/users/jvanasco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jvanasco",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-03-20T19:57:00Z | 2021-09-08T11:00:41Z | 2017-03-21T08:04:52Z | CONTRIBUTOR | resolved | We consume a lot of URL shorteners and redirects. Unlike many requests users, we care about the entire journey -- not just the destination. The current API makes it slightly inconvenient to iterate over the responses in order when needed.
I often end up using a function that does the following, and wanted to suggest handling this upstream with something like...
@property
def response_chain(self):
'''iterate over the responses in order, from the original request to ultimate response'''
if self.history:
for response in self.history:
yield response
if self.response:
yield self.response
| {
"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/3931/reactions"
} | https://api.github.com/repos/psf/requests/issues/3931/timeline | null | completed | null | null | false | [
"So, my initial inclination is to say that this isn't likely to get in. Our general rule is that a feature request must meet at least two of the following criteria:\r\n\r\n1. Be generally useful: that is, be valuable for a large number of our users. \r\n2. Be complex or subtle to implement, in such a way that will ... |
https://api.github.com/repos/psf/requests/issues/3930 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3930/labels{/name} | https://api.github.com/repos/psf/requests/issues/3930/comments | https://api.github.com/repos/psf/requests/issues/3930/events | https://github.com/psf/requests/issues/3930 | 215,436,763 | MDU6SXNzdWUyMTU0MzY3NjM= | 3,930 | "stati" should be "statuses" | {
"avatar_url": "https://avatars.githubusercontent.com/u/2923742?v=4",
"events_url": "https://api.github.com/users/marthjod/events{/privacy}",
"followers_url": "https://api.github.com/users/marthjod/followers",
"following_url": "https://api.github.com/users/marthjod/following{/other_user}",
"gists_url": "https://api.github.com/users/marthjod/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/marthjod",
"id": 2923742,
"login": "marthjod",
"node_id": "MDQ6VXNlcjI5MjM3NDI=",
"organizations_url": "https://api.github.com/users/marthjod/orgs",
"received_events_url": "https://api.github.com/users/marthjod/received_events",
"repos_url": "https://api.github.com/users/marthjod/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/marthjod/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/marthjod/subscriptions",
"type": "User",
"url": "https://api.github.com/users/marthjod",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-03-20T14:25:51Z | 2021-09-08T11:00:42Z | 2017-03-20T14:36:12Z | NONE | resolved | "stati" is not a word. Plural of "status" is "statuses" (`REDIRECT_STATI` etc.). | {
"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/3930/reactions"
} | https://api.github.com/repos/psf/requests/issues/3930/timeline | null | completed | null | null | false | [
"It's a purely internal name that is not intended to be used by others, so what it's called really doesn't matter. It could be called `MY_FAVOURITE_NUMBERS` and that would be fine. However, if it helps, I'll let you know that the person who wrote the original code knew that \"stati\" is not a word: it was intended ... |
https://api.github.com/repos/psf/requests/issues/3929 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3929/labels{/name} | https://api.github.com/repos/psf/requests/issues/3929/comments | https://api.github.com/repos/psf/requests/issues/3929/events | https://github.com/psf/requests/issues/3929 | 215,269,887 | MDU6SXNzdWUyMTUyNjk4ODc= | 3,929 | Don't override `Authorization` header when contents are bearer token (or any other token) | {
"avatar_url": "https://avatars.githubusercontent.com/u/3877688?v=4",
"events_url": "https://api.github.com/users/tomvlk/events{/privacy}",
"followers_url": "https://api.github.com/users/tomvlk/followers",
"following_url": "https://api.github.com/users/tomvlk/following{/other_user}",
"gists_url": "https://api.github.com/users/tomvlk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tomvlk",
"id": 3877688,
"login": "tomvlk",
"node_id": "MDQ6VXNlcjM4Nzc2ODg=",
"organizations_url": "https://api.github.com/users/tomvlk/orgs",
"received_events_url": "https://api.github.com/users/tomvlk/received_events",
"repos_url": "https://api.github.com/users/tomvlk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tomvlk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tomvlk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tomvlk",
"user_view_type": "public"
} | [] | open | true | null | [] | null | 20 | 2017-03-19T15:03:38Z | 2024-02-01T00:57:03Z | null | NONE | null | I found out that the requests lib is overriding the authorization header when a netrc file is in place, which is awesome. But in some cases you won't want this at all, and is a design flaw imo.
For example you use a bearer token, it gets replaced by the user/password from netrc.
Also see the issue here: https://github.com/python-social-auth/social-core/issues/43 | null | {
"+1": 7,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 7,
"url": "https://api.github.com/repos/psf/requests/issues/3929/reactions"
} | https://api.github.com/repos/psf/requests/issues/3929/timeline | null | null | null | null | false | [
"This behaviour can be overridden by [`trust_env`](http://docs.python-requests.org/en/master/api/#requests.Session.trust_env), which allows you to instruct Requests to ignore the `.netrc` file. Is that sufficient for your purposes?",
"Well, if you look at the issue of the social auth library, you may see that it'... |
https://api.github.com/repos/psf/requests/issues/3928 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3928/labels{/name} | https://api.github.com/repos/psf/requests/issues/3928/comments | https://api.github.com/repos/psf/requests/issues/3928/events | https://github.com/psf/requests/issues/3928 | 215,247,997 | MDU6SXNzdWUyMTUyNDc5OTc= | 3,928 | Drop 2.6 support | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | [
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
},
{
"color": "e102d8",
"default": false,
"description": null... | closed | true | null | [] | null | 6 | 2017-03-19T07:54:02Z | 2021-09-08T08:00:33Z | 2017-07-27T14:57:27Z | MEMBER | resolved | Our main dependent that still supports 2.6, pip, has just dropped support (pypa/pip#4343). We are now free to do the same. | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | {
"+1": 10,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 2,
"laugh": 0,
"rocket": 0,
"total_count": 12,
"url": "https://api.github.com/repos/psf/requests/issues/3928/reactions"
} | https://api.github.com/repos/psf/requests/issues/3928/timeline | null | completed | null | null | false | [
"let's do this in 3.0. ",
"@kennethreitz perfectly reasonable to do it with 3.0",
"✨🍰✨",
"i think this is a bit of a political statement, but a good one. ",
"With #4118 merged into the 3.0.0 branch, I think we can consider this resolved. Python 2.6 support will be removed in that release. Thanks @hobarrera... |
https://api.github.com/repos/psf/requests/issues/3927 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3927/labels{/name} | https://api.github.com/repos/psf/requests/issues/3927/comments | https://api.github.com/repos/psf/requests/issues/3927/events | https://github.com/psf/requests/pull/3927 | 215,133,602 | MDExOlB1bGxSZXF1ZXN0MTExMzc0MTY4 | 3,927 | Raise IOError when providing an invalid path to a CA bundle or … | {
"avatar_url": "https://avatars.githubusercontent.com/u/11854690?v=4",
"events_url": "https://api.github.com/users/bagerard/events{/privacy}",
"followers_url": "https://api.github.com/users/bagerard/followers",
"following_url": "https://api.github.com/users/bagerard/following{/other_user}",
"gists_url": "https://api.github.com/users/bagerard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bagerard",
"id": 11854690,
"login": "bagerard",
"node_id": "MDQ6VXNlcjExODU0Njkw",
"organizations_url": "https://api.github.com/users/bagerard/orgs",
"received_events_url": "https://api.github.com/users/bagerard/received_events",
"repos_url": "https://api.github.com/users/bagerard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bagerard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bagerard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bagerard",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 5 | 2017-03-17T22:03:26Z | 2021-09-07T00:06:26Z | 2017-03-22T20:41:08Z | CONTRIBUTOR | resolved | Use IOError whenever invalid paths are used for ssl certificates (#3926) | {
"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/3927/reactions"
} | https://api.github.com/repos/psf/requests/issues/3927/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3927.diff",
"html_url": "https://github.com/psf/requests/pull/3927",
"merged_at": "2017-03-22T20:41:08Z",
"patch_url": "https://github.com/psf/requests/pull/3927.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3927"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3927?src=pr&el=h1) Report\n> Merging [#3927](https://codecov.io/gh/kennethreitz/requests/pull/3927?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/b60c5a5ed46d75c56e36db5a58a98a50d880141d?src=pr&el=desc) will **increase**... |
https://api.github.com/repos/psf/requests/issues/3926 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3926/labels{/name} | https://api.github.com/repos/psf/requests/issues/3926/comments | https://api.github.com/repos/psf/requests/issues/3926/events | https://github.com/psf/requests/issues/3926 | 215,124,213 | MDU6SXNzdWUyMTUxMjQyMTM= | 3,926 | SSLError raised when path to CA_BUNDLE is not valid could be more meaningful | {
"avatar_url": "https://avatars.githubusercontent.com/u/11854690?v=4",
"events_url": "https://api.github.com/users/bagerard/events{/privacy}",
"followers_url": "https://api.github.com/users/bagerard/followers",
"following_url": "https://api.github.com/users/bagerard/following{/other_user}",
"gists_url": "https://api.github.com/users/bagerard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bagerard",
"id": 11854690,
"login": "bagerard",
"node_id": "MDQ6VXNlcjExODU0Njkw",
"organizations_url": "https://api.github.com/users/bagerard/orgs",
"received_events_url": "https://api.github.com/users/bagerard/received_events",
"repos_url": "https://api.github.com/users/bagerard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bagerard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bagerard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bagerard",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-17T21:15:12Z | 2021-09-08T11:00:40Z | 2017-03-22T20:44:26Z | CONTRIBUTOR | resolved | Hi there,
First of all thanks for the requests library, it's just awesome!
In one of my project I was pulling 'verify' from a config file and passing it along every requests as an argument. Instead of receiving a boolean, it turned out that I was actually passing verify='true' to the requests methods, which makes requests think that I was providing a path to a ca bundle.
Although I was obviously misusing the api, it took me some time to debug it and I believe that the error message could have been more meaningful.
In fact the following:
```
requests.get('https://github.com/', verify='true')
```
raises
```
/.../requests/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
495 except (_SSLError, _HTTPError) as e:
496 if isinstance(e, _SSLError):
--> 497 raise SSLError(e, request=request)
498 elif isinstance(e, ReadTimeoutError):
499 raise ReadTimeout(e, request=request)
SSLError: [Errno 2] No such file or directory
```
I'll do a PR and make it raise an IOError (with the path being printed) in case the `verify` param does not point to a valid file/dir. As minor as it is, I hope you'll find it valuable. | {
"avatar_url": "https://avatars.githubusercontent.com/u/11854690?v=4",
"events_url": "https://api.github.com/users/bagerard/events{/privacy}",
"followers_url": "https://api.github.com/users/bagerard/followers",
"following_url": "https://api.github.com/users/bagerard/following{/other_user}",
"gists_url": "https://api.github.com/users/bagerard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bagerard",
"id": 11854690,
"login": "bagerard",
"node_id": "MDQ6VXNlcjExODU0Njkw",
"organizations_url": "https://api.github.com/users/bagerard/orgs",
"received_events_url": "https://api.github.com/users/bagerard/received_events",
"repos_url": "https://api.github.com/users/bagerard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bagerard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bagerard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bagerard",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3926/reactions"
} | https://api.github.com/repos/psf/requests/issues/3926/timeline | null | completed | null | null | false | [
"So, before you leap into this (which is a good idea), be aware that you need to be able to distinguish this case from when either of the paths given to the `cert` parameter are bad.",
"Thanks for the quick feedback, I'll take that into account"
] |
https://api.github.com/repos/psf/requests/issues/3925 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3925/labels{/name} | https://api.github.com/repos/psf/requests/issues/3925/comments | https://api.github.com/repos/psf/requests/issues/3925/events | https://github.com/psf/requests/issues/3925 | 214,749,059 | MDU6SXNzdWUyMTQ3NDkwNTk= | 3,925 | Streaming uploads for files | {
"avatar_url": "https://avatars.githubusercontent.com/u/160090?v=4",
"events_url": "https://api.github.com/users/sorenisanerd/events{/privacy}",
"followers_url": "https://api.github.com/users/sorenisanerd/followers",
"following_url": "https://api.github.com/users/sorenisanerd/following{/other_user}",
"gists_url": "https://api.github.com/users/sorenisanerd/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sorenisanerd",
"id": 160090,
"login": "sorenisanerd",
"node_id": "MDQ6VXNlcjE2MDA5MA==",
"organizations_url": "https://api.github.com/users/sorenisanerd/orgs",
"received_events_url": "https://api.github.com/users/sorenisanerd/received_events",
"repos_url": "https://api.github.com/users/sorenisanerd/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sorenisanerd/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sorenisanerd/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sorenisanerd",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-03-16T15:45:39Z | 2021-09-08T11:00:42Z | 2017-03-16T16:08:32Z | NONE | resolved | It would be really nice if there was a way to do a multipart encoded file uploads without having to load all the files into memory before sending the request so that it could be streamed.
I'm pulling a large file from one place (using `requests.get(stream=True)`) and have to send it somewhere else as part of a multpart post, but I'm running out of memory. | {
"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/3925/reactions"
} | https://api.github.com/repos/psf/requests/issues/3925/timeline | null | completed | null | null | false | [
"Thanks for this! Handily, there is exactly such a thing: check out the requests-toolbelt's [`StreamingMultipartEncoder`](https://toolbelt.readthedocs.io/en/latest/uploading-data.html#streaming-multipart-data-encoder)."
] |
https://api.github.com/repos/psf/requests/issues/3924 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3924/labels{/name} | https://api.github.com/repos/psf/requests/issues/3924/comments | https://api.github.com/repos/psf/requests/issues/3924/events | https://github.com/psf/requests/issues/3924 | 214,302,235 | MDU6SXNzdWUyMTQzMDIyMzU= | 3,924 | requests.exceptions.ReadTimeout is raised whenever how long I set the timeout ... | {
"avatar_url": "https://avatars.githubusercontent.com/u/11614773?v=4",
"events_url": "https://api.github.com/users/liuming-dev/events{/privacy}",
"followers_url": "https://api.github.com/users/liuming-dev/followers",
"following_url": "https://api.github.com/users/liuming-dev/following{/other_user}",
"gists_url": "https://api.github.com/users/liuming-dev/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/liuming-dev",
"id": 11614773,
"login": "liuming-dev",
"node_id": "MDQ6VXNlcjExNjE0Nzcz",
"organizations_url": "https://api.github.com/users/liuming-dev/orgs",
"received_events_url": "https://api.github.com/users/liuming-dev/received_events",
"repos_url": "https://api.github.com/users/liuming-dev/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/liuming-dev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/liuming-dev/subscriptions",
"type": "User",
"url": "https://api.github.com/users/liuming-dev",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 12 | 2017-03-15T07:14:58Z | 2021-09-08T07:00:28Z | 2017-06-09T12:57:31Z | NONE | resolved | In my apllication, I got this exception:
```
[2017-03-15 14:45:06]: http://club.xywy.com/question/20160115/99407801.htm
Traceback (most recent call last):
File "C:\Program Files\Python\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 386, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "C:\Program Files\Python\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 382, in _make_request
httplib_response = conn.getresponse()
File "C:\Program Files\Python\lib\http\client.py", line 1331, in getresponse
response.begin()
File "C:\Program Files\Python\lib\http\client.py", line 297, in begin
version, status, reason = self._read_status()
File "C:\Program Files\Python\lib\http\client.py", line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\Program Files\Python\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "C:\Program Files\Python\lib\site-packages\gevent\_socket3.py", line 385, in recv_into
self._wait(self._read_event)
File "C:\Program Files\Python\lib\site-packages\gevent\_socket3.py", line 157, in _wait
self.hub.wait(watcher)
File "C:\Program Files\Python\lib\site-packages\gevent\hub.py", line 651, in wait
result = waiter.get()
File "C:\Program Files\Python\lib\site-packages\gevent\hub.py", line 899, in get
return self.hub.switch()
File "C:\Program Files\Python\lib\site-packages\gevent\hub.py", line 630, in switch
return RawGreenlet.switch(self)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python\lib\site-packages\requests\adapters.py", line 423, in send
timeout=timeout
File "C:\Program Files\Python\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Program Files\Python\lib\site-packages\requests\packages\urllib3\util\retry.py", line 347, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Program Files\Python\lib\site-packages\requests\packages\urllib3\packages\six.py", line 686, in reraise
raise value
File "C:\Program Files\Python\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Program Files\Python\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 388, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "C:\Program Files\Python\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 308, in _raise_timeout
raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='club.xywy.com', port=80): Read timed out. (read timeout=20)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/XYWYCrawler/consumer/UrlConsumer.py", line 29, in getQPageInfo
html = NetworkIO().requestHtml(url)
File "C:\Users\Administrator\Desktop\XYWYCrawler\common\IOHandler.py", line 25, in requestHtml
resp = requests.get(url, headers=self.__headers, timeout=(5, 20))
File "C:\Program Files\Python\lib\site-packages\requests\api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "C:\Program Files\Python\lib\site-packages\requests\api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Program Files\Python\lib\site-packages\requests\sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "C:\Program Files\Python\lib\site-packages\requests\sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "C:\Program Files\Python\lib\site-packages\requests\adapters.py", line 499, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='club.xywy.com', port=80): Read timed out. (read timeout=20)
```
Firstly, I thought it might be the readtimeout is too short, but whenever how long the readtimeout is ,this exception still happened, so is anybody tell me why and how to fix it? | {
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3924/reactions"
} | https://api.github.com/repos/psf/requests/issues/3924/timeline | null | completed | null | null | false | [
"Right now it's very unclear. Can you please answer some of the questions from the contributing guide?\r\n\r\nWhat version of Requests do you have? What version of Python are you using? What other packages do you have installed? And can you provide a minimal example reproduction?",
"@Lukasa \r\nPython version: ``... |
https://api.github.com/repos/psf/requests/issues/3923 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3923/labels{/name} | https://api.github.com/repos/psf/requests/issues/3923/comments | https://api.github.com/repos/psf/requests/issues/3923/events | https://github.com/psf/requests/pull/3923 | 214,168,922 | MDExOlB1bGxSZXF1ZXN0MTEwNjkwNzk3 | 3,923 | Rebase #3745 and add some tests | {
"avatar_url": "https://avatars.githubusercontent.com/u/5553380?v=4",
"events_url": "https://api.github.com/users/vbarbaresi/events{/privacy}",
"followers_url": "https://api.github.com/users/vbarbaresi/followers",
"following_url": "https://api.github.com/users/vbarbaresi/following{/other_user}",
"gists_url": "https://api.github.com/users/vbarbaresi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/vbarbaresi",
"id": 5553380,
"login": "vbarbaresi",
"node_id": "MDQ6VXNlcjU1NTMzODA=",
"organizations_url": "https://api.github.com/users/vbarbaresi/orgs",
"received_events_url": "https://api.github.com/users/vbarbaresi/received_events",
"repos_url": "https://api.github.com/users/vbarbaresi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/vbarbaresi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vbarbaresi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/vbarbaresi",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-03-14T18:41:10Z | 2021-09-05T00:07:17Z | 2017-03-16T09:53:04Z | NONE | resolved | 2 years after the original #2431, and after #3745
I encountered the strange behavior of `r.iter_lines()`, found this and tried to complete it.
Rebased once more and added more tests using the breakdown of @ianepperson https://github.com/kennethreitz/requests/pull/2431#issuecomment-72333964 | {
"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/3923/reactions"
} | https://api.github.com/repos/psf/requests/issues/3923/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3923.diff",
"html_url": "https://github.com/psf/requests/pull/3923",
"merged_at": "2017-03-16T09:53:04Z",
"patch_url": "https://github.com/psf/requests/pull/3923.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3923"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3923?src=pr&el=h1) Report\n> Merging [#3923](https://codecov.io/gh/kennethreitz/requests/pull/3923?src=pr&el=desc) into [proposed/3.0.0](https://codecov.io/gh/kennethreitz/requests/commit/84dc6b66daf3d864737a61bacf86a91b68408656?src=pr&el=desc) will **in... |
https://api.github.com/repos/psf/requests/issues/3922 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3922/labels{/name} | https://api.github.com/repos/psf/requests/issues/3922/comments | https://api.github.com/repos/psf/requests/issues/3922/events | https://github.com/psf/requests/pull/3922 | 214,103,595 | MDExOlB1bGxSZXF1ZXN0MTEwNjQzNDM2 | 3,922 | Change apostrophe placement in advanced.rst | {
"avatar_url": "https://avatars.githubusercontent.com/u/2491257?v=4",
"events_url": "https://api.github.com/users/bgschiller/events{/privacy}",
"followers_url": "https://api.github.com/users/bgschiller/followers",
"following_url": "https://api.github.com/users/bgschiller/following{/other_user}",
"gists_url": "https://api.github.com/users/bgschiller/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bgschiller",
"id": 2491257,
"login": "bgschiller",
"node_id": "MDQ6VXNlcjI0OTEyNTc=",
"organizations_url": "https://api.github.com/users/bgschiller/orgs",
"received_events_url": "https://api.github.com/users/bgschiller/received_events",
"repos_url": "https://api.github.com/users/bgschiller/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bgschiller/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bgschiller/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bgschiller",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 4 | 2017-03-14T15:10:32Z | 2021-09-07T00:06:27Z | 2017-03-14T15:40:50Z | CONTRIBUTOR | resolved | See Rule2a on http://www.grammarbook.com/punctuation/apostro.asp | {
"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/3922/reactions"
} | https://api.github.com/repos/psf/requests/issues/3922/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3922.diff",
"html_url": "https://github.com/psf/requests/pull/3922",
"merged_at": "2017-03-14T15:40:50Z",
"patch_url": "https://github.com/psf/requests/pull/3922.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3922"
} | true | [
"Yup, this looks right. Thanks for the patch! :sparkles:",
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3922?src=pr&el=h1) Report\n> Merging [#3922](https://codecov.io/gh/kennethreitz/requests/pull/3922?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/29085e7d95915... |
https://api.github.com/repos/psf/requests/issues/3921 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3921/labels{/name} | https://api.github.com/repos/psf/requests/issues/3921/comments | https://api.github.com/repos/psf/requests/issues/3921/events | https://github.com/psf/requests/issues/3921 | 213,668,282 | MDU6SXNzdWUyMTM2NjgyODI= | 3,921 | Inconsistent document about parameter timeout | {
"avatar_url": "https://avatars.githubusercontent.com/u/2781994?v=4",
"events_url": "https://api.github.com/users/crindy646/events{/privacy}",
"followers_url": "https://api.github.com/users/crindy646/followers",
"following_url": "https://api.github.com/users/crindy646/following{/other_user}",
"gists_url": "https://api.github.com/users/crindy646/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/crindy646",
"id": 2781994,
"login": "crindy646",
"node_id": "MDQ6VXNlcjI3ODE5OTQ=",
"organizations_url": "https://api.github.com/users/crindy646/orgs",
"received_events_url": "https://api.github.com/users/crindy646/received_events",
"repos_url": "https://api.github.com/users/crindy646/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/crindy646/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/crindy646/subscriptions",
"type": "User",
"url": "https://api.github.com/users/crindy646",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 0 | 2017-03-13T03:59:11Z | 2021-09-08T11:00:42Z | 2017-03-13T04:02:19Z | NONE | resolved | The quickstart document (http://docs.python-requests.org/en/master/user/quickstart/) states that "If no timeout is specified explicitly, requests do not time out.". However, this is not correct as I noticed automatic timeout if no timeout is specified. Besides, this information is inconsistent with the advanced document (http://docs.python-requests.org/en/master/user/advanced/#advanced), which states that "...by passing None as a timeout value and then retrieving a cup of coffee." in the end of the document. | {
"avatar_url": "https://avatars.githubusercontent.com/u/2781994?v=4",
"events_url": "https://api.github.com/users/crindy646/events{/privacy}",
"followers_url": "https://api.github.com/users/crindy646/followers",
"following_url": "https://api.github.com/users/crindy646/following{/other_user}",
"gists_url": "https://api.github.com/users/crindy646/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/crindy646",
"id": 2781994,
"login": "crindy646",
"node_id": "MDQ6VXNlcjI3ODE5OTQ=",
"organizations_url": "https://api.github.com/users/crindy646/orgs",
"received_events_url": "https://api.github.com/users/crindy646/received_events",
"repos_url": "https://api.github.com/users/crindy646/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/crindy646/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/crindy646/subscriptions",
"type": "User",
"url": "https://api.github.com/users/crindy646",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3921/reactions"
} | https://api.github.com/repos/psf/requests/issues/3921/timeline | null | completed | null | null | false | [] |
https://api.github.com/repos/psf/requests/issues/3920 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3920/labels{/name} | https://api.github.com/repos/psf/requests/issues/3920/comments | https://api.github.com/repos/psf/requests/issues/3920/events | https://github.com/psf/requests/pull/3920 | 212,955,033 | MDExOlB1bGxSZXF1ZXN0MTA5ODU0MDE2 | 3,920 | Update README.rst - add 'of' | {
"avatar_url": "https://avatars.githubusercontent.com/u/1449512?v=4",
"events_url": "https://api.github.com/users/dufferzafar/events{/privacy}",
"followers_url": "https://api.github.com/users/dufferzafar/followers",
"following_url": "https://api.github.com/users/dufferzafar/following{/other_user}",
"gists_url": "https://api.github.com/users/dufferzafar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dufferzafar",
"id": 1449512,
"login": "dufferzafar",
"node_id": "MDQ6VXNlcjE0NDk1MTI=",
"organizations_url": "https://api.github.com/users/dufferzafar/orgs",
"received_events_url": "https://api.github.com/users/dufferzafar/received_events",
"repos_url": "https://api.github.com/users/dufferzafar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dufferzafar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dufferzafar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dufferzafar",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-03-09T07:20:16Z | 2021-09-07T00:06:27Z | 2017-03-09T08:16:32Z | CONTRIBUTOR | resolved | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3920/reactions"
} | https://api.github.com/repos/psf/requests/issues/3920/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3920.diff",
"html_url": "https://github.com/psf/requests/pull/3920",
"merged_at": "2017-03-09T08:16:32Z",
"patch_url": "https://github.com/psf/requests/pull/3920.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3920"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3920?src=pr&el=h1) Report\n> Merging [#3920](https://codecov.io/gh/kennethreitz/requests/pull/3920?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/c43fefa7ed535c41ba7d58021f0f16ed5ba1d584?src=pr&el=desc) will **not change... | |
https://api.github.com/repos/psf/requests/issues/3919 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3919/labels{/name} | https://api.github.com/repos/psf/requests/issues/3919/comments | https://api.github.com/repos/psf/requests/issues/3919/events | https://github.com/psf/requests/issues/3919 | 212,790,055 | MDU6SXNzdWUyMTI3OTAwNTU= | 3,919 | Failed to open a certain url | {
"avatar_url": "https://avatars.githubusercontent.com/u/15707017?v=4",
"events_url": "https://api.github.com/users/Sayalic0/events{/privacy}",
"followers_url": "https://api.github.com/users/Sayalic0/followers",
"following_url": "https://api.github.com/users/Sayalic0/following{/other_user}",
"gists_url": "https://api.github.com/users/Sayalic0/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Sayalic0",
"id": 15707017,
"login": "Sayalic0",
"node_id": "MDQ6VXNlcjE1NzA3MDE3",
"organizations_url": "https://api.github.com/users/Sayalic0/orgs",
"received_events_url": "https://api.github.com/users/Sayalic0/received_events",
"repos_url": "https://api.github.com/users/Sayalic0/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Sayalic0/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Sayalic0/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Sayalic0",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-03-08T16:46:54Z | 2021-09-08T11:00:44Z | 2017-03-08T16:59:25Z | NONE | resolved | I opened debug info for `requests` and request an URL:
import logging
import requests
from http.client import HTTPConnection
HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
requests_log = logging.getLogger("requests.packages.urllib3")
requests_log.setLevel(logging.DEBUG)
requests_log.propagate = True
requests.get('http://uae.souq.com/ae-ar/apple-iphone-7-with-facetime-32gb-4g-lte-gold-11526690/i/')
It outputs:
> DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTP
> connection (1): uae.souq.com send: b'GET
> /ae-ar/apple-iphone-7-with-facetime-32gb-4g-lte-gold-11526690/i/
> HTTP/1.1\r\nHost: uae.souq.com\r\nAccept: */*\r\nUser-Agent:
> python-requests/2.12.4\r\nConnection: keep-alive\r\nAccept-Encoding:
> gzip, deflate\r\n\r\n' reply: 'HTTP/1.1 301 Moved Permanently\r\n'
> DEBUG:requests.packages.urllib3.connectionpool:http://uae.souq.com:80
> "GET /ae-ar/apple-iphone-7-with-facetime-32gb-4g-lte-gold-11526690/i/
> HTTP/1.1" 301 None
> WARNING:requests.packages.urllib3.connectionpool:Failed to parse
> headers
> (url=http://uae.souq.com:80/ae-ar/apple-iphone-7-with-facetime-32gb-4g-lte-gold-11526690/i/):
> [MissingHeaderBodySeparatorDefect()], unparsed data:
> 'ع-Ù\x81Ù\x8aس-تاÙ\x8aÙ\x85-32-جÙ\x8aجا-اÙ\x84جÙ\x8aÙ\x84-اÙ\x84رابع-اÙ\x84-تÙ\x8a-اÙ\x8a-ذÙ\x87بÙ\x8a-11526690/i/\r\nPragma:
> no-cache\r\nServer: Apache\r\nStrict-Transport-Security:
> max-age=0\r\nVary: Accept-Encoding\r\nX-Content-Type-Options:
> nosniff\r\nX-Frame-Options: SAMEORIGIN\r\nContent-Length: 20\r\nDate:
> Wed, 08 Mar 2017 16:20:30 GMT\r\nConnection: keep-alive\r\nSet-Cookie:
> PLATEFORMC=ae; expires=Thu, 08-Mar-2018 16:20:30 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie:
> PHPSESSID=gdbudqf2d734i499du12qac0bofbjjvo; path=/; domain=.souq.com;
> HttpOnly\r\nSet-Cookie: PLATEFORML=ar; expires=Thu, 08-Mar-2018
> 16:20:30 GMT; path=/; domain=.souq.com\r\nSet-Cookie:
> c_Ident=14889900303248; expires=Sat, 06-Mar-2027 16:20:30 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie: registration_source=deleted;
> expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie: registration_failed=deleted;
> expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie: login_source=deleted; expires=Thu,
> 01-Jan-1970 00:00:01 GMT; path=/; domain=.souq.com\r\nSet-Cookie:
> login_failed=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie: BUYER_CITY_SELECTED=89; expires=Fri,
> 07-Apr-2017 16:20:30 GMT; path=/\r\nSet-Cookie: UserViews=11526690;
> expires=Fri, 07-Apr-2017 16:20:30 GMT; path=/\r\nSet-Cookie:
> NSC_tpvr-72.52.8.197-80=ffffffff2d81ae8345525d5f4f58455e445a4a423660;path=/;httponly\r\n\r\n' Traceback (most recent call last): File
> "/Users/Sona/work/projects/1688Crawler/myenv/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py",
> line 403, in _make_request
> assert_header_parsing(httplib_response.msg) File "/Users/Sona/work/projects/1688Crawler/myenv/lib/python3.5/site-packages/requests/packages/urllib3/util/response.py",
> line 66, in assert_header_parsing
> raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
> requests.packages.urllib3.exceptions.HeaderParsingError:
> [MissingHeaderBodySeparatorDefect()], unparsed data:
> 'ع-Ù\x81Ù\x8aس-تاÙ\x8aÙ\x85-32-جÙ\x8aجا-اÙ\x84جÙ\x8aÙ\x84-اÙ\x84رابع-اÙ\x84-تÙ\x8a-اÙ\x8a-ذÙ\x87بÙ\x8a-11526690/i/\r\nPragma:
> no-cache\r\nServer: Apache\r\nStrict-Transport-Security:
> max-age=0\r\nVary: Accept-Encoding\r\nX-Content-Type-Options:
> nosniff\r\nX-Frame-Options: SAMEORIGIN\r\nContent-Length: 20\r\nDate:
> Wed, 08 Mar 2017 16:20:30 GMT\r\nConnection: keep-alive\r\nSet-Cookie:
> PLATEFORMC=ae; expires=Thu, 08-Mar-2018 16:20:30 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie:
> PHPSESSID=gdbudqf2d734i499du12qac0bofbjjvo; path=/; domain=.souq.com;
> HttpOnly\r\nSet-Cookie: PLATEFORML=ar; expires=Thu, 08-Mar-2018
> 16:20:30 GMT; path=/; domain=.souq.com\r\nSet-Cookie:
> c_Ident=14889900303248; expires=Sat, 06-Mar-2027 16:20:30 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie: registration_source=deleted;
> expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie: registration_failed=deleted;
> expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie: login_source=deleted; expires=Thu,
> 01-Jan-1970 00:00:01 GMT; path=/; domain=.souq.com\r\nSet-Cookie:
> login_failed=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/;
> domain=.souq.com\r\nSet-Cookie: BUYER_CITY_SELECTED=89; expires=Fri,
> 07-Apr-2017 16:20:30 GMT; path=/\r\nSet-Cookie: UserViews=11526690;
> expires=Fri, 07-Apr-2017 16:20:30 GMT; path=/\r\nSet-Cookie:
> NSC_tpvr-72.52.8.197-80=ffffffff2d81ae8345525d5f4f58455e445a4a423660;path=/;httponly\r\n\r\n'
You can see it output a warning `Failed to parse headers` then it just hangs here.
ENV:
Python 3.5.2 (default, Aug 16 2016, 05:35:40)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
requests (2.12.4) Failed
requests (2.13.0) Failed
| {
"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/3919/reactions"
} | https://api.github.com/repos/psf/requests/issues/3919/timeline | null | completed | null | null | false | [
"This is an error in the standard library caused by a misbehaviour in their header parsing logic. The problem is gone in Python 3.6: I recommend you upgrade. :smile:",
"@Lukasa, are you sure this is fixed in 3.6? The redirect URL being passed back is encoded as utf-8 but we're decoding it as ISO-8859-1 which is w... |
https://api.github.com/repos/psf/requests/issues/3918 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3918/labels{/name} | https://api.github.com/repos/psf/requests/issues/3918/comments | https://api.github.com/repos/psf/requests/issues/3918/events | https://github.com/psf/requests/pull/3918 | 212,625,241 | MDExOlB1bGxSZXF1ZXN0MTA5NjE5NTIx | 3,918 | DefaultSelector fallback to less efficient methods | {
"avatar_url": "https://avatars.githubusercontent.com/u/3293865?v=4",
"events_url": "https://api.github.com/users/programatix/events{/privacy}",
"followers_url": "https://api.github.com/users/programatix/followers",
"following_url": "https://api.github.com/users/programatix/following{/other_user}",
"gists_url": "https://api.github.com/users/programatix/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/programatix",
"id": 3293865,
"login": "programatix",
"node_id": "MDQ6VXNlcjMyOTM4NjU=",
"organizations_url": "https://api.github.com/users/programatix/orgs",
"received_events_url": "https://api.github.com/users/programatix/received_events",
"repos_url": "https://api.github.com/users/programatix/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/programatix/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/programatix/subscriptions",
"type": "User",
"url": "https://api.github.com/users/programatix",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-03-08T03:07:14Z | 2021-09-07T00:06:27Z | 2017-03-08T08:29:14Z | NONE | resolved | Test the selector before making it the default selector. This is due to issue reported by myself at https://github.com/kennethreitz/requests/issues/3906 | {
"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/3918/reactions"
} | https://api.github.com/repos/psf/requests/issues/3918/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3918.diff",
"html_url": "https://github.com/psf/requests/pull/3918",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/3918.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3918"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3918?src=pr&el=h1) Report\n> Merging [#3918](https://codecov.io/gh/kennethreitz/requests/pull/3918?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/c43fefa7ed535c41ba7d58021f0f16ed5ba1d584?src=pr&el=desc) will **not change... |
https://api.github.com/repos/psf/requests/issues/3917 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3917/labels{/name} | https://api.github.com/repos/psf/requests/issues/3917/comments | https://api.github.com/repos/psf/requests/issues/3917/events | https://github.com/psf/requests/issues/3917 | 212,620,832 | MDU6SXNzdWUyMTI2MjA4MzI= | 3,917 | Excessive calls to chardet.compat.wrap_ord() | {
"avatar_url": "https://avatars.githubusercontent.com/u/331198?v=4",
"events_url": "https://api.github.com/users/fazalmajid/events{/privacy}",
"followers_url": "https://api.github.com/users/fazalmajid/followers",
"following_url": "https://api.github.com/users/fazalmajid/following{/other_user}",
"gists_url": "https://api.github.com/users/fazalmajid/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/fazalmajid",
"id": 331198,
"login": "fazalmajid",
"node_id": "MDQ6VXNlcjMzMTE5OA==",
"organizations_url": "https://api.github.com/users/fazalmajid/orgs",
"received_events_url": "https://api.github.com/users/fazalmajid/received_events",
"repos_url": "https://api.github.com/users/fazalmajid/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/fazalmajid/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/fazalmajid/subscriptions",
"type": "User",
"url": "https://api.github.com/users/fazalmajid",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-08T02:33:49Z | 2021-09-08T11:00:43Z | 2017-03-08T08:38:25Z | NONE | resolved | I switched [Temboz](github.com/fazalmajid/temboz) from urllib2 to requests for better SSL compatibility with OpenSSL 1.1.0. In the process of running the yappi profiler to identify hot spots, I found 536 calls to `requests.get()` and one call to `requests.post()` generate a truly staggering 78,842,716 calls to the bundled `chardet.compat.wrap_ord()`, the single most CPU-intensive function in the program, and one that clearly cries for being rewritten in C.
Here is the profile, filtered for functions in requests (tsub is time spent in the function itself, ttot the total time including that spent in subroutines):
```
Clock type: CPU
Ordered by: tsub, desc
name ncall tsub ttot
..al/lib/python2.7/site-packages/requests/packages/chardet/compat.py:30 wrap_ord 78842716 94.90073 135.5516
..s/requests/packages/chardet/sbcharsetprober.py:70 SingleByteCharSetProber.feed 990 51.74951 171.9226
..on2.7/site-packages/requests/packages/chardet/utf8prober.py:50 UTF8Prober.feed 66 8.032774 30.21379
..ite-packages/requests/packages/chardet/mbcharsetprober.py:53 GB2312Prober.feed 90 4.740380 14.07524
../site-packages/requests/packages/chardet/latin1prober.py:110 Latin1Prober.feed 66 1.839232 5.587769
..on2.7/site-packages/requests/packages/chardet/sjisprober.py:52 SJISProber.feed 16 1.297811 6.159460
..requests/packages/chardet/chardistribution.py:68 SJISDistributionAnalysis.feed 3068462 1.139531 1.140868
..2.7/site-packages/requests/packages/chardet/eucjpprober.py:52 EUCJPProber.feed 16 1.063283 4.183719
..packages/requests/packages/chardet/jpcntx.py:186 SJISContextAnalysis.get_order 513796 0.933412 2.930005
..site-packages/requests/packages/chardet/jpcntx.py:139 SJISContextAnalysis.feed 804396 0.861518 4.545487
..ackages/requests/packages/chardet/jpcntx.py:207 EUCJPContextAnalysis.get_order 235890 0.432921 1.347917
..kages/requests/packages/urllib3/connectionpool.py:409 HTTPConnectionPool.close 457 0.276394 0.724681
..ages/requests/packages/urllib3/connectionpool.py:409 HTTPSConnectionPool.close 186 0.264481 0.466707
..packages/requests/packages/chardet/codingstatemachine.py:32 CodingStateMachine 3 0.243423 1.155184
..7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py:161 idna_encode 2236 0.195292 0.537523
..s/requests/packages/chardet/chardistribution.py:149 GB2312DistributionAnalysis 100987 0.135266 0.729219
../site-packages/requests/packages/urllib3/response.py:59 GzipDecoder.decompress 1643 0.133783 1.593196
/usr/local/lib/python2.7/site-packages/requests/utils.py:109 get_netrc_auth 675 0.079331 0.482274
..es/requests/packages/chardet/chardistribution.py:215 EUCJPDistributionAnalysis 4 0.066621 0.316271
/usr/local/lib/python2.7/site-packages/requests/models.py:804 Response.text 935 0.046146 234.3144
..ges/requests/packages/urllib3/packages/ordered_dict.py:28 OrderedDict.__init__ 5389 0.036204 0.076659
../requests/packages/urllib3/packages/ordered_dict.py:44 OrderedDict.__setitem__ 18560 0.031681 0.031681
..hon2.7/site-packages/requests/structures.py:48 CaseInsensitiveDict.__setitem__ 17486 0.031517 0.068291
/usr/local/lib/python2.7/site-packages/requests/sessions.py:569 Session.send 675/537 0.031151 13.03016
../site-packages/requests/packages/chardet/hebrewprober.py:193 HebrewProber.feed 66 0.028608 0.387578
...7/site-packages/requests/packages/urllib3/packages/ordered_dict.py:142 update 6463 0.028498 0.044194
..al/lib/python2.7/site-packages/requests/packages/chardet/__init__.py:22 detect 80 0.026783 234.1047
..ges/requests/packages/urllib3/connectionpool.py:446 HTTPConnectionPool.urlopen 635 0.022364 5.970765
..e-packages/requests/packages/chardet/hebrewprober.py:176 HebrewProber.is_final 20786 0.021933 0.057430
..on2.7/site-packages/requests/packages/urllib3/_collections.py:307 from_httplib 673 0.021078 0.132086
..ages/requests/packages/urllib3/packages/ordered_dict.py:120 OrderedDict.values 4179 0.020975 0.033571
..kages/requests/packages/urllib3/_collections.py:150 HTTPHeaderDict.__getitem__ 10584 0.020511 0.028778
..hon2.7/site-packages/requests/structures.py:53 CaseInsensitiveDict.__getitem__ 14970 0.020442 0.026593
..n2.7/site-packages/requests/packages/urllib3/response.py:342 HTTPResponse.read 1194 0.018882 0.623519
..e-packages/requests/packages/urllib3/response.py:563 HTTPResponse.read_chunked 2453 0.018336 4.454664
..python2.7/site-packages/requests/structures.py:42 CaseInsensitiveDict.__init__ 3640 0.017919 0.232792
/usr/local/lib/python2.7/site-packages/requests/adapters.py:375 HTTPAdapter.send 675 0.017755 7.363262
..ges/requests/packages/urllib3/packages/ordered_dict.py:63 OrderedDict.__iter__ 28275 0.017196 0.017196
..es/requests/packages/urllib3/connectionpool.py:161 HTTPConnectionPool.__init__ 603 0.015133 0.446155
../site-packages/requests/packages/urllib3/response.py:109 HTTPResponse.__init__ 673 0.014580 0.032654
/usr/local/lib/python2.7/site-packages/requests/sessions.py:42 merge_setting 3759 0.014469 0.143070
..python2.7/site-packages/requests/packages/urllib3/response.py:437 from_httplib 673 0.014440 0.188490
..site-packages/requests/packages/urllib3/_collections.py:208 HTTPHeaderDict.add 7288 0.013808 0.045963
..l/lib/python2.7/site-packages/requests/sessions.py:371 Session.prepare_request 537 0.013452 0.781796
..cal/lib/python2.7/site-packages/requests/cookies.py:121 extract_cookies_to_jar 1620 0.013200 0.439333
..kages/requests/packages/urllib3/_collections.py:86 RecentlyUsedContainer.clear 1074 0.012815 1.241480
/usr/local/lib/python2.7/site-packages/requests/utils.py:193 to_key_val_list 3760 0.012193 0.048183
..lib/python2.7/site-packages/requests/models.py:350 PreparedRequest.prepare_url 537 0.012025 0.058131
..packages/requests/packages/urllib3/_collections.py:135 HTTPHeaderDict.__init__ 673 0.011954 0.096859
..ite-packages/requests/packages/urllib3/util/connection.py:36 create_connection 644 0.011301 0.929808
/usr/local/lib/python2.7/site-packages/requests/sessions.py:308 Session.__init__ 537 0.011118 0.147501
/usr/local/lib/python2.7/site-packages/requests/api.py:59 get 536 0.010793 15.27869
/usr/local/lib/python2.7/site-packages/requests/sessions.py:411 Session.request 537 0.010758 13.90416
...7/site-packages/requests/packages/urllib3/response.py:411 HTTPResponse.stream 3921 0.010551 5.093289
..ckages/requests/packages/chardet/hebrewprober.py:180 HebrewProber.is_non_final 10360 0.010459 0.027898
..ib/python2.7/site-packages/requests/adapters.py:240 HTTPAdapter.build_response 673 0.010364 0.357617
../lib/python2.7/site-packages/requests/sessions.py:89 Session.resolve_redirects 809/673 0.010361 4.891653
..e-packages/requests/packages/urllib3/_collections.py:231 HTTPHeaderDict.extend 673 0.010303 0.066090
..packages/requests/packages/urllib3/response.py:285 HTTPResponse._error_catcher 2952 0.009959 0.283745
../local/lib/python2.7/site-packages/requests/cookies.py:503 cookiejar_from_dict 1747 0.009438 0.054105
..ackages/requests/packages/urllib3/util/selectors.py:362 EpollSelector.__init__ 31 0.009375 0.009515
/usr/local/lib/python2.7/site-packages/requests/models.py:591 Response.__init__ 673 0.009241 0.054446
/usr/local/lib/python2.7/site-packages/requests/utils.py:623 select_proxy 1350 0.008971 0.040397
..es/requests/packages/urllib3/response.py:527 HTTPResponse._update_chunk_length 2481 0.008881 0.396292
..-packages/requests/packages/urllib3/response.py:541 HTTPResponse._handle_chunk 2199 0.008796 2.364839
..ib/python2.7/site-packages/requests/packages/urllib3/util/url.py:128 parse_url 1212 0.008659 0.030989
/usr/local/lib/python2.7/site-packages/requests/structures.py:60 <genexpr> 16382 0.008584 0.008584
/usr/local/lib/python2.7/site-packages/requests/api.py:16 request 537 0.008567 15.31966
..python2.7/site-packages/requests/models.py:436 PreparedRequest.prepare_headers 537 0.008421 0.057456
..ocal/lib/python2.7/site-packages/requests/adapters.py:107 HTTPAdapter.__init__ 1074 0.008286 0.049011
...7/site-packages/requests/packages/urllib3/util/timeout.py:93 Timeout.__init__ 2668 0.007956 0.011990
..e-packages/requests/packages/urllib3/poolmanager.py:43 _default_key_normalizer 675 0.007883 0.011798
../local/lib/python2.7/site-packages/requests/cookies.py:40 MockRequest.__init__ 2295 0.007826 0.054429
/usr/local/lib/python2.7/site-packages/requests/models.py:784 Response.content 2677 0.007645 5.127400
..ckages/requests/packages/chardet/charsetgroupprober.py:58 MBCSGroupProber.feed 132 0.007291 228.4211
/usr/local/lib/python2.7/site-packages/requests/models.py:715 generate 3921 0.007136 5.100890
/usr/local/lib/python2.7/site-packages/requests/hooks.py:17 default_hooks 1749 0.007067 0.009190
..-packages/requests/packages/urllib3/response.py:246 HTTPResponse._init_decoder 1476 0.006796 0.021775
..-packages/requests/packages/urllib3/contrib/pyopenssl.py:181 get_subj_alt_name 118 0.006681 1.656172
..requests/packages/urllib3/_collections.py:50 RecentlyUsedContainer.__getitem__ 1200 0.006554 0.021538
..packages/requests/packages/urllib3/contrib/pyopenssl.py:253 WrappedSocket.recv 2681 0.006503 1.339557
..7/site-packages/requests/packages/urllib3/response.py:256 HTTPResponse._decode 3280 0.006496 1.599581
..s/requests/packages/urllib3/connectionpool.py:201 HTTPConnectionPool._new_conn 524 0.006479 0.019929
..es/requests/packages/urllib3/connection.py:282 VerifiedHTTPSConnection.connect 119 0.006425 4.282900
..ite-packages/requests/packages/urllib3/poolmanager.py:113 PoolManager.__init__ 1074 0.006354 0.031242
..es/requests/packages/urllib3/_collections.py:43 RecentlyUsedContainer.__init__ 1611 0.006306 0.033341
..cal/lib/python2.7/site-packages/requests/models.py:297 PreparedRequest.prepare 537 0.006199 0.221293
..l/lib/python2.7/site-packages/requests/packages/urllib3/util/url.py:18 __new__ 1212 0.006106 0.014044
..requests/packages/urllib3/_collections.py:57 RecentlyUsedContainer.__setitem__ 761 0.005778 0.033536
..te-packages/requests/packages/urllib3/poolmanager.py:132 PoolManager._new_pool 643 0.005776 0.462834
/usr/local/lib/python2.7/site-packages/requests/sessions.py:692 Session.mount 1074 0.005719 0.010732
..python2.7/site-packages/requests/structures.py:59 CaseInsensitiveDict.__iter__ 2959 0.005634 0.028188
..e-packages/requests/packages/urllib3/response.py:198 HTTPResponse._init_length 673 0.005503 0.009351
..packages/requests/packages/urllib3/_collections.py:180 HTTPHeaderDict.__iter__ 7762 0.005025 0.016189
..ib/python2.7/site-packages/requests/adapters.py:277 HTTPAdapter.get_connection 675 0.004904 0.578169
..e-packages/requests/packages/urllib3/connection.py:106 HTTPConnection.__init__ 603 0.004904 0.009951
..cal/lib/python2.7/site-packages/requests/models.py:60 PreparedRequest.path_url 675 0.004774 0.006620
/usr/local/lib/python2.7/site-packages/requests/models.py:217 Request.__init__ 537 0.004712 0.007227
..n2.7/site-packages/requests/sessions.py:645 Session.merge_environment_settings 537 0.004704 0.072752
..b/python2.7/site-packages/requests/packages/urllib3/util/url.py:95 split_first 1212 0.004652 0.006813
..packages/requests/packages/urllib3/contrib/pyopenssl.py:151 _dnsname_to_stdlib 2236 0.004607 0.542130
/usr/local/lib/python2.7/site-packages/requests/cookies.py:523 merge_cookies 1212 0.004594 0.020980
../local/lib/python2.7/site-packages/requests/utils.py:557 should_bypass_proxies 813 0.004582 0.039443
../local/lib/python2.7/site-packages/requests/utils.py:778 check_header_validity 2451 0.004534 0.008794
..kages/requests/packages/urllib3/packages/ordered_dict.py:124 OrderedDict.items 2286 0.004458 0.006893
/usr/local/lib/python2.7/site-packages/requests/cookies.py:138 get_cookie_header 675 0.004346 0.081325
../python2.7/site-packages/requests/packages/urllib3/poolmanager.py:117 <lambda> 643 0.004320 1.195708
..r/local/lib/python2.7/site-packages/requests/adapters.py:300 HTTPAdapter.close 1074 0.004301 1.249044
../requests/packages/urllib3/poolmanager.py:158 PoolManager.connection_from_host 675 0.004206 0.528484
..ib/python2.7/site-packages/requests/models.py:447 PreparedRequest.prepare_body 537 0.004169 0.012838
..on2.7/site-packages/requests/packages/urllib3/util/retry.py:144 Retry.__init__ 1074 0.004126 0.004126
..site-packages/requests/packages/chardet/mbcharsetprober.py:42 SJISProber.reset 924 0.004068 0.005386
../site-packages/requests/packages/urllib3/util/timeout.py:103 _validate_timeout 8004 0.004034 0.004034
../python2.7/site-packages/requests/adapters.py:141 HTTPAdapter.init_poolmanager 1074 0.003880 0.035122
..al/lib/python2.7/site-packages/requests/cookies.py:54 MockRequest.get_full_url 1901 0.003832 0.012588
..l/lib/python2.7/site-packages/requests/cookies.py:349 RequestsCookieJar.update 1350 0.003746 0.015778
/usr/local/lib/python2.7/site-packages/requests/utils.py:658 default_headers 537 0.003738 0.039377
..l/lib/python2.7/site-packages/requests/adapters.py:310 HTTPAdapter.request_url 675 0.003729 0.036763
..s/requests/packages/urllib3/poolmanager.py:212 PoolManager.connection_from_url 675 0.003607 0.548444
..al/lib/python2.7/site-packages/requests/utils.py:359 get_encoding_from_headers 673 0.003579 0.019060
/usr/local/lib/python2.7/site-packages/requests/utils.py:758 get_auth_from_url 537 0.003563 0.010764
../requests/packages/chardet/sbcharsetprober.py:54 SingleByteCharSetProber.reset 1980 0.003514 0.004381
..-packages/requests/packages/urllib3/connection.py:127 HTTPConnection._new_conn 604 0.003505 0.925816
/usr/local/lib/python2.7/site-packages/requests/sessions.py:687 Session.close 537 0.003486 1.257747
/usr/local/lib/python2.7/site-packages/requests/utils.py:563 <lambda> 813 0.003399 0.007317
..e-packages/requests/packages/urllib3/response.py:170 HTTPResponse.release_conn 811 0.003365 0.272946
..al/lib/python2.7/site-packages/requests/models.py:280 PreparedRequest.__init__ 675 0.003356 0.007124
/usr/local/lib/python2.7/site-packages/requests/models.py:81 _encode_params 538 0.003343 0.013350
..local/lib/python2.7/site-packages/requests/models.py:698 Response.iter_content 673 0.003307 0.003614
..local/lib/python2.7/site-packages/requests/sessions.py:673 Session.get_adapter 675 0.003268 0.008285
..kages/requests/packages/chardet/charsetgroupprober.py:40 MBCSGroupProber.reset 132 0.003110 0.008333
..te-packages/requests/packages/urllib3/connection.py:165 HTTPConnection.connect 525 0.003057 0.625827
..al/lib/python2.7/site-packages/requests/_internal_utils.py:14 to_native_string 3126 0.003039 0.004066
..n2.7/site-packages/requests/packages/urllib3/util/timeout.py:156 Timeout.clone 1350 0.002941 0.008006
/usr/local/lib/python2.7/site-packages/requests/utils.py:450 unquote_unreserved 675 0.002912 0.004601
..hon2.7/site-packages/requests/packages/urllib3/util/response.py:7 is_fp_closed 1585 0.002897 0.003943
..s/requests/packages/urllib3/connectionpool.py:214 HTTPConnectionPool._get_conn 635 0.002894 0.092972
..e-packages/requests/packages/urllib3/util/connection.py:88 _set_socket_options 644 0.002790 0.006663
..e-packages/requests/packages/urllib3/util/response.py:38 assert_header_parsing 673 0.002732 0.005067
..7/site-packages/requests/packages/urllib3/poolmanager.py:149 PoolManager.clear 1074 0.002725 1.244205
../requests/packages/urllib3/connectionpool.py:812 HTTPSConnectionPool._new_conn 119 0.002628 0.007596
..l/lib/python2.7/site-packages/requests/adapters.py:198 HTTPAdapter.cert_verify 675 0.002602 0.031776
..hon2.7/site-packages/requests/packages/chardet/chardistribution.py:28 <module> 1 0.002548 0.002633
..python2.7/site-packages/requests/models.py:551 PreparedRequest.prepare_cookies 675 0.002538 0.084870
...7/site-packages/requests/packages/urllib3/response.py:481 HTTPResponse.closed 673 0.002517 0.003622
..ite-packages/requests/packages/urllib3/util/ssl_.py:214 create_urllib3_context 119 0.002504 0.362631
../local/lib/python2.7/site-packages/requests/models.py:681 Response.is_redirect 673 0.002497 0.006499
..b/python2.7/site-packages/requests/models.py:170 PreparedRequest.register_hook 537 0.002423 0.008708
/usr/local/lib/python2.7/site-packages/requests/utils.py:474 requote_uri 675 0.002381 0.010384
..lib/python2.7/site-packages/requests/structures.py:82 CaseInsensitiveDict.copy 683 0.002333 0.043642
..b/python2.7/site-packages/requests/cookies.py:344 RequestsCookieJar.set_cookie 616 0.002289 0.011899
..es/requests/packages/urllib3/connectionpool.py:446 HTTPSConnectionPool.urlopen 40 0.002261 0.366308
..ib/python2.7/site-packages/requests/models.py:529 PreparedRequest.prepare_auth 537 0.002208 0.013306
..s/requests/packages/urllib3/contrib/pyopenssl.py:328 WrappedSocket.getpeercert 118 0.002201 1.799241
/usr/local/lib/python2.7/site-packages/requests/utils.py:50 super_len 538 0.002193 0.003779
..on2.7/site-packages/requests/packages/urllib3/util/retry.py:285 Retry.is_retry 673 0.002188 0.004632
..s/requests/packages/urllib3/connectionpool.py:252 HTTPConnectionPool._put_conn 635 0.002127 0.266527
/usr/local/lib/python2.7/site-packages/requests/hooks.py:18 <genexpr> 3498 0.002123 0.002123
..ackages/requests/packages/urllib3/util/retry.py:276 Retry._is_method_retryable 673 0.002035 0.002444
..s/requests/packages/urllib3/connectionpool.py:752 HTTPSConnectionPool.__init__ 119 0.001983 0.065428
..kages/requests/packages/chardet/sbcsgroupprober.py:43 SBCSGroupProber.__init__ 60 0.001938 0.010099
..ges/requests/packages/urllib3/connectionpool.py:67 HTTPConnectionPool.__init__ 603 0.001902 0.003367
../lib/python2.7/site-packages/requests/models.py:693 Response.apparent_encoding 80 0.001895 234.1067
../python2.7/site-packages/requests/models.py:328 PreparedRequest.prepare_method 537 0.001857 0.003037
..kages/requests/packages/chardet/universaldetector.py:64 UniversalDetector.feed 80 0.001842 234.0574
/usr/local/lib/python2.7/site-packages/requests/utils.py:611 get_environ_proxies 675 0.001840 0.047788
..packages/requests/packages/urllib3/response.py:274 HTTPResponse._flush_decoder 282 0.001821 0.044676
..thon2.7/site-packages/requests/packages/urllib3/util/timeout.py:140 from_float 643 0.001745 0.005623
..site-packages/requests/packages/urllib3/response.py:470 HTTPResponse.getheader 673 0.001658 0.004491
/usr/local/lib/python2.7/site-packages/requests/cookies.py:114 MockResponse.info 3240 0.001641 0.001641
..l/lib/python2.7/site-packages/requests/sessions.py:222 Session.rebuild_proxies 138 0.001596 0.020238
..kages/requests/packages/urllib3/connection.py:154 HTTPConnection._prepare_conn 525 0.001595 0.002043
..thon2.7/site-packages/requests/packages/urllib3/packages/six.py:595 itervalues 1074 0.001519 0.001519
..al/lib/python2.7/site-packages/requests/_internal_utils.py:30 unicode_is_ascii 537 0.001480 0.002808
..local/lib/python2.7/site-packages/requests/adapters.py:54 HTTPAdapter.__init__ 1074 0.001477 0.001477
..7/site-packages/requests/packages/chardet/charsetprober.py:37 UTF8Prober.reset 3234 0.001469 0.001469
..b/python2.7/site-packages/requests/models.py:571 PreparedRequest.prepare_hooks 537 0.001463 0.010171
/usr/local/lib/python2.7/site-packages/requests/sessions.py:368 Session.__exit__ 537 0.001448 1.259195
..ib/python2.7/site-packages/requests/packages/urllib3/response.py:146 <genexpr> 1346 0.001422 0.001699
..2.7/site-packages/requests/packages/urllib3/request.py:41 PoolManager.__init__ 1717 0.001417 0.001417
..te-packages/requests/packages/chardet/charsetprober.py:46 UTF8Prober.get_state 2892 0.001296 0.001296
/usr/local/lib/python2.7/site-packages/requests/hooks.py:23 dispatch_hook 673 0.001289 0.001716
..e-packages/requests/packages/urllib3/util/timeout.py:171 Timeout.start_connect 675 0.001287 0.001931
..kages/requests/packages/chardet/mbcsgroupprober.py:42 MBCSGroupProber.__init__ 60 0.001269 0.015906
..ges/requests/packages/chardet/universaldetector.py:134 UniversalDetector.close 80 0.001236 0.009989
..packages/requests/packages/urllib3/util/timeout.py:195 Timeout.connect_timeout 1993 0.001235 0.001235
...7/site-packages/requests/packages/urllib3/response.py:53 GzipDecoder.__init__ 337 0.001185 0.002436
..ocal/lib/python2.7/site-packages/requests/cookies.py:107 MockResponse.__init__ 1620 0.001141 0.001141
../python2.7/site-packages/requests/packages/urllib3/response.py:65 _get_decoder 337 0.001121 0.003557
../local/lib/python2.7/site-packages/requests/models.py:317 PreparedRequest.copy 138 0.001101 0.015648
..on2.7/site-packages/requests/packages/urllib3/util/ssl_.py:277 ssl_wrap_socket 119 0.001098 1.709963
/usr/local/lib/python2.7/site-packages/requests/sessions.py:73 merge_hooks 537 0.001095 0.001354
..7/site-packages/requests/packages/urllib3/util/request.py:77 set_file_position 675 0.001090 0.001873
../local/lib/python2.7/site-packages/requests/cookies.py:48 MockRequest.get_host 619 0.001079 0.004473
..te-packages/requests/packages/urllib3/util/timeout.py:213 Timeout.read_timeout 674 0.001076 0.001076
..s/requests/packages/urllib3/contrib/pyopenssl.py:372 PyOpenSSLContext.__init__ 119 0.001027 0.289464
..s/requests/packages/urllib3/connectionpool.py:161 HTTPSConnectionPool.__init__ 40 0.000994 0.007482
..hon2.7/site-packages/requests/structures.py:56 CaseInsensitiveDict.__delitem__ 331 0.000992 0.001867
..on2.7/site-packages/requests/packages/urllib3/connectionpool.py:883 _ipv6_host 643 0.000962 0.001316
..b/python2.7/site-packages/requests/packages/chardet/euckrprober.py:28 <module> 2 0.000939 0.000996
/usr/local/lib/python2.7/site-packages/requests/utils.py:649 default_user_agent 537 0.000929 0.000929
..ackages/requests/packages/urllib3/contrib/pyopenssl.py:318 WrappedSocket.close 247 0.000922 0.004400
..te-packages/requests/packages/urllib3/util/connection.py:96 allowed_gai_family 644 0.000900 0.000900
..python2.7/site-packages/requests/cookies.py:51 MockRequest.get_origin_req_host 619 0.000826 0.005299
../requests/packages/urllib3/response.py:518 HTTPResponse.supports_chunked_reads 564 0.000800 0.001027
..n2.7/site-packages/requests/packages/chardet/charsetprober.py:33 CharSetProber 8 0.000778 0.005072
..ite-packages/requests/packages/urllib3/util/response.py:69 is_response_to_head 282 0.000757 0.001057
../python2.7/site-packages/requests/structures.py:62 CaseInsensitiveDict.__len__ 537 0.000746 0.000917
...7/site-packages/requests/models.py:516 PreparedRequest.prepare_content_length 537 0.000746 0.000803
..ocal/lib/python2.7/site-packages/requests/sessions.py:198 Session.rebuild_auth 138 0.000670 0.092779
..e-packages/requests/packages/chardet/mbcharsetprober.py:36 SJISProber.__init__ 462 0.000666 0.000815
../requests/packages/urllib3/packages/ordered_dict.py:54 OrderedDict.__delitem__ 331 0.000655 0.000754
..2.7/site-packages/requests/packages/urllib3/util/ssl_.py:175 resolve_cert_reqs 238 0.000645 0.000908
..kages/requests/packages/urllib3/contrib/pyopenssl.py:308 WrappedSocket.sendall 129 0.000635 0.038841
..2.7/site-packages/requests/packages/urllib3/util/wait.py:9 _wait_for_io_events 31 0.000632 0.031665
..es/requests/packages/chardet/codingstatemachine.py:39 CodingStateMachine.reset 1584 0.000628 0.000628
..requests/packages/chardet/codingstatemachine.py:33 CodingStateMachine.__init__ 528 0.000621 0.000839
..7/site-packages/requests/packages/chardet/sjisprober.py:38 SJISProber.__init__ 60 0.000584 0.002277
..ackages/requests/packages/chardet/charsetprober.py:34 MBCSGroupProber.__init__ 1782 0.000572 0.000572
..ib/python2.7/site-packages/requests/packages/chardet/sjisprober.py:28 <module> 7 0.000558 0.003366
..es/requests/packages/chardet/mbcharsetprober.py:85 GB2312Prober.get_confidence 504 0.000540 0.000750
..-packages/requests/packages/chardet/sjisprober.py:88 SJISProber.get_confidence 108 0.000531 0.000805
..s/requests/packages/urllib3/connection.py:213 VerifiedHTTPSConnection.__init__ 119 0.000530 0.002644
..s/requests/packages/urllib3/connection.py:257 VerifiedHTTPSConnection.set_cert 119 0.000530 0.000763
..site-packages/requests/packages/chardet/eucjpprober.py:38 EUCJPProber.__init__ 60 0.000529 0.001712
..ages/requests/packages/urllib3/contrib/pyopenssl.py:357 WrappedSocket.makefile 129 0.000526 0.001304
../site-packages/requests/packages/urllib3/util/selectors.py:53 _syscall_wrapper 62 0.000522 0.008563
..es/requests/packages/urllib3/contrib/pyopenssl.py:295 WrappedSocket.settimeout 129 0.000497 0.003564
..ite-packages/requests/packages/chardet/jpcntx.py:127 SJISContextAnalysis.reset 300 0.000477 0.000477
..site-packages/requests/packages/urllib3/response.py:56 GzipDecoder.__getattr__ 200 0.000471 0.019052
..s/requests/packages/chardet/universaldetector.py:45 UniversalDetector.__init__ 80 0.000467 0.004395
..es/requests/packages/urllib3/contrib/pyopenssl.py:382 PyOpenSSLContext.options 119 0.000461 0.002009
../python2.7/site-packages/requests/models.py:688 Response.is_permanent_redirect 138 0.000455 0.000905
..on2.7/site-packages/requests/packages/chardet/universaldetector.py:29 <module> 1 0.000453 0.005976
..lib/python2.7/site-packages/requests/cookies.py:84 MockRequest.get_new_headers 675 0.000450 0.000450
..cal/lib/python2.7/site-packages/requests/cookies.py:415 RequestsCookieJar.copy 138 0.000438 0.003926
/usr/local/lib/python2.7/site-packages/requests/utils.py:398 iter_slices 673 0.000430 0.000430
..ages/requests/packages/chardet/universaldetector.py:52 UniversalDetector.reset 160 0.000414 0.000414
..al/lib/python2.7/site-packages/requests/sessions.py:260 Session.rebuild_method 138 0.000403 0.000403
../requests/packages/urllib3/connectionpool.py:252 HTTPSConnectionPool._put_conn 40 0.000395 0.003106
/usr/local/lib/python2.7/site-packages/requests/cookies.py:422 _copy_cookie_jar 138 0.000391 0.004414
..ages/requests/packages/urllib3/contrib/pyopenssl.py:236 WrappedSocket.__init__ 118 0.000384 0.000384
..s/requests/packages/urllib3/connection.py:106 VerifiedHTTPSConnection.__init__ 40 0.000378 0.000744
../requests/packages/urllib3/connection.py:127 VerifiedHTTPSConnection._new_conn 40 0.000377 0.007874
/usr/local/lib/python2.7/site-packages/requests/models.py:179 <genexpr> 537 0.000376 0.000376
..te-packages/requests/packages/chardet/gb2312prober.py:34 GB2312Prober.__init__ 60 0.000369 0.001173
..ckages/requests/packages/urllib3/packages/ordered_dict.py:220 OrderedDict.copy 138 0.000367 0.002163
..l/lib/python2.7/site-packages/requests/adapters.py:339 HTTPAdapter.add_headers 675 0.000361 0.000361
/usr/local/lib/python2.7/site-packages/requests/models.py:911 Response.close 138 0.000359 0.000550
..n2.7/site-packages/requests/packages/chardet/sjisprober.py:45 SJISProber.reset 120 0.000347 0.001461
..site-packages/requests/packages/chardet/euctwprober.py:34 EUCTWProber.__init__ 60 0.000346 0.001106
..7/site-packages/requests/packages/chardet/utf8prober.py:37 UTF8Prober.__init__ 60 0.000346 0.000844
..7/site-packages/requests/packages/chardet/big5prober.py:35 Big5Prober.__init__ 60 0.000334 0.001091
..site-packages/requests/packages/chardet/euckrprober.py:35 EUCKRProber.__init__ 60 0.000333 0.001113
..site-packages/requests/packages/chardet/cp949prober.py:35 CP949Prober.__init__ 60 0.000320 0.001015
..n2.7/site-packages/requests/packages/urllib3/connection.py:350 _match_hostname 118 0.000320 0.084708
..site-packages/requests/packages/chardet/latin1prober.py:102 Latin1Prober.reset 66 0.000319 0.000347
..es/requests/packages/chardet/charsetgroupprober.py:34 MBCSGroupProber.__init__ 132 0.000317 0.000373
..lib/python2.7/site-packages/requests/cookies.py:68 MockRequest.is_unverifiable 619 0.000301 0.000301
..n2.7/site-packages/requests/packages/chardet/utf8prober.py:42 UTF8Prober.reset 120 0.000284 0.000429
..ackages/requests/packages/urllib3/util/selectors.py:369 EpollSelector.register 31 0.000278 0.004234
..ackages/requests/packages/urllib3/util/selectors.py:174 EpollSelector.register 31 0.000268 0.000811
..ackages/requests/packages/chardet/eucjpprober.py:87 EUCJPProber.get_confidence 90 0.000265 0.000378
..-packages/requests/packages/urllib3/util/selectors.py:388 EpollSelector.select 31 0.000250 0.005710
..ib/python2.7/site-packages/requests/packages/chardet/utf8prober.py:28 <module> 13 0.000242 0.000377
..r/local/lib/python2.7/site-packages/requests/sessions.py:365 Session.__enter__ 537 0.000235 0.000235
..e-packages/requests/packages/urllib3/contrib/pyopenssl.py:449 _verify_callback 360 0.000226 0.000226
...7/site-packages/requests/packages/chardet/eucjpprober.py:45 EUCJPProber.reset 120 0.000225 0.001109
..-packages/requests/packages/chardet/utf8prober.py:69 UTF8Prober.get_confidence 174 0.000221 0.000263
..e-packages/requests/packages/urllib3/util/selectors.py:421 EpollSelector.close 31 0.000210 0.011407
..e-packages/requests/packages/chardet/hebrewprober.py:156 HebrewProber.__init__ 60 0.000196 0.000297
..te-packages/requests/packages/chardet/latin1prober.py:98 Latin1Prober.__init__ 60 0.000193 0.000377
../requests/packages/urllib3/connectionpool.py:214 HTTPSConnectionPool._get_conn 40 0.000182 0.003277
..ython2.7/site-packages/requests/packages/chardet/euctwprober.py:33 EUCTWProber 91 0.000166 0.000366
..ages/requests/packages/chardet/latin1prober.py:124 Latin1Prober.get_confidence 66 0.000165 0.000212
..-packages/requests/packages/chardet/hebrewprober.py:278 HebrewProber.get_state 66 0.000154 0.000185
...7/site-packages/requests/packages/urllib3/util/selectors.py:38 _fileobj_to_fd 31 0.000152 0.000388
..-packages/requests/packages/urllib3/util/connection.py:7 is_connection_dropped 32 0.000150 0.031954
../python2.7/site-packages/requests/packages/chardet/latin1prober.py:29 <module> 1 0.000149 0.000215
..site-packages/requests/packages/chardet/hebrewprober.py:162 HebrewProber.reset 132 0.000139 0.000139
..es/requests/packages/urllib3/connectionpool.py:67 HTTPSConnectionPool.__init__ 40 0.000128 0.000239
..7/site-packages/requests/packages/urllib3/util/ssl_.py:198 resolve_ssl_version 119 0.000122 0.000122
..ges/requests/packages/chardet/jpcntx.py:169 SJISContextAnalysis.get_confidence 190 0.000112 0.000112
..ackages/requests/packages/urllib3/util/selectors.py:147 EpollSelector.__init__ 31 0.000111 0.000140
..ython2.7/site-packages/requests/packages/urllib3/util/wait.py:29 wait_for_read 31 0.000110 0.031775
..hon2.7/site-packages/requests/packages/chardet/latin1prober.py:97 Latin1Prober 7 0.000107 0.001448
..e-packages/requests/packages/urllib3/util/selectors.py:220 EpollSelector.close 31 0.000100 0.000128
..lib/python2.7/site-packages/requests/packages/chardet/escprober.py:28 <module> 1 0.000098 0.000111
..packages/requests/packages/chardet/jpcntx.py:124 EUCJPContextAnalysis.__init__ 60 0.000093 0.000166
..ackages/requests/packages/urllib3/util/selectors.py:251 EpollSelector.__exit__ 31 0.000091 0.011498
..2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py:222 <genexpr> 118 0.000087 0.000087
..es/requests/packages/urllib3/contrib/pyopenssl.py:378 PyOpenSSLContext.options 119 0.000082 0.000082
../requests/packages/urllib3/util/selectors.py:154 EpollSelector._fileobj_lookup 31 0.000076 0.000464
..lib/python2.7/site-packages/requests/packages/chardet/euctwfreq.py:44 <module> 11 0.000064 0.000064
..requests/packages/urllib3/packages/six.py:184 _SixMetaPathImporter.find_module 74 0.000057 0.000057
..python2.7/site-packages/requests/packages/chardet/charsetprober.py:29 <module> 4 0.000053 0.000058
../python2.7/site-packages/requests/packages/chardet/utf8prober.py:36 UTF8Prober 7 0.000052 0.000217
..ackages/requests/packages/chardet/mbcharsetprober.py:35 MultiByteCharSetProber 43 0.000046 0.000084
..-packages/requests/packages/chardet/jpcntx.py:180 SJISContextAnalysis.__init__ 60 0.000046 0.000046
..ckages/requests/packages/urllib3/contrib/pyopenssl.py:243 WrappedSocket.fileno 11 0.000045 0.000097
..al/lib/python2.7/site-packages/requests/packages/chardet/jpcntx.py:28 <module> 1 0.000044 0.000046
..es/requests/packages/chardet/chardistribution.py:111 EUCTWDistributionAnalysis 31 0.000043 0.000043
..ib/python2.7/site-packages/requests/packages/chardet/big5prober.py:28 <module> 7 0.000041 0.000108
..b/python2.7/site-packages/requests/packages/chardet/cp949prober.py:28 <module> 7 0.000040 0.000108
..2.7/site-packages/requests/packages/chardet/jpcntx.py:206 EUCJPContextAnalysis 8 0.000039 0.000110
..ocal/lib/python2.7/site-packages/requests/cookies.py:71 MockRequest.has_header 12 0.000039 0.000087
..ages/requests/packages/chardet/charsetprober.py:49 HebrewProber.get_confidence 78 0.000039 0.000039
..s/requests/packages/chardet/hebrewprober.py:172 HebrewProber.set_model_probers 66 0.000039 0.000039
..n2.7/site-packages/requests/packages/chardet/charsetgroupprober.py:28 <module> 7 0.000038 0.000086
..hon2.7/site-packages/requests/packages/chardet/gb2312prober.py:33 GB2312Prober 7 0.000034 0.000106
..packages/requests/packages/chardet/charsetgroupprober.py:33 CharSetGroupProber 13 0.000031 0.000046
..ackages/requests/packages/chardet/utf8prober.py:47 UTF8Prober.get_charset_name 54 0.000031 0.000031
../python2.7/site-packages/requests/packages/chardet/sjisprober.py:37 SJISProber 13 0.000030 0.000103
..ckages/requests/packages/chardet/sbcharsetprober.py:44 SingleByteCharSetProber 12 0.000030 0.000040
..ages/requests/packages/urllib3/util/selectors.py:115 _SelectorMapping.__init__ 31 0.000029 0.000029
..n2.7/site-packages/requests/packages/chardet/codingstatemachine.py:28 <module> 2 0.000027 0.000029
..ython2.7/site-packages/requests/packages/chardet/euckrprober.py:34 EUCKRProber 7 0.000026 0.000092
/usr/local/lib/python2.7/site-packages/requests/api.py:99 post 1 0.000025 0.052094
..n2.7/site-packages/requests/packages/chardet/jpcntx.py:179 SJISContextAnalysis 9 0.000024 0.000031
..lib/python2.7/site-packages/requests/packages/chardet/constants.py:29 <module> 7 0.000022 0.000198
..ckages/requests/packages/urllib3/util/selectors.py:248 EpollSelector.__enter__ 31 0.000020 0.000020
..n2.7/site-packages/requests/packages/urllib3/util/retry.py:310 Retry.increment 1 0.000016 0.000022
..b/python2.7/site-packages/requests/packages/chardet/eucjpprober.py:28 <module> 1 0.000015 0.000016
..thon2.7/site-packages/requests/packages/chardet/sbcharsetprober.py:29 <module> 2 0.000013 0.000015
..es/requests/packages/chardet/jpcntx.py:166 SJISContextAnalysis.got_enough_data 10 0.000012 0.000012
..ages/requests/packages/chardet/chardistribution.py:46 CharDistributionAnalysis 7 0.000011 0.000017
../python2.7/site-packages/requests/packages/chardet/hebrewprober.py:28 <module> 1 0.000010 0.000012
..ges/requests/packages/chardet/chardistribution.py:168 Big5DistributionAnalysis 17 0.000010 0.000010
..cal/lib/python2.7/site-packages/requests/packages/chardet/escsm.py:28 <module> 1 0.000010 0.000010
../python2.7/site-packages/requests/packages/chardet/gb2312prober.py:28 <module> 1 0.000010 0.000010
..on2.7/site-packages/requests/cookies.py:81 MockRequest.add_unredirected_header 12 0.000009 0.000009
..thon2.7/site-packages/requests/packages/chardet/mbcharsetprober.py:30 <module> 1 0.000008 0.000009
..b/python2.7/site-packages/requests/packages/chardet/euctwprober.py:28 <module> 1 0.000007 0.000008
..lib/python2.7/site-packages/requests/exceptions.py:17 ConnectionError.__init__ 1 0.000005 0.000006
../local/lib/python2.7/site-packages/requests/exceptions.py:17 SSLError.__init__ 1 0.000005 0.000005
../local/lib/python2.7/site-packages/requests/cookies.py:45 MockRequest.get_type 4 0.000003 0.000003
..ackages/requests/packages/urllib3/util/retry.py:264 Retry._is_connection_error 1 0.000002 0.000003
..on2.7/site-packages/requests/packages/chardet/hebrewprober.py:155 HebrewProber 1 0.000002 0.000002
..site-packages/requests/packages/urllib3/util/retry.py:270 Retry._is_read_error 1 0.000001 0.000002
../python2.7/site-packages/requests/packages/chardet/big5prober.py:34 Big5Prober 1 0.000001 0.000001
..e-packages/requests/packages/chardet/universaldetector.py:44 UniversalDetector 1 0.000001 0.000001
..on2.7/site-packages/requests/packages/chardet/escprober.py:36 EscCharSetProber 1 0.000001 0.000001
..ges/requests/packages/chardet/chardistribution.py:190 SJISDistributionAnalysis 1 0.000001 0.000001
..ython2.7/site-packages/requests/packages/chardet/cp949prober.py:34 CP949Prober 1 0.000001 0.000001
..es/requests/packages/chardet/chardistribution.py:130 EUCKRDistributionAnalysis 1 0.000001 0.000001
``` | {
"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/3917/reactions"
} | https://api.github.com/repos/psf/requests/issues/3917/timeline | null | completed | null | null | false | [
"@fazalmajid So, we call into chardet when you ask us to give unicode data back, and the server hasn't given us an encoding to use. That is, if you call `response.text` and we don't know what encoding to use, we sample the data to try to work out what the correct encoding is.\r\n\r\nYou can circumvent this in two w... |
https://api.github.com/repos/psf/requests/issues/3916 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3916/labels{/name} | https://api.github.com/repos/psf/requests/issues/3916/comments | https://api.github.com/repos/psf/requests/issues/3916/events | https://github.com/psf/requests/issues/3916 | 212,604,758 | MDU6SXNzdWUyMTI2MDQ3NTg= | 3,916 | OS certificate bundles being ignored with Python 2.7 | {
"avatar_url": "https://avatars.githubusercontent.com/u/9018897?v=4",
"events_url": "https://api.github.com/users/jgallucci32/events{/privacy}",
"followers_url": "https://api.github.com/users/jgallucci32/followers",
"following_url": "https://api.github.com/users/jgallucci32/following{/other_user}",
"gists_url": "https://api.github.com/users/jgallucci32/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jgallucci32",
"id": 9018897,
"login": "jgallucci32",
"node_id": "MDQ6VXNlcjkwMTg4OTc=",
"organizations_url": "https://api.github.com/users/jgallucci32/orgs",
"received_events_url": "https://api.github.com/users/jgallucci32/received_events",
"repos_url": "https://api.github.com/users/jgallucci32/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jgallucci32/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jgallucci32/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jgallucci32",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-08T00:46:41Z | 2021-09-08T08:00:30Z | 2017-07-29T23:43:15Z | NONE | resolved | Currently we are using Ansible with Python 2.7 (2.7.5-34) and boto3 (1.4.4-1) to make calls against Eucalyptus using an HTTPS endpoint and some of their modules are failing with the requests modules with boto3 regarding SSL certificates. Here is the environment variables I have tried to set with no success
```
export REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt
export DEFAULT_CA_BUNDLE_PATH=/etc/pki/tls/certs/ca-bundle.crt
export CURL_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt
```
Here is the python error from the Ansible module
```
Traceback (most recent call last):
File "/tmp/ansible_JFwCEJ/ansible_module_iam_server_certificate_facts.py", line 172, in <module>
main()
File "/tmp/ansible_JFwCEJ/ansible_module_iam_server_certificate_facts.py", line 163, in main
results = get_server_certs(iam, cert_name)
File "/tmp/ansible_JFwCEJ/ansible_module_iam_server_certificate_facts.py", line 122, in get_server_certs
server_certs = [iam.get_server_certificate(ServerCertificateName=name)['ServerCertificate']]
File "/usr/lib/python2.7/site-packages/botocore/client.py", line 253, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/lib/python2.7/site-packages/botocore/client.py", line 530, in _make_api_call
operation_model, request_dict)
File "/usr/lib/python2.7/site-packages/botocore/endpoint.py", line 141, in make_request
return self._send_request(request_dict, operation_model)
File "/usr/lib/python2.7/site-packages/botocore/endpoint.py", line 170, in _send_request
success_response, exception):
File "/usr/lib/python2.7/site-packages/botocore/endpoint.py", line 249, in _needs_retry
caught_exception=caught_exception, request_dict=request_dict)
File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 227, in emit
return self._emit(event_name, kwargs)
File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 210, in _emit
response = handler(**kwargs)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 183, in __call__
if self._checker(attempts, response, caught_exception):
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 251, in __call__
caught_exception)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 277, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 317, in __call__
caught_exception)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 223, in __call__
attempt_number, caught_exception)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
botocore.vendored.requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:765)
```
My current workaround to the problem is to replace the default certificate that comes with the requests module with my OS certificates as follows
```
sed -i "s/^DEFAULT_CA_BUNDLE_PATH.*/DEFAULT_CA_BUNDLE_PATH = '\/etc\/pki\/tls\/certs\/ca-bundle.crt'/" /usr/lib/python2.7/site-packages/botocore/vendored/requests/utils.py
``` | {
"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/3916/reactions"
} | https://api.github.com/repos/psf/requests/issues/3916/timeline | null | completed | null | null | false | [
"`REQUESTS_CA_BUNDLE` is a trust bundle we absolutely use. If you have that environment variable and use a simple `requests.get` to the server, does that work? If so, then presumably the calling code has set `trust_env` to `False`, or is explicitly passing a trust bundle that we obey instead of the environment vari... |
https://api.github.com/repos/psf/requests/issues/3915 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3915/labels{/name} | https://api.github.com/repos/psf/requests/issues/3915/comments | https://api.github.com/repos/psf/requests/issues/3915/events | https://github.com/psf/requests/issues/3915 | 212,482,524 | MDU6SXNzdWUyMTI0ODI1MjQ= | 3,915 | Requests follows 301 redirect on PROPFIND request, resubmits request without request body | {
"avatar_url": "https://avatars.githubusercontent.com/u/837573?v=4",
"events_url": "https://api.github.com/users/untitaker/events{/privacy}",
"followers_url": "https://api.github.com/users/untitaker/followers",
"following_url": "https://api.github.com/users/untitaker/following{/other_user}",
"gists_url": "https://api.github.com/users/untitaker/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/untitaker",
"id": 837573,
"login": "untitaker",
"node_id": "MDQ6VXNlcjgzNzU3Mw==",
"organizations_url": "https://api.github.com/users/untitaker/orgs",
"received_events_url": "https://api.github.com/users/untitaker/received_events",
"repos_url": "https://api.github.com/users/untitaker/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/untitaker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/untitaker/subscriptions",
"type": "User",
"url": "https://api.github.com/users/untitaker",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-07T16:20:10Z | 2021-09-08T12:00:47Z | 2017-03-07T16:35:37Z | CONTRIBUTOR | resolved | When submitting a `PROPFIND` request using requests, and the server redirects using 301, the request is resubmitted at the new URL without request payload, but with the same method (so not changing to `GET`). I am not sure if this behavior is intended. You appear to have a few pull requests to match browser behavior in certain situations, but I didn't check whether those PRs have been reverted in the meantime or not. I also couldn't find any documentation about redirect behavior. | {
"avatar_url": "https://avatars.githubusercontent.com/u/837573?v=4",
"events_url": "https://api.github.com/users/untitaker/events{/privacy}",
"followers_url": "https://api.github.com/users/untitaker/followers",
"following_url": "https://api.github.com/users/untitaker/following{/other_user}",
"gists_url": "https://api.github.com/users/untitaker/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/untitaker",
"id": 837573,
"login": "untitaker",
"node_id": "MDQ6VXNlcjgzNzU3Mw==",
"organizations_url": "https://api.github.com/users/untitaker/orgs",
"received_events_url": "https://api.github.com/users/untitaker/received_events",
"repos_url": "https://api.github.com/users/untitaker/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/untitaker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/untitaker/subscriptions",
"type": "User",
"url": "https://api.github.com/users/untitaker",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3915/reactions"
} | https://api.github.com/repos/psf/requests/issues/3915/timeline | null | completed | null | null | false | [
"It appears that https://github.com/kennethreitz/requests/pull/3864 contains a relevant change:\r\n\r\n>Relax how Requests strips bodies from redirects. 3.0.0 only supports body removal on 301/302 POST redirects and all 303 redirects.",
"Closing this since it apparently works as intended, sorry for the noise."
] |
https://api.github.com/repos/psf/requests/issues/3914 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3914/labels{/name} | https://api.github.com/repos/psf/requests/issues/3914/comments | https://api.github.com/repos/psf/requests/issues/3914/events | https://github.com/psf/requests/issues/3914 | 212,454,767 | MDU6SXNzdWUyMTI0NTQ3Njc= | 3,914 | Checks for 'not six.PY3' instead of 'six.PY2' breaks python 4.0 | {
"avatar_url": "https://avatars.githubusercontent.com/u/15009379?v=4",
"events_url": "https://api.github.com/users/stxlvt/events{/privacy}",
"followers_url": "https://api.github.com/users/stxlvt/followers",
"following_url": "https://api.github.com/users/stxlvt/following{/other_user}",
"gists_url": "https://api.github.com/users/stxlvt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/stxlvt",
"id": 15009379,
"login": "stxlvt",
"node_id": "MDQ6VXNlcjE1MDA5Mzc5",
"organizations_url": "https://api.github.com/users/stxlvt/orgs",
"received_events_url": "https://api.github.com/users/stxlvt/received_events",
"repos_url": "https://api.github.com/users/stxlvt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/stxlvt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stxlvt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/stxlvt",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 6 | 2017-03-07T14:51:05Z | 2021-09-08T05:00:46Z | 2017-03-07T14:54:58Z | NONE | resolved | Multiple places in the source code there are checks involving six.PY3, like in [this example](https://github.com/kennethreitz/requests/blob/362da46e9a46da6e86e1907f03014384ab210151/requests/packages/urllib3/fields.py#L43):
if not six.PY3 and isinstance(value, six.text_type): # Python 2:
This will needlessly break on python 4 when it is eventually released. Instead, all checks should generally be on the value of `six.PY2`:
if six.PY2 and isinstance(value, six.text_type): # Python 2:
(I'm not sure that there's any good use at all for the value of `six.PY3`. It seems like it was a mistake by the six developers to include it at all, because it encourages writing code that will break on python 4. Unlike python 3, python 4 will not be backwards incompatible, but simply the version of python after 3.9, IIRC.)
| {
"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/3914/reactions"
} | https://api.github.com/repos/psf/requests/issues/3914/timeline | null | completed | null | null | false | [
"There is absolutely no evidence to say that Python 4 is going to be a thing. The idea that Python rolls over the major version at '10' is not really founded on any evidence at all, and there are counter examples: for example, Python 2.7 did not become Python 2.8 when 2.7.10 was released.\r\n\r\nIn the absence for ... |
https://api.github.com/repos/psf/requests/issues/3913 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3913/labels{/name} | https://api.github.com/repos/psf/requests/issues/3913/comments | https://api.github.com/repos/psf/requests/issues/3913/events | https://github.com/psf/requests/pull/3913 | 212,374,996 | MDExOlB1bGxSZXF1ZXN0MTA5NDM3MzU4 | 3,913 | Add mention to list od tuples as data param. | {
"avatar_url": "https://avatars.githubusercontent.com/u/167327?v=4",
"events_url": "https://api.github.com/users/StyXman/events{/privacy}",
"followers_url": "https://api.github.com/users/StyXman/followers",
"following_url": "https://api.github.com/users/StyXman/following{/other_user}",
"gists_url": "https://api.github.com/users/StyXman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/StyXman",
"id": 167327,
"login": "StyXman",
"node_id": "MDQ6VXNlcjE2NzMyNw==",
"organizations_url": "https://api.github.com/users/StyXman/orgs",
"received_events_url": "https://api.github.com/users/StyXman/received_events",
"repos_url": "https://api.github.com/users/StyXman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/StyXman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/StyXman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/StyXman",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-03-07T09:27:19Z | 2021-09-07T00:06:28Z | 2017-03-07T09:43:27Z | CONTRIBUTOR | resolved | `requests.request` accepts list of tuples in the `data` param, but thereś no mention of it in the 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"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3913/reactions"
} | https://api.github.com/repos/psf/requests/issues/3913/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3913.diff",
"html_url": "https://github.com/psf/requests/pull/3913",
"merged_at": "2017-03-07T09:43:27Z",
"patch_url": "https://github.com/psf/requests/pull/3913.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3913"
} | true | [
"Changed.",
"Cool, this looks good. I'll wait for the build to go green and merge. Thanks so much @StyXman! :sparkles:",
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3913?src=pr&el=h1) Report\n> Merging [#3913](https://codecov.io/gh/kennethreitz/requests/pull/3913?src=pr&el=desc) into [master](... |
https://api.github.com/repos/psf/requests/issues/3912 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3912/labels{/name} | https://api.github.com/repos/psf/requests/issues/3912/comments | https://api.github.com/repos/psf/requests/issues/3912/events | https://github.com/psf/requests/issues/3912 | 212,034,220 | MDU6SXNzdWUyMTIwMzQyMjA= | 3,912 | ResourceWarning: unclosed socket.socket when I run a unittest? | {
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 8 | 2017-03-06T06:25:31Z | 2018-01-03T13:50:35Z | 2017-03-06T08:09:22Z | NONE | off-topic | requests show me following warning when I run a unittest:
```python
ResourceWarning: unclosed <socket.socket fd=5, family=AddressFamily.AF_INET,
type=SocketKind.SOCK_STREAM, proto=6, laddr=('219.82.68.148', 36006), raddr=('125.46.22.55', 80)>
```
But this warning won't happen if I don't run the code in a unittest environment.
Is there somebody who can tell me why this warning happen? | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/3912/reactions"
} | https://api.github.com/repos/psf/requests/issues/3912/timeline | null | completed | null | null | false | [
"This warning happens because Requests uses a keep-alive model that means we try not to explicitly close sockets in many cases. Exactly why this is happening is likely due to you either using a Session object that you don't explicitly close at the end of your test, or using an older version of Requests.",
"@Lukas... |
https://api.github.com/repos/psf/requests/issues/3911 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3911/labels{/name} | https://api.github.com/repos/psf/requests/issues/3911/comments | https://api.github.com/repos/psf/requests/issues/3911/events | https://github.com/psf/requests/pull/3911 | 212,030,540 | MDExOlB1bGxSZXF1ZXN0MTA5MTk0NDEy | 3,911 | Proposed/3.0.0 | {
"avatar_url": "https://avatars.githubusercontent.com/u/23723981?v=4",
"events_url": "https://api.github.com/users/ihhhzk/events{/privacy}",
"followers_url": "https://api.github.com/users/ihhhzk/followers",
"following_url": "https://api.github.com/users/ihhhzk/following{/other_user}",
"gists_url": "https://api.github.com/users/ihhhzk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ihhhzk",
"id": 23723981,
"login": "ihhhzk",
"node_id": "MDQ6VXNlcjIzNzIzOTgx",
"organizations_url": "https://api.github.com/users/ihhhzk/orgs",
"received_events_url": "https://api.github.com/users/ihhhzk/received_events",
"repos_url": "https://api.github.com/users/ihhhzk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ihhhzk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ihhhzk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ihhhzk",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 0 | 2017-03-06T05:56:02Z | 2021-09-07T00:06:28Z | 2017-03-06T08:10:59Z | 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/3911/reactions"
} | https://api.github.com/repos/psf/requests/issues/3911/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3911.diff",
"html_url": "https://github.com/psf/requests/pull/3911",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/3911.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3911"
} | true | [] | |
https://api.github.com/repos/psf/requests/issues/3910 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3910/labels{/name} | https://api.github.com/repos/psf/requests/issues/3910/comments | https://api.github.com/repos/psf/requests/issues/3910/events | https://github.com/psf/requests/issues/3910 | 212,020,264 | MDU6SXNzdWUyMTIwMjAyNjQ= | 3,910 | Failed to establish a new connection: [Errno -4] Non-recoverable error | {
"avatar_url": "https://avatars.githubusercontent.com/u/3444362?v=4",
"events_url": "https://api.github.com/users/ozdanborne/events{/privacy}",
"followers_url": "https://api.github.com/users/ozdanborne/followers",
"following_url": "https://api.github.com/users/ozdanborne/following{/other_user}",
"gists_url": "https://api.github.com/users/ozdanborne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ozdanborne",
"id": 3444362,
"login": "ozdanborne",
"node_id": "MDQ6VXNlcjM0NDQzNjI=",
"organizations_url": "https://api.github.com/users/ozdanborne/orgs",
"received_events_url": "https://api.github.com/users/ozdanborne/received_events",
"repos_url": "https://api.github.com/users/ozdanborne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ozdanborne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ozdanborne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ozdanborne",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-06T04:14:36Z | 2021-09-08T11:00:43Z | 2017-03-08T19:23:28Z | NONE | resolved | Hey there, I'm using requests (2.9.1) to make an https request to a kubernetes apiserver but am hitting an error and would appreciate some debugging tips on how to figure out what is causing it.
The error:
```
Traceback (most recent call last):
File "<string>", line 304, in _manage_resource
File "<string>", line 393, in _sync_resources
File "<string>", line 445, in _api_get
File "site-packages/requests/sessions.py", line 480, in get
File "site-packages/requests/sessions.py", line 468, in request
File "site-packages/requests/sessions.py", line 576, in send
File "site-packages/requests/adapters.py", line 437, in send
ConnectionError: HTTPSConnectionPool(host='<hostname redacted>', port=8443): Max retries exceed
ed with url: /api/v1/namespaces (Caused by NewConnectionError('<requests.packages.urllib3.connection.
VerifiedHTTPSConnection object at 0x7f5dfb0e5290>: Failed to establish a new connection: [Errno -4] N
on-recoverable error',))
```
I'm using requests 2.9.1 but have seen the same using latest.
I've tried turning up logging for `requests.packages.urllib3` but I'm not seeing any useful messages besides a generic: `INFO Starting new HTTPS connection (1): <hostname redacted>`
I've tried inserting a breakpoint and inspecting the `ConnectionError` but was not able to garner any useful information (though I may have missed something).
This may be my own lack of knowledge, but what library can I use to look up what errno -4 is? Google searching for a negative error code is literally impossible.
Thanks for your time! | {
"avatar_url": "https://avatars.githubusercontent.com/u/3444362?v=4",
"events_url": "https://api.github.com/users/ozdanborne/events{/privacy}",
"followers_url": "https://api.github.com/users/ozdanborne/followers",
"following_url": "https://api.github.com/users/ozdanborne/following{/other_user}",
"gists_url": "https://api.github.com/users/ozdanborne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ozdanborne",
"id": 3444362,
"login": "ozdanborne",
"node_id": "MDQ6VXNlcjM0NDQzNjI=",
"organizations_url": "https://api.github.com/users/ozdanborne/orgs",
"received_events_url": "https://api.github.com/users/ozdanborne/received_events",
"repos_url": "https://api.github.com/users/ozdanborne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ozdanborne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ozdanborne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ozdanborne",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3910/reactions"
} | https://api.github.com/repos/psf/requests/issues/3910/timeline | null | completed | null | null | false | [
"Hrm, that's odd: on most Unices errno is restrained to a positive number. What platform are you on? Even that error message is unusual.\r\n\r\nDoes this happen consistently?",
"Made it to the bottom of this. It was running in an alpine:3.3 docker container which, turns out, has a DNS resolving issue for FQDN's w... |
https://api.github.com/repos/psf/requests/issues/3909 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3909/labels{/name} | https://api.github.com/repos/psf/requests/issues/3909/comments | https://api.github.com/repos/psf/requests/issues/3909/events | https://github.com/psf/requests/pull/3909 | 211,884,556 | MDExOlB1bGxSZXF1ZXN0MTA5MTEwMzgz | 3,909 | Update implementation of TimedCache object | {
"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 | 2017-03-04T15:04:57Z | 2021-09-07T00:06:28Z | 2017-03-04T15:27:46Z | CONTRIBUTOR | resolved | There were some odd decisions made about the implementation of some of
the required methods for MuttableMapping in the TimedCache object. This
cleans those up and makes the implementation, ever so slightly, easier
to read.
See also #3885 | {
"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/3909/reactions"
} | https://api.github.com/repos/psf/requests/issues/3909/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3909.diff",
"html_url": "https://github.com/psf/requests/pull/3909",
"merged_at": "2017-03-04T15:27:46Z",
"patch_url": "https://github.com/psf/requests/pull/3909.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3909"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3909?src=pr&el=h1) Report\n> Merging [#3909](https://codecov.io/gh/kennethreitz/requests/pull/3909?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/41a33f2e869e1fdcd88062be469775f613ee8ced?src=pr&el=desc) will **not change... |
https://api.github.com/repos/psf/requests/issues/3908 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3908/labels{/name} | https://api.github.com/repos/psf/requests/issues/3908/comments | https://api.github.com/repos/psf/requests/issues/3908/events | https://github.com/psf/requests/issues/3908 | 211,824,132 | MDU6SXNzdWUyMTE4MjQxMzI= | 3,908 | REQUESTS_CA_BUNDLE does not fall back on system cert chain in Python 3.6? | {
"avatar_url": "https://avatars.githubusercontent.com/u/1542531?v=4",
"events_url": "https://api.github.com/users/dbazile/events{/privacy}",
"followers_url": "https://api.github.com/users/dbazile/followers",
"following_url": "https://api.github.com/users/dbazile/following{/other_user}",
"gists_url": "https://api.github.com/users/dbazile/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dbazile",
"id": 1542531,
"login": "dbazile",
"node_id": "MDQ6VXNlcjE1NDI1MzE=",
"organizations_url": "https://api.github.com/users/dbazile/orgs",
"received_events_url": "https://api.github.com/users/dbazile/received_events",
"repos_url": "https://api.github.com/users/dbazile/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dbazile/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dbazile/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dbazile",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 7 | 2017-03-03T22:54:45Z | 2021-09-08T12:00:48Z | 2017-03-04T21:12:13Z | NONE | resolved | I'm getting SSL validation errors for certificates signed by well-known root CAs when using the `REQUESTS_CA_BUNDLE` environment variable in Python 3.6 from a project that was working in Python 3.5.
My use case is, let's say I have an app that uses requests to talk to both https://localhost:8080 and https://google.com. I use a self-signed certificate for comms with localhost and rely on the system's SSL trust store for the comms with google.
Is anyone else seeing this issue?
## Environment
| | Version |
| ----- | ---- |
| OS | macOS Sierra 10.12.3 |
| OpenSSL | 0.9.8zh (the default one that comes with macOS Sierra) |
| Requests | 2.12.1, 2.13.0 |
| Python | 3.6.0 |
## Steps to Reproduce
```
____ [~/code/_experiments/requests_ca_bundle_problem] ____ $ cat openssl.cnf
[req]
default_bits = 2048
default_md = sha256
default_days = 30
prompt = no
distinguished_name = req_distinguished_name
[req_distinguished_name]
countryName = "US"
stateOrProvinceName = "XX"
localityName = "X"
organizationName= "X"
organizationalUnitName = "X"
commonName = "localhost"
[add_san]
subjectAltName = DNS:localhost
____ [~/code/_experiments/requests_ca_bundle_problem] ____ $ openssl req -x509 -new -nodes -config openssl.cnf -extensions add_san -keyout key.pem -out cert.pem
Generating a 2048 bit RSA private key
.........+++
.................................................+++
writing new private key to 'key.pem'
-----
____ [~/code/_experiments/requests_ca_bundle_problem] ____ $ REQUESTS_CA_BUNDLE=cert.pem python3 -c 'import requests; requests.get("https://google.com")'
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connection.py", line 326, in connect
ssl_context=context)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/util/ssl_.py", line 324, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 808, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 630, in urlopen
raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
``` | {
"avatar_url": "https://avatars.githubusercontent.com/u/1542531?v=4",
"events_url": "https://api.github.com/users/dbazile/events{/privacy}",
"followers_url": "https://api.github.com/users/dbazile/followers",
"following_url": "https://api.github.com/users/dbazile/following{/other_user}",
"gists_url": "https://api.github.com/users/dbazile/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dbazile",
"id": 1542531,
"login": "dbazile",
"node_id": "MDQ6VXNlcjE1NDI1MzE=",
"organizations_url": "https://api.github.com/users/dbazile/orgs",
"received_events_url": "https://api.github.com/users/dbazile/received_events",
"repos_url": "https://api.github.com/users/dbazile/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dbazile/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dbazile/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dbazile",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3908/reactions"
} | https://api.github.com/repos/psf/requests/issues/3908/timeline | null | completed | null | null | false | [
"I don't think you're actually using 0.9.8zh. What's `python3 -c 'import ssl; print(ssl.OPENSSL_VERSION)'` print?\r\n\r\n",
"@Lukasa: Interesting—I'd have thought it's using the system's but apparently it's bundled one.\r\n\r\n```\r\n____ [~] ____ $ openssl version\r\nOpenSSL 0.9.8zh 14 Jan 2016\r\n\r\n____ [~] _... |
https://api.github.com/repos/psf/requests/issues/3907 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3907/labels{/name} | https://api.github.com/repos/psf/requests/issues/3907/comments | https://api.github.com/repos/psf/requests/issues/3907/events | https://github.com/psf/requests/issues/3907 | 211,753,388 | MDU6SXNzdWUyMTE3NTMzODg= | 3,907 | requests.get on image url returns 405 (the image url works in browser) | {
"avatar_url": "https://avatars.githubusercontent.com/u/1035294?v=4",
"events_url": "https://api.github.com/users/fabiocaccamo/events{/privacy}",
"followers_url": "https://api.github.com/users/fabiocaccamo/followers",
"following_url": "https://api.github.com/users/fabiocaccamo/following{/other_user}",
"gists_url": "https://api.github.com/users/fabiocaccamo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/fabiocaccamo",
"id": 1035294,
"login": "fabiocaccamo",
"node_id": "MDQ6VXNlcjEwMzUyOTQ=",
"organizations_url": "https://api.github.com/users/fabiocaccamo/orgs",
"received_events_url": "https://api.github.com/users/fabiocaccamo/received_events",
"repos_url": "https://api.github.com/users/fabiocaccamo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/fabiocaccamo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/fabiocaccamo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/fabiocaccamo",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-03-03T17:34:49Z | 2021-09-08T12:00:48Z | 2017-03-03T22:22:21Z | NONE | resolved | Unfortunately I cannot provide the image url, maybe this can help: https://github.com/thumbor/thumbor/pull/342/files | {
"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/3907/reactions"
} | https://api.github.com/repos/psf/requests/issues/3907/timeline | null | completed | null | null | false | [
"405 means method unsupported. Are you sure you're doing a GET?",
"sure :)",
"Well in that case, the error is almost certainly not with Requests, and unless you can get us more detail we can't really help you. Sorry! 😟"
] |
https://api.github.com/repos/psf/requests/issues/3906 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3906/labels{/name} | https://api.github.com/repos/psf/requests/issues/3906/comments | https://api.github.com/repos/psf/requests/issues/3906/events | https://github.com/psf/requests/issues/3906 | 211,593,369 | MDU6SXNzdWUyMTE1OTMzNjk= | 3,906 | ('Connection aborted.', OSError(89, 'Function not implemented')) in version 2.13.0 | {
"avatar_url": "https://avatars.githubusercontent.com/u/3293865?v=4",
"events_url": "https://api.github.com/users/programatix/events{/privacy}",
"followers_url": "https://api.github.com/users/programatix/followers",
"following_url": "https://api.github.com/users/programatix/following{/other_user}",
"gists_url": "https://api.github.com/users/programatix/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/programatix",
"id": 3293865,
"login": "programatix",
"node_id": "MDQ6VXNlcjMyOTM4NjU=",
"organizations_url": "https://api.github.com/users/programatix/orgs",
"received_events_url": "https://api.github.com/users/programatix/received_events",
"repos_url": "https://api.github.com/users/programatix/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/programatix/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/programatix/subscriptions",
"type": "User",
"url": "https://api.github.com/users/programatix",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 12 | 2017-03-03T04:34:33Z | 2021-09-08T12:00:47Z | 2017-03-04T14:52:06Z | NONE | resolved | Version 2.13.0 request.get() function thrown an exception with the message,
`('Connection aborted.', OSError(89, 'Function not implemented'))`
Reverting to version 2.12.5/4 resolved the issue.
Python Version: 3.5.2
OS: entware ng on asuswrt | {
"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/3906/reactions"
} | https://api.github.com/repos/psf/requests/issues/3906/timeline | null | completed | null | null | false | [
"Could you provide a full traceback? Or some kind of reproduction code? Are you running with gevent/eventlet? Do you have PyOpenSSL installed?\r\n\r\nI have a theory, and my theory is that the Python you have on entware-ng is exposing one of the more complex selector syscalls (hard to know which because I can't see... |
https://api.github.com/repos/psf/requests/issues/3905 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3905/labels{/name} | https://api.github.com/repos/psf/requests/issues/3905/comments | https://api.github.com/repos/psf/requests/issues/3905/events | https://github.com/psf/requests/issues/3905 | 211,299,799 | MDU6SXNzdWUyMTEyOTk3OTk= | 3,905 | How to retry streaming uploads | {
"avatar_url": "https://avatars.githubusercontent.com/u/515021?v=4",
"events_url": "https://api.github.com/users/theyoprst/events{/privacy}",
"followers_url": "https://api.github.com/users/theyoprst/followers",
"following_url": "https://api.github.com/users/theyoprst/following{/other_user}",
"gists_url": "https://api.github.com/users/theyoprst/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/theyoprst",
"id": 515021,
"login": "theyoprst",
"node_id": "MDQ6VXNlcjUxNTAyMQ==",
"organizations_url": "https://api.github.com/users/theyoprst/orgs",
"received_events_url": "https://api.github.com/users/theyoprst/received_events",
"repos_url": "https://api.github.com/users/theyoprst/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/theyoprst/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/theyoprst/subscriptions",
"type": "User",
"url": "https://api.github.com/users/theyoprst",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-03-02T06:17:44Z | 2021-09-08T12:00:49Z | 2017-03-02T06:52:45Z | NONE | resolved | Consider this piece of code:
```python
retries = Retry(total=3)
session = requests.Session()
session.mount('http://', HTTPAdapter(max_retries=retries))
with open('big_file.txt', 'rb') as f:
session.put(url, data=f)
```
It has a bug.
When network error occurred during transmission of the file, the corresponding file handle points to some position _inside_ the file. So the next retry performs new HTTP connection which uploads _the rest_ of the file. Thankfully, in this case, `Content-Length` doesn't change, so the server waits for the rest of data and then disconnects after some timeout.
Here is [the script](https://gist.github.com/theyoprst/df536545e1a4a0f3f21cf584a547a529) which demonstrates this bug. And here is [it's output](https://gist.github.com/theyoprst/7c69d019457d89310f16707e979c1580).
So retries are almost useless for such uploads (they _are_ useful in case of connection problems, though).
Now I can only think of external retrying by manual reopening / re-seeking of the file.
Is there any way to make requests to retry it 'right'?
Should this behavior be fixed in requests?
| {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3905/reactions"
} | https://api.github.com/repos/psf/requests/issues/3905/timeline | null | completed | null | null | false | [
"Wow. It seems in the latest version it was already fixed.\r\nProbably here: https://github.com/shazow/urllib3/issues/459\r\n",
"Hey @theyoprst, you're correct, this should have been resolved in urllib3 in shazow/urllib3#1039. Are you still experiencing this issue in the latest version of requests?",
"Yep, as i... |
https://api.github.com/repos/psf/requests/issues/3904 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3904/labels{/name} | https://api.github.com/repos/psf/requests/issues/3904/comments | https://api.github.com/repos/psf/requests/issues/3904/events | https://github.com/psf/requests/issues/3904 | 211,201,713 | MDU6SXNzdWUyMTEyMDE3MTM= | 3,904 | Can't use a way to wait until HTML content response is completely saved | {
"avatar_url": "https://avatars.githubusercontent.com/u/100468?v=4",
"events_url": "https://api.github.com/users/brangi/events{/privacy}",
"followers_url": "https://api.github.com/users/brangi/followers",
"following_url": "https://api.github.com/users/brangi/following{/other_user}",
"gists_url": "https://api.github.com/users/brangi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/brangi",
"id": 100468,
"login": "brangi",
"node_id": "MDQ6VXNlcjEwMDQ2OA==",
"organizations_url": "https://api.github.com/users/brangi/orgs",
"received_events_url": "https://api.github.com/users/brangi/received_events",
"repos_url": "https://api.github.com/users/brangi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/brangi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/brangi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/brangi",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 11 | 2017-03-01T20:41:05Z | 2021-08-10T00:54:42Z | 2017-03-02T00:51:39Z | NONE | resolved | I am using requests to create a get request and wanting to display the whole html content:
import requests
```
url = 'http://website.net/thelink'
headers = {"User-agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"}
req = requests.get(url,headers=headers)
```
However when using print, does not output the html correctly in a section:
```
print req.content
<div id='error' class='tabdata'>
Please wait while we validate your browser.
</div>
```
**I have seen this div/tag shown already on the browser and eventually the content displays. What I need is to wait on the get request for a little while and then save the content response. Any ideas how to do that ?** | {
"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/3904/reactions"
} | https://api.github.com/repos/psf/requests/issues/3904/timeline | null | completed | null | null | false | [
"What is the *real* URL you try to access? Please note that Requests does not run JavaScript code that may be included in the page. It is not a web browser!",
"This one **http://bgp.he.net/AS36375**",
"Well, that is some unfriendly service. Using `curl` or `wget` I get a `403 Forbidden`. Only a 'real' browser (... |
https://api.github.com/repos/psf/requests/issues/3903 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3903/labels{/name} | https://api.github.com/repos/psf/requests/issues/3903/comments | https://api.github.com/repos/psf/requests/issues/3903/events | https://github.com/psf/requests/pull/3903 | 211,177,814 | MDExOlB1bGxSZXF1ZXN0MTA4NjA2NzQ3 | 3,903 | fix #3902 Add proposed documentation change for post data | {
"avatar_url": "https://avatars.githubusercontent.com/u/38446?v=4",
"events_url": "https://api.github.com/users/garywu/events{/privacy}",
"followers_url": "https://api.github.com/users/garywu/followers",
"following_url": "https://api.github.com/users/garywu/following{/other_user}",
"gists_url": "https://api.github.com/users/garywu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/garywu",
"id": 38446,
"login": "garywu",
"node_id": "MDQ6VXNlcjM4NDQ2",
"organizations_url": "https://api.github.com/users/garywu/orgs",
"received_events_url": "https://api.github.com/users/garywu/received_events",
"repos_url": "https://api.github.com/users/garywu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/garywu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/garywu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/garywu",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 4 | 2017-03-01T19:07:25Z | 2021-09-06T00:06:50Z | 2017-05-27T21:25:48Z | 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/3903/reactions"
} | https://api.github.com/repos/psf/requests/issues/3903/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3903.diff",
"html_url": "https://github.com/psf/requests/pull/3903",
"merged_at": "2017-05-27T21:25:48Z",
"patch_url": "https://github.com/psf/requests/pull/3903.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3903"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3903?src=pr&el=h1) Report\n> Merging [#3903](https://codecov.io/gh/kennethreitz/requests/pull/3903?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/3f3df8b5ffbbd617a32a9b01503f02e30a0818ee?src=pr&el=desc) will **increase**... | |
https://api.github.com/repos/psf/requests/issues/3902 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3902/labels{/name} | https://api.github.com/repos/psf/requests/issues/3902/comments | https://api.github.com/repos/psf/requests/issues/3902/events | https://github.com/psf/requests/issues/3902 | 211,176,392 | MDU6SXNzdWUyMTExNzYzOTI= | 3,902 | Propose additional documentation for post data | {
"avatar_url": "https://avatars.githubusercontent.com/u/38446?v=4",
"events_url": "https://api.github.com/users/garywu/events{/privacy}",
"followers_url": "https://api.github.com/users/garywu/followers",
"following_url": "https://api.github.com/users/garywu/following{/other_user}",
"gists_url": "https://api.github.com/users/garywu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/garywu",
"id": 38446,
"login": "garywu",
"node_id": "MDQ6VXNlcjM4NDQ2",
"organizations_url": "https://api.github.com/users/garywu/orgs",
"received_events_url": "https://api.github.com/users/garywu/received_events",
"repos_url": "https://api.github.com/users/garywu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/garywu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/garywu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/garywu",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 4 | 2017-03-01T19:02:06Z | 2021-09-08T09:00:52Z | 2017-05-27T21:25:49Z | CONTRIBUTOR | resolved | ## Problem statement
Current documentation only specifies the most common case of post data - a dictionary. The code in fact supports other forms of post data which is not documented. Propose to enhance the quick start section that deals with post data to include examples of other uses.
Section of text in the current documentation: [More complicated POST requests](http://docs.python-requests.org/en/master/user/quickstart/#more-complicated-post-requests)
## Questions in the wild indicating the need for more documentation in this regard
On stockoverflow:
* [how to post multiple value with same key in python requests?](http://stackoverflow.com/questions/23384230/how-to-post-multiple-value-with-same-key-in-python-requests)
* [handling duplicate keys in HTTP post in order to specify multiple values](
http://stackoverflow.com/questions/27116424/handling-duplicate-keys-in-http-post-in-order-to-specify-multiple-values)
* [How to send multiple of the same key/parameter via POST?](
http://stackoverflow.com/questions/19004403/how-to-send-multiple-of-the-same-key-parameter-via-post)
* [How to send an array using requests.post (Python)? “Value Error: Too many values to unpack”](
http://stackoverflow.com/questions/31168819/how-to-send-an-array-using-requests-post-python-value-error-too-many-values/35534695)
And there is this issue #1641: Cannot send Single Key, Multiple value data in post because of the use of pythons dict.
## Proposed modification:
```rst
You can also pass a list of tuples to the ``data`` argument. This is particularly
useful when the form has multiple elements that use the same key::
>>> payload = (('key1', 'value1'), ('key1', 'value2'))
>>> r = requests.post('http://httpbin.org/post', data=payload)
>>> print(r.text)
{
...
"form": {
"key1": [
"value1",
"value2"
]
},
...
}
Value of each payload element can be a scalar or an iterable::
>>> payload = (('key1', ('value1', 1, (1, 2))), {'key2', ('value2', 2)})
>>> r = requests.post('http://httpbin.org/post', data=payload)
>>> print(r.text)
{
...
"form": {
"key1": [
"value1",
"1",
"1",
"2"
],
"key2": [
"value2",
"2"
]
},
...
}
``` | {
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3902/reactions"
} | https://api.github.com/repos/psf/requests/issues/3902/timeline | null | completed | null | null | false | [
"I am not sure if the use of httpbin is very helpful here. A reader who is not familiar with this service will wonder how the JSON response is produced. It would be more helpful to show the acual *request* body, not how some service interprets it.",
"Thanks for the comment, I'm simply following the existing docum... |
https://api.github.com/repos/psf/requests/issues/3901 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3901/labels{/name} | https://api.github.com/repos/psf/requests/issues/3901/comments | https://api.github.com/repos/psf/requests/issues/3901/events | https://github.com/psf/requests/pull/3901 | 211,173,715 | MDExOlB1bGxSZXF1ZXN0MTA4NjAzNzgy | 3,901 | Smaller logo | {
"avatar_url": "https://avatars.githubusercontent.com/u/23789?v=4",
"events_url": "https://api.github.com/users/nedbat/events{/privacy}",
"followers_url": "https://api.github.com/users/nedbat/followers",
"following_url": "https://api.github.com/users/nedbat/following{/other_user}",
"gists_url": "https://api.github.com/users/nedbat/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nedbat",
"id": 23789,
"login": "nedbat",
"node_id": "MDQ6VXNlcjIzNzg5",
"organizations_url": "https://api.github.com/users/nedbat/orgs",
"received_events_url": "https://api.github.com/users/nedbat/received_events",
"repos_url": "https://api.github.com/users/nedbat/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nedbat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nedbat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nedbat",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-03-01T18:51:54Z | 2021-09-07T00:06:30Z | 2017-03-01T20:05:14Z | CONTRIBUTOR | resolved | The logo as-is is too large, it won't even fit on my screen!
I made a smaller version for use in the README.rst, because GitHub has neutered some useful features and doesn't care: https://github.com/github/markup/issues/295
NOTE: the image path is to my fork. Once merged, the path should be changed to refer to the main repo. | {
"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/3901/reactions"
} | https://api.github.com/repos/psf/requests/issues/3901/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3901.diff",
"html_url": "https://github.com/psf/requests/pull/3901",
"merged_at": "2017-03-01T20:05:14Z",
"patch_url": "https://github.com/psf/requests/pull/3901.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3901"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3901?src=pr&el=h1) Report\n> Merging [#3901](https://codecov.io/gh/kennethreitz/requests/pull/3901?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/3f3df8b5ffbbd617a32a9b01503f02e30a0818ee?src=pr&el=desc) will **increase**... |
https://api.github.com/repos/psf/requests/issues/3900 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3900/labels{/name} | https://api.github.com/repos/psf/requests/issues/3900/comments | https://api.github.com/repos/psf/requests/issues/3900/events | https://github.com/psf/requests/pull/3900 | 211,106,362 | MDExOlB1bGxSZXF1ZXN0MTA4NTU1Mzgy | 3,900 | fixed #3894 by mentioning form-encoding of dict | {
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2017-03-01T15:00:40Z | 2017-03-01T15:30:37Z | 2017-03-01T15:30:37Z | NONE | null | The optional `data` parameter will be form-encoded, if a dictionary is provided. | {
"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/3900/reactions"
} | https://api.github.com/repos/psf/requests/issues/3900/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3900.diff",
"html_url": "https://github.com/psf/requests/pull/3900",
"merged_at": "2017-03-01T15:30:37Z",
"patch_url": "https://github.com/psf/requests/pull/3900.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3900"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3900?src=pr&el=h1) Report\n> Merging [#3900](https://codecov.io/gh/kennethreitz/requests/pull/3900?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/2aaf6ac03862d29ef8664aa8650a3c34ac4a0b2d?src=pr&el=desc) will **not change... |
https://api.github.com/repos/psf/requests/issues/3899 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3899/labels{/name} | https://api.github.com/repos/psf/requests/issues/3899/comments | https://api.github.com/repos/psf/requests/issues/3899/events | https://github.com/psf/requests/issues/3899 | 210,935,757 | MDU6SXNzdWUyMTA5MzU3NTc= | 3,899 | URL params with special chars fail | {
"avatar_url": "https://avatars.githubusercontent.com/u/436835?v=4",
"events_url": "https://api.github.com/users/ogonbat/events{/privacy}",
"followers_url": "https://api.github.com/users/ogonbat/followers",
"following_url": "https://api.github.com/users/ogonbat/following{/other_user}",
"gists_url": "https://api.github.com/users/ogonbat/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ogonbat",
"id": 436835,
"login": "ogonbat",
"node_id": "MDQ6VXNlcjQzNjgzNQ==",
"organizations_url": "https://api.github.com/users/ogonbat/orgs",
"received_events_url": "https://api.github.com/users/ogonbat/received_events",
"repos_url": "https://api.github.com/users/ogonbat/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ogonbat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ogonbat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ogonbat",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 5 | 2017-02-28T23:36:14Z | 2021-09-08T12:00:50Z | 2017-03-01T08:23:34Z | NONE | resolved | Hi all
i have to open this link
http://www.mytest.com/rest?api_key=username:password
i do a post or a get call
```
host= "http://www.mytest.com/rest"
queryParams = {"api_key" : "{}:{}".format(username, password)}
requests.post(host, params=queryString)
```
and the server return 500 error, this is because the requests send that call
http://www.mytest.com/rest?api_key=username%3Apassword
and is not correct
have some solution?
thanks in advance for your help
| {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3899/reactions"
} | https://api.github.com/repos/psf/requests/issues/3899/timeline | null | completed | null | null | false | [
"I believe the only solution at this time is to drop the params keyword argument and just use a plain old string.\r\n\r\n```python\r\nrequests.post('{0}?api_key={1}:{2}'.format(host, username, password))\r\n```",
"Your query parameter `api_key` will be URL encoded as `api_key?username%3Apassword` by requests. Th... |
https://api.github.com/repos/psf/requests/issues/3898 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3898/labels{/name} | https://api.github.com/repos/psf/requests/issues/3898/comments | https://api.github.com/repos/psf/requests/issues/3898/events | https://github.com/psf/requests/pull/3898 | 210,931,097 | MDExOlB1bGxSZXF1ZXN0MTA4NDMzMDcx | 3,898 | remove redundant exception declaration | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 0 | 2017-02-28T23:11:35Z | 2021-09-07T00:06:29Z | 2017-03-02T14:41:18Z | MEMBER | resolved | Looks like a duplicate copy of this exception was added at some point in a previous merge from master. Preferably hold off on merging this until #3897 is merged to avoid rebasing those commits again. | {
"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/3898/reactions"
} | https://api.github.com/repos/psf/requests/issues/3898/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3898.diff",
"html_url": "https://github.com/psf/requests/pull/3898",
"merged_at": "2017-03-02T14:41:18Z",
"patch_url": "https://github.com/psf/requests/pull/3898.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3898"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/3897 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3897/labels{/name} | https://api.github.com/repos/psf/requests/issues/3897/comments | https://api.github.com/repos/psf/requests/issues/3897/events | https://github.com/psf/requests/pull/3897 | 210,914,110 | MDExOlB1bGxSZXF1ZXN0MTA4NDIwODk1 | 3,897 | Refactor Prepare Body | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 4 | 2017-02-28T21:59:09Z | 2021-09-07T00:06:29Z | 2017-03-02T14:40:58Z | MEMBER | resolved | This PR supersedes #3338 with the branch brought up to date, as well as a few minor changes, including logic tweaks based on updates to `super_len` since the original PR.
This will forcibly prevent the transmission of headers that include both Content-Length and Transfer-Encoding, as well as simplify redundant code we use for both `prepare_content_length` and `prepare_body`. All the credit here goes to @davidsoncasey, the original creator of this PR. | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3897/reactions"
} | https://api.github.com/repos/psf/requests/issues/3897/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3897.diff",
"html_url": "https://github.com/psf/requests/pull/3897",
"merged_at": "2017-03-02T14:40:58Z",
"patch_url": "https://github.com/psf/requests/pull/3897.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3897"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3897?src=pr&el=h1) Report\n> Merging [#3897](https://codecov.io/gh/kennethreitz/requests/pull/3897?src=pr&el=desc) into [proposed/3.0.0](https://codecov.io/gh/kennethreitz/requests/commit/60339d17eede9d424df9ed685ff8d60caeb3a521?src=pr&el=desc) will **in... |
https://api.github.com/repos/psf/requests/issues/3896 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3896/labels{/name} | https://api.github.com/repos/psf/requests/issues/3896/comments | https://api.github.com/repos/psf/requests/issues/3896/events | https://github.com/psf/requests/issues/3896 | 210,840,496 | MDU6SXNzdWUyMTA4NDA0OTY= | 3,896 | PUT'ing files to Azure blob storage... keeps the whole "body?" | {
"avatar_url": "https://avatars.githubusercontent.com/u/2185159?v=4",
"events_url": "https://api.github.com/users/ckcollab/events{/privacy}",
"followers_url": "https://api.github.com/users/ckcollab/followers",
"following_url": "https://api.github.com/users/ckcollab/following{/other_user}",
"gists_url": "https://api.github.com/users/ckcollab/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ckcollab",
"id": 2185159,
"login": "ckcollab",
"node_id": "MDQ6VXNlcjIxODUxNTk=",
"organizations_url": "https://api.github.com/users/ckcollab/orgs",
"received_events_url": "https://api.github.com/users/ckcollab/received_events",
"repos_url": "https://api.github.com/users/ckcollab/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ckcollab/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ckcollab/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ckcollab",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-02-28T16:36:37Z | 2021-09-08T11:00:34Z | 2017-02-28T16:38:17Z | NONE | resolved | Heyo! Thanks so much for requests, I use it all the time and appreciate the effort ya'll put into this!
Anyway, I am having a bit of trouble PUT'ing some files to Azure, for some reason Azure receives the files as:
```
--d21a382fd3cb49f085c89cc5c15e180e
Content-Disposition: form-data; name="file"; filename="stdout.txt"
Content-Type: text/plain
<file data>
--d21a382fd3cb49f085c89cc5c15e180e--
```
Instead of just
```
<file data>
```
For the life of me, I can't figure out *why* it's keeping the headers there and such...
```python
def put_blob(url, file_path):
requests.put(
url,
files={'file': open(file_path, 'rb')},
headers={
'x-ms-blob-type': 'BlockBlob',
}
)
```
| {
"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/3896/reactions"
} | https://api.github.com/repos/psf/requests/issues/3896/timeline | null | completed | null | null | false | [
"Thanks for this report!\r\n\r\nThe `files` parameter uploads the data using `multipart/form-encoded` as the data structure. This is the most common interaction with HTML forms, and is therefore how that works.\r\n\r\nTo upload just the raw file data, pass the file object to the `data` parameter:\r\n\r\n```python\r... |
https://api.github.com/repos/psf/requests/issues/3895 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3895/labels{/name} | https://api.github.com/repos/psf/requests/issues/3895/comments | https://api.github.com/repos/psf/requests/issues/3895/events | https://github.com/psf/requests/issues/3895 | 210,742,658 | MDU6SXNzdWUyMTA3NDI2NTg= | 3,895 | Redirect issue requests not passing proxies through to redirect | {
"avatar_url": "https://avatars.githubusercontent.com/u/4855603?v=4",
"events_url": "https://api.github.com/users/toasteez/events{/privacy}",
"followers_url": "https://api.github.com/users/toasteez/followers",
"following_url": "https://api.github.com/users/toasteez/following{/other_user}",
"gists_url": "https://api.github.com/users/toasteez/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/toasteez",
"id": 4855603,
"login": "toasteez",
"node_id": "MDQ6VXNlcjQ4NTU2MDM=",
"organizations_url": "https://api.github.com/users/toasteez/orgs",
"received_events_url": "https://api.github.com/users/toasteez/received_events",
"repos_url": "https://api.github.com/users/toasteez/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/toasteez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/toasteez/subscriptions",
"type": "User",
"url": "https://api.github.com/users/toasteez",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 24 | 2017-02-28T10:14:22Z | 2021-09-08T12:00:51Z | 2017-02-28T13:39:24Z | NONE | resolved | I'm trying to retrieve data via [Quandl](https://www.quandl.com/) from behind a proxy.
The reason I have dropped into requests is that the Quandl library does not allow a proxy dictionary to be passed.
I can successfully retrieve datasets where there is no redirect however when you try to retrieve a complete database there is a redirect
from https://www.quandl.com/api/v3/databases/CLSM/data?api_key ... (cannot provide my private key)
to - https://quandl-bulk-download.s3.amazonaws.com/CLSM.zip? ..... (Amazon credentials are created here)
**Code**
response = requests.get(url, proxies=proxies, allow_redirects=False) # This lets me see the headers, without failing
response = requests.get(url, proxies=proxies) # This fails OSError: Tunnel connection failed: 407 Proxy Authentication Required
The initial request returns a status 302.
{'X-Runtime': '0.079339', 'X-XSS-Protection': '1; mode=block', 'Connection': 'keep-alive', 'Content-Length': '1059', 'Cache-Control': 'no-cache', 'X-RateLimit-Remaining': '999901', 'Vary': 'Origin', 'X-Content-Type-Options': 'nosniff', 'Location': 'https://quandl-bulk-download.s3.amazonaws.com/CLSM.zip?...SignedHeaders=host&X-Amz-Signature=... , 'X-Frame-Options': 'SAMEORIGIN', 'X-Rack-CORS': 'preflight-hit; no-origin', 'CF-RAY': '...., 'Set-Cookie': '__cfduid=...; expires=Wed, 28-Feb-18 10:00:16 GMT; path=/; domain=.quandl.com; HttpOnly', 'Server': 'cloudflare-nginx', 'Content-Type': 'text/html; charset=utf-8', 'Date': 'Tue, 28 Feb 2017 10:00:17 GMT', 'X-RateLimit-Limit': '1000000', 'X-Request-Id': ...}
Is there still a bug in this area or should I be doing something differently?
Note that IE prompts for download of file and Chrome just works.
**Version**
Python 3.5.2
requests 2.13.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/3895/reactions"
} | https://api.github.com/repos/psf/requests/issues/3895/timeline | null | completed | null | null | false | [
"It seems like your proxy requires that you authorize to it. Do you have credentials for that proxy?",
"The proxy auto authorizes for a simple dataset request via quandl but not for the redirect. I tested this by removing the proxies=proxies (the request fails) witha MaxRetryError: HTTPSConnectionPool(host='www.... |
https://api.github.com/repos/psf/requests/issues/3894 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3894/labels{/name} | https://api.github.com/repos/psf/requests/issues/3894/comments | https://api.github.com/repos/psf/requests/issues/3894/events | https://github.com/psf/requests/issues/3894 | 210,634,502 | MDU6SXNzdWUyMTA2MzQ1MDI= | 3,894 | Documentation issue: requests.request behavior unclear when 'data' parameter is dictionary | {
"avatar_url": "https://avatars.githubusercontent.com/u/3150861?v=4",
"events_url": "https://api.github.com/users/nmusolino/events{/privacy}",
"followers_url": "https://api.github.com/users/nmusolino/followers",
"following_url": "https://api.github.com/users/nmusolino/following{/other_user}",
"gists_url": "https://api.github.com/users/nmusolino/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nmusolino",
"id": 3150861,
"login": "nmusolino",
"node_id": "MDQ6VXNlcjMxNTA4NjE=",
"organizations_url": "https://api.github.com/users/nmusolino/orgs",
"received_events_url": "https://api.github.com/users/nmusolino/received_events",
"repos_url": "https://api.github.com/users/nmusolino/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nmusolino/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nmusolino/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nmusolino",
"user_view_type": "public"
} | [
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
},
{
"color": "fad8c7",
"default": false,
"descrip... | closed | true | null | [] | null | 3 | 2017-02-27T23:00:22Z | 2021-09-08T12:00:50Z | 2017-03-01T15:30:43Z | NONE | resolved | The [documentation for 'requests.request' ](http://docs.python-requests.org/en/master/api/#requests.request) lists a parameter 'data':
> data -- (optional) Dictionary, bytes, or file-like object to send in the body of the Request.
It is unclear what the behavior will be when a dictionary is passed. Since an HTTP request's body is a series of bytes, it is unclear how the library will serialize a dictionary to a series of bytes. For example, will it write the dictionary as JSON, or as XML?
For the other parameter types (bytes or file-like object) I think it is fairly obvious what the behavior will be.
Suggested resolution: the documentation should add a sentence like: "Dictionary objects will be serialized as JSON using the 'json' module", along with any restrictions on the content of the dictionary.
I encountered this when reading the [first section](http://docs.python-requests.org/en/master/user/quickstart/#make-a-request) of the Quickstart guide. | {
"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/3894/reactions"
} | https://api.github.com/repos/psf/requests/issues/3894/timeline | null | completed | null | null | false | [
"> \"Dictionary objects will be serialized as JSON using the 'json' module\", along with any restrictions on the content of the dictionary.\r\n\r\nHeh, the fact that you wrote this suggests that it might be worthwhile, given that that's exactly *not* what we do. Dictionaries are encoded as application/x-www-form-ur... |
https://api.github.com/repos/psf/requests/issues/3893 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3893/labels{/name} | https://api.github.com/repos/psf/requests/issues/3893/comments | https://api.github.com/repos/psf/requests/issues/3893/events | https://github.com/psf/requests/pull/3893 | 210,579,293 | MDExOlB1bGxSZXF1ZXN0MTA4MTgyMDcy | 3,893 | Synced upstream | {
"avatar_url": "https://avatars.githubusercontent.com/u/381707?v=4",
"events_url": "https://api.github.com/users/duriantang/events{/privacy}",
"followers_url": "https://api.github.com/users/duriantang/followers",
"following_url": "https://api.github.com/users/duriantang/following{/other_user}",
"gists_url": "https://api.github.com/users/duriantang/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/duriantang",
"id": 381707,
"login": "duriantang",
"node_id": "MDQ6VXNlcjM4MTcwNw==",
"organizations_url": "https://api.github.com/users/duriantang/orgs",
"received_events_url": "https://api.github.com/users/duriantang/received_events",
"repos_url": "https://api.github.com/users/duriantang/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/duriantang/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/duriantang/subscriptions",
"type": "User",
"url": "https://api.github.com/users/duriantang",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 0 | 2017-02-27T19:19:14Z | 2021-09-07T00:06:31Z | 2017-02-27T19:19:31Z | NONE | resolved | {
"avatar_url": "https://avatars.githubusercontent.com/u/381707?v=4",
"events_url": "https://api.github.com/users/duriantang/events{/privacy}",
"followers_url": "https://api.github.com/users/duriantang/followers",
"following_url": "https://api.github.com/users/duriantang/following{/other_user}",
"gists_url": "https://api.github.com/users/duriantang/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/duriantang",
"id": 381707,
"login": "duriantang",
"node_id": "MDQ6VXNlcjM4MTcwNw==",
"organizations_url": "https://api.github.com/users/duriantang/orgs",
"received_events_url": "https://api.github.com/users/duriantang/received_events",
"repos_url": "https://api.github.com/users/duriantang/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/duriantang/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/duriantang/subscriptions",
"type": "User",
"url": "https://api.github.com/users/duriantang",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3893/reactions"
} | https://api.github.com/repos/psf/requests/issues/3893/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3893.diff",
"html_url": "https://github.com/psf/requests/pull/3893",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/3893.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3893"
} | true | [] | |
https://api.github.com/repos/psf/requests/issues/3892 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3892/labels{/name} | https://api.github.com/repos/psf/requests/issues/3892/comments | https://api.github.com/repos/psf/requests/issues/3892/events | https://github.com/psf/requests/pull/3892 | 210,337,817 | MDExOlB1bGxSZXF1ZXN0MTA4MDE1OTI4 | 3,892 | Fixed some typos | {
"avatar_url": "https://avatars.githubusercontent.com/u/26013757?v=4",
"events_url": "https://api.github.com/users/vpfautz/events{/privacy}",
"followers_url": "https://api.github.com/users/vpfautz/followers",
"following_url": "https://api.github.com/users/vpfautz/following{/other_user}",
"gists_url": "https://api.github.com/users/vpfautz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/vpfautz",
"id": 26013757,
"login": "vpfautz",
"node_id": "MDQ6VXNlcjI2MDEzNzU3",
"organizations_url": "https://api.github.com/users/vpfautz/orgs",
"received_events_url": "https://api.github.com/users/vpfautz/received_events",
"repos_url": "https://api.github.com/users/vpfautz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/vpfautz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vpfautz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/vpfautz",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-02-26T18:36:43Z | 2021-09-07T00:06:31Z | 2017-02-27T16:25:10Z | CONTRIBUTOR | resolved | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3892/reactions"
} | https://api.github.com/repos/psf/requests/issues/3892/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3892.diff",
"html_url": "https://github.com/psf/requests/pull/3892",
"merged_at": "2017-02-27T16:25:10Z",
"patch_url": "https://github.com/psf/requests/pull/3892.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3892"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3892?src=pr&el=h1) Report\n> Merging [#3892](https://codecov.io/gh/kennethreitz/requests/pull/3892?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/d6f4818c0b40bc6c00433c013b7daaea83b2cd51?src=pr&el=desc) will **increase**... | |
https://api.github.com/repos/psf/requests/issues/3891 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3891/labels{/name} | https://api.github.com/repos/psf/requests/issues/3891/comments | https://api.github.com/repos/psf/requests/issues/3891/events | https://github.com/psf/requests/issues/3891 | 210,312,518 | MDU6SXNzdWUyMTAzMTI1MTg= | 3,891 | Requests fails to handle amazon.com cookies | {
"avatar_url": "https://avatars.githubusercontent.com/u/1310872?v=4",
"events_url": "https://api.github.com/users/ddevault/events{/privacy}",
"followers_url": "https://api.github.com/users/ddevault/followers",
"following_url": "https://api.github.com/users/ddevault/following{/other_user}",
"gists_url": "https://api.github.com/users/ddevault/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ddevault",
"id": 1310872,
"login": "ddevault",
"node_id": "MDQ6VXNlcjEzMTA4NzI=",
"organizations_url": "https://api.github.com/users/ddevault/orgs",
"received_events_url": "https://api.github.com/users/ddevault/received_events",
"repos_url": "https://api.github.com/users/ddevault/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ddevault/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ddevault/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ddevault",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 7 | 2017-02-26T11:51:07Z | 2021-09-08T12:00:52Z | 2017-02-26T14:09:14Z | NONE | resolved | ```python
import requests
>>> r = requests.get("https://www.amazon.com/ap/signin?openid.assoc_handle=usflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0")
>>> r.cookies
<RequestsCookieJar[]>
>>> r.headers["Set-Cookie"]
'ap-fid=""; Domain=.amazon.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ap/; Secure, a-ogbcbff=deleted; Domain=.amazon.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, x-main=""; Domain=.www.amazon.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure, session-id=""; Domain=.www.amazon.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure, session-token=""; Domain=.www.amazon.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure, session-id-time=""; Domain=.www.amazon.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure, ubid-main=""; Domain=.www.amazon.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure, at-main=""; Domain=.www.amazon.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure, sess-at-main=""; Domain=.www.amazon.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure'
``` | {
"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/3891/reactions"
} | https://api.github.com/repos/psf/requests/issues/3891/timeline | null | completed | null | null | false | [
"We're handling them fine: those cookies are all set to expire in the past, which is how you ask a user agent to delete them. What problem are you actually having?",
"Hmm, good catch. When you turn around and submit the login form on this page, the response from Amazon is a page asking you to enable cookies.",
... |
https://api.github.com/repos/psf/requests/issues/3890 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3890/labels{/name} | https://api.github.com/repos/psf/requests/issues/3890/comments | https://api.github.com/repos/psf/requests/issues/3890/events | https://github.com/psf/requests/issues/3890 | 210,148,893 | MDU6SXNzdWUyMTAxNDg4OTM= | 3,890 | Starts using socks proxy after socks.wrapmodule(smtplib) | {
"avatar_url": "https://avatars.githubusercontent.com/u/241185?v=4",
"events_url": "https://api.github.com/users/rvernica/events{/privacy}",
"followers_url": "https://api.github.com/users/rvernica/followers",
"following_url": "https://api.github.com/users/rvernica/following{/other_user}",
"gists_url": "https://api.github.com/users/rvernica/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rvernica",
"id": 241185,
"login": "rvernica",
"node_id": "MDQ6VXNlcjI0MTE4NQ==",
"organizations_url": "https://api.github.com/users/rvernica/orgs",
"received_events_url": "https://api.github.com/users/rvernica/received_events",
"repos_url": "https://api.github.com/users/rvernica/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rvernica/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rvernica/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rvernica",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 6 | 2017-02-24T20:23:16Z | 2021-01-09T20:42:01Z | 2017-02-24T21:22:30Z | NONE | resolved | On one hand, I am using `requests` to access a web service in the local network. On the other hand, I access a SMTP server outside the network through a proxy. Once I do `socks.wrapmodule(smtplib)`, `requests` starts using the proxy as well. Here is an example:
```
> python
Python 2.7.13 (default, Jan 13 2017, 10:15:16)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.get('http://127.0.0.1:8000')
<Response [400]>
>>> import socks
>>> socks.setdefaultproxy(socks.PROXY_TYPE_HTTP, '...', 8088)
>>> requests.get('http://127.0.0.1:8000')
<Response [400]>
>>> import smtplib
>>> socks.wrapmodule(smtplib)
>>> requests.get('http://127.0.0.1:8000')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vernica/.local/lib/python2.7/site-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/home/vernica/.local/lib/python2.7/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/home/vernica/.local/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/home/vernica/.local/lib/python2.7/site-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/home/vernica/.local/lib/python2.7/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/home/vernica/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 595, in urlopen
chunked=chunked)
File "/home/vernica/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 363, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib64/python2.7/httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python2.7/httplib.py", line 1082, in _send_request
self.endheaders(body)
File "/usr/lib64/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 844, in send
self.connect()
File "/home/vernica/.local/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 167, in connect
conn = self._new_conn()
File "/home/vernica/.local/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 142, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/home/vernica/.local/lib/python2.7/site-packages/requests/packages/urllib3/util/connection.py", line 88, in create_connection
sock.connect(sa)
File "/home/vernica/.local/lib/python2.7/site-packages/socks.py", line 780, in connect
negotiate(self, dest_addr, dest_port)
File "/home/vernica/.local/lib/python2.7/site-packages/socks.py", line 700, in _negotiate_HTTP
raise HTTPError(error)
socks.HTTPError: 503: Service Unavailable
>>> requests.__version__
'2.11.1'
>>> socks.__version__
'1.6.4'
``` | {
"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/3890/reactions"
} | https://api.github.com/repos/psf/requests/issues/3890/timeline | null | completed | null | null | false | [
"If you use socks.wrapmodule then a whole bunch of monkey patching will take place. It is clearly not safe to monkeypatch smtplib, because those monkeypatches end up affecting the socket module, and thus requests. \r\n\r\nYou should look for an smtp module that can use SOCKS directly, or move the SMTP code out of t... |
https://api.github.com/repos/psf/requests/issues/3889 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3889/labels{/name} | https://api.github.com/repos/psf/requests/issues/3889/comments | https://api.github.com/repos/psf/requests/issues/3889/events | https://github.com/psf/requests/issues/3889 | 210,137,969 | MDU6SXNzdWUyMTAxMzc5Njk= | 3,889 | wrong ecxeption? return code wrong? | {
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-02-24T19:33:54Z | 2021-09-08T12:00:53Z | 2017-02-24T20:14:30Z | NONE | resolved | Dear everyone!
i am facing strange beahvior with python requests.
here is my snippet:
```
for x in range(0,len(url)):
retrys = 0
while retrys < 10 :
try:
res = requests.get(
url[x],
timeout=(5, 60),
proxies=dict( http='socks5://localhost:' + str(s_port),
https='socks5://localhost:' + str(s_port)
)
)
except requests.exceptions.RequestException as err:
print( str(res.status_code) )
print( str(len(res.content)) )
retrys += 1
time.sleep(1)
if retrys % 5 == 0 :
print( str( threading.currentThread() ) + " - Querry failed? -> Need to reconnect TOR")
import pdb; pdb.set_trace()
print( str( threading.currentThread() ) )
else:
if isinstance(res.content, bytes) == True:
output.append( res.content )
break
else:
import pdb; pdb.set_trace()
```
it is giving my the right output look:
```
We are fetching now : 178 urls in : 26 Blobs
200
26943
200
26943
200
26943
200
26943
200
26943
```
So statuscode is all the time 200 OK and the len is okay. When i drop to my debug console i can catch the content from result, parse json, as ecxpected. But my requsts is still ecxepting my function. err is telling me inside ecxeption that connection has been refused.
(Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused',))",),)
Any thoughts?
EDIT: it is a tor proxy.
| null | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3889/reactions"
} | https://api.github.com/repos/psf/requests/issues/3889/timeline | null | completed | null | null | false | [
"close -> stupid!"
] |
https://api.github.com/repos/psf/requests/issues/3888 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3888/labels{/name} | https://api.github.com/repos/psf/requests/issues/3888/comments | https://api.github.com/repos/psf/requests/issues/3888/events | https://github.com/psf/requests/issues/3888 | 210,107,706 | MDU6SXNzdWUyMTAxMDc3MDY= | 3,888 | Non-ascii (iso-8859-1) location headers are handled incorrectly on handling a redirect | {
"avatar_url": "https://avatars.githubusercontent.com/u/6267837?v=4",
"events_url": "https://api.github.com/users/atleta/events{/privacy}",
"followers_url": "https://api.github.com/users/atleta/followers",
"following_url": "https://api.github.com/users/atleta/following{/other_user}",
"gists_url": "https://api.github.com/users/atleta/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/atleta",
"id": 6267837,
"login": "atleta",
"node_id": "MDQ6VXNlcjYyNjc4Mzc=",
"organizations_url": "https://api.github.com/users/atleta/orgs",
"received_events_url": "https://api.github.com/users/atleta/received_events",
"repos_url": "https://api.github.com/users/atleta/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/atleta/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/atleta/subscriptions",
"type": "User",
"url": "https://api.github.com/users/atleta",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 12 | 2017-02-24T17:21:57Z | 2021-09-08T11:00:32Z | 2017-04-19T16:28:20Z | NONE | resolved | Hi,
Akkording to the RFC (2616, https://www.ietf.org/rfc/rfc2616.txt) the location header MAY contain non-ascii characters if encoded with iso-8859-1. However, this case is handled incorrectly by requests.
httplib will correctly parse the header as iso-8859-1 (see parse_headers in http/client.py, around line 214 for python 3.5), but the resulting string, when following the redirect, is quoted without specifying an encoding by requests (see requote_uri in requests/utils.py):
```
def requote_uri(uri):
"""Re-quote the given URI.
This function passes the given URI through an unquote/quote cycle to
ensure that it is fully and consistently quoted.
:rtype: str
"""
safe_with_percent = "!#$%&'()*+,/:;=?@[]~"
safe_without_percent = "!#$&'()*+,/:;=?@[]~"
try:
# Unquote only the unreserved characters
# Then quote only illegal characters (do not quote reserved,
# unreserved, or '%')
print('Yo')
return quote(unquote_unreserved(uri), safe=safe_with_percent)
except InvalidURL:
# We couldn't unquote the given URI, so let's try quoting it, but
# there may be unquoted '%'s in the URI. We need to make sure they're
# properly quoted so they do not cause issues elsewhere.
return quote(uri, safe=safe_without_percent)
```
The calls to quote should have ```encoding='iso-8859-1'``` as a parameter otherwise quote will assume utf-8 and that will result in a wrong url. I.e.:
```
return quote(unquote_unreserved(uri), encoding='iso-8859-1', safe=safe_with_percent)
```
I have looked into fixing it, which I'm willing to do, but not 100% sure where to add the test. My best guess is doing it in test_lowlevel.py using the test_server (httpbin can't be used for this as it quotes the non-ascii characters). | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3888/reactions"
} | https://api.github.com/repos/psf/requests/issues/3888/timeline | null | completed | null | null | false | [
"Hi there @atleta,\r\n\r\nFirst, RFC 2616 has been made obsolete by RFCs [7230][], [7231][], [7232][], [7233][], [7234][], and [7235][].\r\n\r\nAs you'll see when you familiarize yourself with those RFCs, the *default* encoding for Headers is no longer ISO-8859-1 (a.k.a., Latin-1).\r\n\r\nI suspect that if you have... |
https://api.github.com/repos/psf/requests/issues/3887 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3887/labels{/name} | https://api.github.com/repos/psf/requests/issues/3887/comments | https://api.github.com/repos/psf/requests/issues/3887/events | https://github.com/psf/requests/issues/3887 | 209,946,210 | MDU6SXNzdWUyMDk5NDYyMTA= | 3,887 | Feature: allow setting of urllib3 backoff_factor | {
"avatar_url": "https://avatars.githubusercontent.com/u/9677399?v=4",
"events_url": "https://api.github.com/users/ofek/events{/privacy}",
"followers_url": "https://api.github.com/users/ofek/followers",
"following_url": "https://api.github.com/users/ofek/following{/other_user}",
"gists_url": "https://api.github.com/users/ofek/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ofek",
"id": 9677399,
"login": "ofek",
"node_id": "MDQ6VXNlcjk2NzczOTk=",
"organizations_url": "https://api.github.com/users/ofek/orgs",
"received_events_url": "https://api.github.com/users/ofek/received_events",
"repos_url": "https://api.github.com/users/ofek/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ofek/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ofek/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ofek",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 10 | 2017-02-24T02:53:04Z | 2021-09-08T10:00:48Z | 2017-02-24T08:38:38Z | CONTRIBUTOR | resolved | Or is it possible now from requests to set [https://github.com/kennethreitz/requests/blob/e3f89bf23c53b98593e4248054661472aacac820/requests/packages/urllib3/util/retry.py#L104](https://github.com/kennethreitz/requests/blob/e3f89bf23c53b98593e4248054661472aacac820/requests/packages/urllib3/util/retry.py#L104)? | {
"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/3887/reactions"
} | https://api.github.com/repos/psf/requests/issues/3887/timeline | null | completed | null | null | false | [
"You can use [Requests Transport Adapters](http://docs.python-requests.org/en/master/user/advanced/#transport-adapters) to do this. You only need to override the `HTTPAdapter.__init__` to set `max_retries` appropriately. Should be pretty easy.",
"@Lukasa No need to override `HTTPAdapter.__init__`, actually as HTT... |
https://api.github.com/repos/psf/requests/issues/3886 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3886/labels{/name} | https://api.github.com/repos/psf/requests/issues/3886/comments | https://api.github.com/repos/psf/requests/issues/3886/events | https://github.com/psf/requests/pull/3886 | 209,542,310 | MDExOlB1bGxSZXF1ZXN0MTA3NDcwODYz | 3,886 | proposed 3.0 - altered internal loops of resolve_redirect | {
"avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4",
"events_url": "https://api.github.com/users/jvanasco/events{/privacy}",
"followers_url": "https://api.github.com/users/jvanasco/followers",
"following_url": "https://api.github.com/users/jvanasco/following{/other_user}",
"gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jvanasco",
"id": 204779,
"login": "jvanasco",
"node_id": "MDQ6VXNlcjIwNDc3OQ==",
"organizations_url": "https://api.github.com/users/jvanasco/orgs",
"received_events_url": "https://api.github.com/users/jvanasco/received_events",
"repos_url": "https://api.github.com/users/jvanasco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jvanasco",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 5 | 2017-02-22T18:37:11Z | 2021-09-07T00:06:31Z | 2017-02-25T15:05:40Z | CONTRIBUTOR | resolved | This is a resubmit of #3871 against the 3.0.0 branch. | {
"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/3886/reactions"
} | https://api.github.com/repos/psf/requests/issues/3886/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3886.diff",
"html_url": "https://github.com/psf/requests/pull/3886",
"merged_at": "2017-02-25T15:05:40Z",
"patch_url": "https://github.com/psf/requests/pull/3886.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3886"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3886?src=pr&el=h1) Report\n> Merging [#3886](https://codecov.io/gh/kennethreitz/requests/pull/3886?src=pr&el=desc) into [proposed/3.0.0](https://codecov.io/gh/kennethreitz/requests/commit/b22833ce2a2c44d9e53f726e10cb3aac08ae49a5?src=pr&el=desc) will **de... |
https://api.github.com/repos/psf/requests/issues/3885 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3885/labels{/name} | https://api.github.com/repos/psf/requests/issues/3885/comments | https://api.github.com/repos/psf/requests/issues/3885/events | https://github.com/psf/requests/pull/3885 | 209,348,653 | MDExOlB1bGxSZXF1ZXN0MTA3MzMyNzE2 | 3,885 | Cache proxy bypass | {
"avatar_url": "https://avatars.githubusercontent.com/u/174527?v=4",
"events_url": "https://api.github.com/users/dfontenot/events{/privacy}",
"followers_url": "https://api.github.com/users/dfontenot/followers",
"following_url": "https://api.github.com/users/dfontenot/following{/other_user}",
"gists_url": "https://api.github.com/users/dfontenot/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dfontenot",
"id": 174527,
"login": "dfontenot",
"node_id": "MDQ6VXNlcjE3NDUyNw==",
"organizations_url": "https://api.github.com/users/dfontenot/orgs",
"received_events_url": "https://api.github.com/users/dfontenot/received_events",
"repos_url": "https://api.github.com/users/dfontenot/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dfontenot/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dfontenot/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dfontenot",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 7 | 2017-02-22T04:21:30Z | 2021-09-07T00:06:29Z | 2017-02-27T08:56:44Z | CONTRIBUTOR | resolved | Added simple cache over `urllib.proxy_bypass` to remedy #2988. Holds on to entries for a minute. Once it reaches its max size, will evict the first entry that is the oldest.
Added tests over the structure, did not add a test that `should_bypass_proxies` invokes the cache.
This is my first pull request; please let me know if I've overlooked something.
Additionally, when I check out master, run `make coverage` in pipenv, the test named 'TestRequests.test_proxy_error' fails. This is still the only failing test when I use my branch. The error is `ConnectionError: ('Connection aborted.', BadStatusLine("''",))`. Is there some additional setup I need to do to run the test suite? | {
"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/3885/reactions"
} | https://api.github.com/repos/psf/requests/issues/3885/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3885.diff",
"html_url": "https://github.com/psf/requests/pull/3885",
"merged_at": "2017-02-27T08:56:44Z",
"patch_url": "https://github.com/psf/requests/pull/3885.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3885"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3885?src=pr&el=h1) Report\n> Merging [#3885](https://codecov.io/gh/kennethreitz/requests/pull/3885?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/d6f4818c0b40bc6c00433c013b7daaea83b2cd51?src=pr&el=desc) will **increase**... |
https://api.github.com/repos/psf/requests/issues/3884 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3884/labels{/name} | https://api.github.com/repos/psf/requests/issues/3884/comments | https://api.github.com/repos/psf/requests/issues/3884/events | https://github.com/psf/requests/pull/3884 | 209,313,168 | MDExOlB1bGxSZXF1ZXN0MTA3MzA4MTg1 | 3,884 | Removed response hook hardcode. | {
"avatar_url": "https://avatars.githubusercontent.com/u/381707?v=4",
"events_url": "https://api.github.com/users/duriantang/events{/privacy}",
"followers_url": "https://api.github.com/users/duriantang/followers",
"following_url": "https://api.github.com/users/duriantang/following{/other_user}",
"gists_url": "https://api.github.com/users/duriantang/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/duriantang",
"id": 381707,
"login": "duriantang",
"node_id": "MDQ6VXNlcjM4MTcwNw==",
"organizations_url": "https://api.github.com/users/duriantang/orgs",
"received_events_url": "https://api.github.com/users/duriantang/received_events",
"repos_url": "https://api.github.com/users/duriantang/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/duriantang/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/duriantang/subscriptions",
"type": "User",
"url": "https://api.github.com/users/duriantang",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-02-22T00:13:03Z | 2021-09-06T00:06:57Z | 2017-05-17T20:18:49Z | NONE | resolved | {
"avatar_url": "https://avatars.githubusercontent.com/u/381707?v=4",
"events_url": "https://api.github.com/users/duriantang/events{/privacy}",
"followers_url": "https://api.github.com/users/duriantang/followers",
"following_url": "https://api.github.com/users/duriantang/following{/other_user}",
"gists_url": "https://api.github.com/users/duriantang/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/duriantang",
"id": 381707,
"login": "duriantang",
"node_id": "MDQ6VXNlcjM4MTcwNw==",
"organizations_url": "https://api.github.com/users/duriantang/orgs",
"received_events_url": "https://api.github.com/users/duriantang/received_events",
"repos_url": "https://api.github.com/users/duriantang/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/duriantang/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/duriantang/subscriptions",
"type": "User",
"url": "https://api.github.com/users/duriantang",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3884/reactions"
} | https://api.github.com/repos/psf/requests/issues/3884/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3884.diff",
"html_url": "https://github.com/psf/requests/pull/3884",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/3884.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3884"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3884?src=pr&el=h1) Report\n> Merging [#3884](https://codecov.io/gh/kennethreitz/requests/pull/3884?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/2aaf6ac03862d29ef8664aa8650a3c34ac4a0b2d?src=pr&el=desc) will **increase**... | |
https://api.github.com/repos/psf/requests/issues/3883 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3883/labels{/name} | https://api.github.com/repos/psf/requests/issues/3883/comments | https://api.github.com/repos/psf/requests/issues/3883/events | https://github.com/psf/requests/issues/3883 | 208,976,056 | MDU6SXNzdWUyMDg5NzYwNTY= | 3,883 | This code generates errors only on Mac OSX | {
"avatar_url": "https://avatars.githubusercontent.com/u/25351176?v=4",
"events_url": "https://api.github.com/users/Matt-1-2-3/events{/privacy}",
"followers_url": "https://api.github.com/users/Matt-1-2-3/followers",
"following_url": "https://api.github.com/users/Matt-1-2-3/following{/other_user}",
"gists_url": "https://api.github.com/users/Matt-1-2-3/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Matt-1-2-3",
"id": 25351176,
"login": "Matt-1-2-3",
"node_id": "MDQ6VXNlcjI1MzUxMTc2",
"organizations_url": "https://api.github.com/users/Matt-1-2-3/orgs",
"received_events_url": "https://api.github.com/users/Matt-1-2-3/received_events",
"repos_url": "https://api.github.com/users/Matt-1-2-3/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Matt-1-2-3/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Matt-1-2-3/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Matt-1-2-3",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 13 | 2017-02-20T20:32:33Z | 2018-10-31T20:35:11Z | 2017-02-20T21:13:13Z | NONE | resolved | When I run the following code in windows 10 and fedora it works without error but on Mac OSX Sierra it throws up errors. Since it only happens on my Mac I am assuming its a bug. I will paste the errors below.
```python
import json
import operator
import requests
url = "https://data.ny.gov/resource/h6w8-42p9.json?$limit=3000"
data = requests.get(url).json()
###################################################
#errors here
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 326, in connect
ssl_context=context)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl_.py", line 324, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 377, in wrap_socket
_context=self)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 752, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 988, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 633, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 54] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 347, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 326, in connect
ssl_context=context)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl_.py", line 324, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 377, in wrap_socket
_context=self)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 752, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 988, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 633, in do_handshake
self._sslobj.do_handshake()
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<input>", line 8, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/adapters.py", line 473, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))
``` | {
"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/3883/reactions"
} | https://api.github.com/repos/psf/requests/issues/3883/timeline | null | completed | null | null | false | [
"Thanks for this report!\r\n\r\nUnfortunately, this issue is caused because the Python versions installed from python.org are linked against the OpenSSL that is shipped by Apple in macOS. This OpenSSL is ancient, and supports almost no modern cipher suites, making it essentially impossible to use securely. This wil... |
https://api.github.com/repos/psf/requests/issues/3882 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3882/labels{/name} | https://api.github.com/repos/psf/requests/issues/3882/comments | https://api.github.com/repos/psf/requests/issues/3882/events | https://github.com/psf/requests/issues/3882 | 208,786,994 | MDU6SXNzdWUyMDg3ODY5OTQ= | 3,882 | HTTPS proxy with requests | {
"avatar_url": "https://avatars.githubusercontent.com/u/7828335?v=4",
"events_url": "https://api.github.com/users/pn1984/events{/privacy}",
"followers_url": "https://api.github.com/users/pn1984/followers",
"following_url": "https://api.github.com/users/pn1984/following{/other_user}",
"gists_url": "https://api.github.com/users/pn1984/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pn1984",
"id": 7828335,
"login": "pn1984",
"node_id": "MDQ6VXNlcjc4MjgzMzU=",
"organizations_url": "https://api.github.com/users/pn1984/orgs",
"received_events_url": "https://api.github.com/users/pn1984/received_events",
"repos_url": "https://api.github.com/users/pn1984/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pn1984/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pn1984/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pn1984",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-02-20T05:26:56Z | 2021-09-08T12:00:54Z | 2017-02-20T08:17:25Z | NONE | resolved | A small (but expanding) set of HTTP clients now offer the ability to connect to proxies over TLS. 'curl' recently added this feature in v7.52.0 (More info. can be found at https://daniel.haxx.se/blog/2016/11/26/https-proxy-with-curl/). Please consider adding support for this feature to 'requests'. | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3882/reactions"
} | https://api.github.com/repos/psf/requests/issues/3882/timeline | null | completed | null | null | false | [
"Hi there, thanks for this request!\n\nAdding support for this feature requires a pretty substantial internal changes to the code logic of our dependencies. This work is ongoing, and when it's done it can be discussed, but for now it's not something we can promise to put on any kind of roadmap.\n\nSorry! :pray: "
] |
https://api.github.com/repos/psf/requests/issues/3881 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3881/labels{/name} | https://api.github.com/repos/psf/requests/issues/3881/comments | https://api.github.com/repos/psf/requests/issues/3881/events | https://github.com/psf/requests/issues/3881 | 208,738,779 | MDU6SXNzdWUyMDg3Mzg3Nzk= | 3,881 | Suggestion: add a new field `method` to `Response` class | {
"avatar_url": "https://avatars.githubusercontent.com/u/90726?v=4",
"events_url": "https://api.github.com/users/nodakai/events{/privacy}",
"followers_url": "https://api.github.com/users/nodakai/followers",
"following_url": "https://api.github.com/users/nodakai/following{/other_user}",
"gists_url": "https://api.github.com/users/nodakai/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nodakai",
"id": 90726,
"login": "nodakai",
"node_id": "MDQ6VXNlcjkwNzI2",
"organizations_url": "https://api.github.com/users/nodakai/orgs",
"received_events_url": "https://api.github.com/users/nodakai/received_events",
"repos_url": "https://api.github.com/users/nodakai/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nodakai/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nodakai/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nodakai",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-02-19T19:11:05Z | 2021-09-08T12:00:55Z | 2017-02-19T21:34:15Z | NONE | resolved | If it make sense to include the [`url`][url] field to the `Response` class in order to be human friendly when automatic redirection kicks in, shouldn't there be a `method` field as well, for the case when a `POST` results in 302 with which Requests respond with `GET` ?
Background: I was investigating an issue with a Consul REST API client which was based on Requests, and found out it was related to #2590 . While it's great the v3.0 will be shipped with the fix #3757, my observation was it was tricky to figure out what was going on under the hood. I could see my `PUT` was redirected from `/v1/kv/a//b` to `/v1/kv/a/b` by 301 but at first I had no idea the method was also changed to `GET`, striping the content data away. I gave a try on `curl -v` and hurrah, it displayed "Switch from POST to GET".
Moreover, if my understanding is correct (web isn't my field of specialty,) in a hypothetical situation when Requests is following a looong chain of mixture of 301 and 303, it would be helpful to be able to identify at which point the method changed from, say, `PUT` to `GET`.
Anyways the bottom line is, the `url` isn't complete without an accompanying `method` field, I think.
[url]: http://docs.python-requests.org/en/latest/api/#requests.Response.url | {
"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/3881/reactions"
} | https://api.github.com/repos/psf/requests/issues/3881/timeline | null | completed | null | null | false | [
"@nodakai that all is available in the response history already. I don't understand how the final response having a method would help you identify that. `response.request.method` already exists and (I thought) is documented.",
"Also, hi! Welcome! Thanks for opening this and starting the discussion for it. I'm a b... |
https://api.github.com/repos/psf/requests/issues/3880 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3880/labels{/name} | https://api.github.com/repos/psf/requests/issues/3880/comments | https://api.github.com/repos/psf/requests/issues/3880/events | https://github.com/psf/requests/issues/3880 | 208,540,960 | MDU6SXNzdWUyMDg1NDA5NjA= | 3,880 | timeout causes exception unrelated to timeout | {
"avatar_url": "https://avatars.githubusercontent.com/u/1634628?v=4",
"events_url": "https://api.github.com/users/bkline/events{/privacy}",
"followers_url": "https://api.github.com/users/bkline/followers",
"following_url": "https://api.github.com/users/bkline/following{/other_user}",
"gists_url": "https://api.github.com/users/bkline/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bkline",
"id": 1634628,
"login": "bkline",
"node_id": "MDQ6VXNlcjE2MzQ2Mjg=",
"organizations_url": "https://api.github.com/users/bkline/orgs",
"received_events_url": "https://api.github.com/users/bkline/received_events",
"repos_url": "https://api.github.com/users/bkline/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bkline/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bkline/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bkline",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 24 | 2017-02-17T19:59:29Z | 2022-09-27T19:32:03Z | 2017-03-01T16:01:13Z | NONE | resolved | When I submit a request without specifying a timeout, I get a 404 response (appropriately). For the same URL, requested with a timeout, I immediately get an exception claiming that the remote host has forcibly closed the connection. I can't imagine how the timeout mechanism could result in this behavior.
```
H:\tests>python
ActivePython 2.7.10.12 (ActiveState Software Inc.) based on
Python 2.7.10 (default, Aug 21 2015, 12:07:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.__version__
'2.13.0'
>>> requests.get("http://www.cancer.gov/cam")
<Response [404]>
>>> requests.get("http://www.cancer.gov/cam", timeout=5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python\lib\site-packages\requests\api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "D:\Python\lib\site-packages\requests\api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "D:\Python\lib\site-packages\requests\sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "D:\Python\lib\site-packages\requests\sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "D:\Python\lib\site-packages\requests\adapters.py", line 473, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))
``` | {
"avatar_url": "https://avatars.githubusercontent.com/u/1634628?v=4",
"events_url": "https://api.github.com/users/bkline/events{/privacy}",
"followers_url": "https://api.github.com/users/bkline/followers",
"following_url": "https://api.github.com/users/bkline/following{/other_user}",
"gists_url": "https://api.github.com/users/bkline/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bkline",
"id": 1634628,
"login": "bkline",
"node_id": "MDQ6VXNlcjE2MzQ2Mjg=",
"organizations_url": "https://api.github.com/users/bkline/orgs",
"received_events_url": "https://api.github.com/users/bkline/received_events",
"repos_url": "https://api.github.com/users/bkline/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bkline/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bkline/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bkline",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3880/reactions"
} | https://api.github.com/repos/psf/requests/issues/3880/timeline | null | completed | null | null | false | [
"Does this reproduce consistently?",
"Yes. Every time I request this URL with a timeout, an exception is thrown.",
"So, I can't reproduce this *at all*, and it seems absurd. Adding a timeout should not cause the remote peer to shut the connection in your face. This is a tough question, I know, but have you test... |
https://api.github.com/repos/psf/requests/issues/3879 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3879/labels{/name} | https://api.github.com/repos/psf/requests/issues/3879/comments | https://api.github.com/repos/psf/requests/issues/3879/events | https://github.com/psf/requests/issues/3879 | 208,326,697 | MDU6SXNzdWUyMDgzMjY2OTc= | 3,879 | python-requests version:1.1.0 ConnectionError: [Errno 2] server failed | {
"avatar_url": "https://avatars.githubusercontent.com/u/12867714?v=4",
"events_url": "https://api.github.com/users/duyanghao/events{/privacy}",
"followers_url": "https://api.github.com/users/duyanghao/followers",
"following_url": "https://api.github.com/users/duyanghao/following{/other_user}",
"gists_url": "https://api.github.com/users/duyanghao/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/duyanghao",
"id": 12867714,
"login": "duyanghao",
"node_id": "MDQ6VXNlcjEyODY3NzE0",
"organizations_url": "https://api.github.com/users/duyanghao/orgs",
"received_events_url": "https://api.github.com/users/duyanghao/received_events",
"repos_url": "https://api.github.com/users/duyanghao/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/duyanghao/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/duyanghao/subscriptions",
"type": "User",
"url": "https://api.github.com/users/duyanghao",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 14 | 2017-02-17T03:44:38Z | 2021-09-08T12:00:54Z | 2017-02-17T08:25:10Z | NONE | resolved | python-requests version:1.1.0
there are sometimes two error appear:
error one log:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1687, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1360, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1358, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1344, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/toolkit.py", line 264, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 35, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 56, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 140, in wrapper
flask.request.path, stream=stream, source=source
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 42, in lookup_source
stream=stream
File "/usr/lib/python2.6/site-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 279, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 374, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 206, in send
raise ConnectionError(sockerr)
ConnectionError: [Errno 2] server failed
another error log:
ConnectionError: [Errno 3] name does not exist
2017-02-09 17:44:56,515 ERROR: Exception on /v1/images/d1048c584ea5b29273c1f58e432044dcafcb62a62749378a986b9a42cbe8994d/layer [GET]
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1687, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1360, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1358, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1344, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/toolkit.py", line 264, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 35, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py", line 56, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 140, in wrapper
flask.request.path, stream=stream, source=source
File "/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py", line 42, in lookup_source
stream=stream
File "/usr/lib/python2.6/site-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 279, in request
resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 374, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 206, in send
raise ConnectionError(sockerr)
ConnectionError: [Errno 3] name does not exist | {
"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/3879/reactions"
} | https://api.github.com/repos/psf/requests/issues/3879/timeline | null | completed | null | null | false | [
"Hi!\n\nUnfortunately, we can't help you with a version of requests that old. Requests 1.1.0 shipped in January 2013, making it four years old now. It is thoroughly unsupported by the Requests team. If you installed it via a Linux package manager, you'll need to contact your distribution. Otherwise, you'll need to ... |
https://api.github.com/repos/psf/requests/issues/3878 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3878/labels{/name} | https://api.github.com/repos/psf/requests/issues/3878/comments | https://api.github.com/repos/psf/requests/issues/3878/events | https://github.com/psf/requests/issues/3878 | 208,277,467 | MDU6SXNzdWUyMDgyNzc0Njc= | 3,878 | Preemptive basic authentication support | {
"avatar_url": "https://avatars.githubusercontent.com/u/5264867?v=4",
"events_url": "https://api.github.com/users/ipilcher/events{/privacy}",
"followers_url": "https://api.github.com/users/ipilcher/followers",
"following_url": "https://api.github.com/users/ipilcher/following{/other_user}",
"gists_url": "https://api.github.com/users/ipilcher/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ipilcher",
"id": 5264867,
"login": "ipilcher",
"node_id": "MDQ6VXNlcjUyNjQ4Njc=",
"organizations_url": "https://api.github.com/users/ipilcher/orgs",
"received_events_url": "https://api.github.com/users/ipilcher/received_events",
"repos_url": "https://api.github.com/users/ipilcher/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ipilcher/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ipilcher/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ipilcher",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-02-16T23:07:12Z | 2021-09-08T12:00:55Z | 2017-02-17T00:05:07Z | NONE | resolved | Is $SUBJECT possible? | {
"avatar_url": "https://avatars.githubusercontent.com/u/5264867?v=4",
"events_url": "https://api.github.com/users/ipilcher/events{/privacy}",
"followers_url": "https://api.github.com/users/ipilcher/followers",
"following_url": "https://api.github.com/users/ipilcher/following{/other_user}",
"gists_url": "https://api.github.com/users/ipilcher/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ipilcher",
"id": 5264867,
"login": "ipilcher",
"node_id": "MDQ6VXNlcjUyNjQ4Njc=",
"organizations_url": "https://api.github.com/users/ipilcher/orgs",
"received_events_url": "https://api.github.com/users/ipilcher/received_events",
"repos_url": "https://api.github.com/users/ipilcher/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ipilcher/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ipilcher/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ipilcher",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3878/reactions"
} | https://api.github.com/repos/psf/requests/issues/3878/timeline | null | completed | null | null | false | [
"Never mind. Authorization header was being stripped because of a redirect in my testing."
] |
https://api.github.com/repos/psf/requests/issues/3877 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3877/labels{/name} | https://api.github.com/repos/psf/requests/issues/3877/comments | https://api.github.com/repos/psf/requests/issues/3877/events | https://github.com/psf/requests/pull/3877 | 208,118,320 | MDExOlB1bGxSZXF1ZXN0MTA2NTIyOTM2 | 3,877 | Correct docstring for Response.ok | {
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 6 | 2017-02-16T13:16:38Z | 2021-09-07T00:06:32Z | 2017-02-16T13:37:18Z | CONTRIBUTOR | resolved | We added a docstring just a few hours ago but it wasn't entirely accurate. | {
"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/3877/reactions"
} | https://api.github.com/repos/psf/requests/issues/3877/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3877.diff",
"html_url": "https://github.com/psf/requests/pull/3877",
"merged_at": "2017-02-16T13:37:18Z",
"patch_url": "https://github.com/psf/requests/pull/3877.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3877"
} | true | [
"@sigmavirus24 That PR was merged on the grounds that it was consistent with the docstrings that relied on that method. If we're changing one, we should change them all. =)",
"@Lukasa which docstrings are those? I was under the impression that the docstring format was what was borrowed from, not the content of ot... |
https://api.github.com/repos/psf/requests/issues/3876 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3876/labels{/name} | https://api.github.com/repos/psf/requests/issues/3876/comments | https://api.github.com/repos/psf/requests/issues/3876/events | https://github.com/psf/requests/pull/3876 | 208,061,440 | MDExOlB1bGxSZXF1ZXN0MTA2NDgxNjk5 | 3,876 | added docstring for response.ok property | {
"avatar_url": "https://avatars.githubusercontent.com/u/3473617?v=4",
"events_url": "https://api.github.com/users/mislavcimpersak/events{/privacy}",
"followers_url": "https://api.github.com/users/mislavcimpersak/followers",
"following_url": "https://api.github.com/users/mislavcimpersak/following{/other_user}",
"gists_url": "https://api.github.com/users/mislavcimpersak/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mislavcimpersak",
"id": 3473617,
"login": "mislavcimpersak",
"node_id": "MDQ6VXNlcjM0NzM2MTc=",
"organizations_url": "https://api.github.com/users/mislavcimpersak/orgs",
"received_events_url": "https://api.github.com/users/mislavcimpersak/received_events",
"repos_url": "https://api.github.com/users/mislavcimpersak/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mislavcimpersak/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mislavcimpersak/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mislavcimpersak",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-02-16T09:10:13Z | 2021-09-07T00:06:33Z | 2017-02-16T09:30:12Z | CONTRIBUTOR | resolved | Nothing much here, just added a docstring for `response.ok` property.
Took the docstring straight from the other methods to stay consistent. | {
"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/3876/reactions"
} | https://api.github.com/repos/psf/requests/issues/3876/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3876.diff",
"html_url": "https://github.com/psf/requests/pull/3876",
"merged_at": "2017-02-16T09:30:12Z",
"patch_url": "https://github.com/psf/requests/pull/3876.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3876"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3876?src=pr&el=h1) Report\n> Merging [#3876](https://codecov.io/gh/kennethreitz/requests/pull/3876?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/655f0edbb43dad16ea5fe6ec0f31fdc1de396610?src=pr&el=desc) will **not change... |
https://api.github.com/repos/psf/requests/issues/3875 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3875/labels{/name} | https://api.github.com/repos/psf/requests/issues/3875/comments | https://api.github.com/repos/psf/requests/issues/3875/events | https://github.com/psf/requests/issues/3875 | 207,693,756 | MDU6SXNzdWUyMDc2OTM3NTY= | 3,875 | UnicodeEncodeError when passing a non-ascii string in "data" | {
"avatar_url": "https://avatars.githubusercontent.com/u/8549?v=4",
"events_url": "https://api.github.com/users/jamshid/events{/privacy}",
"followers_url": "https://api.github.com/users/jamshid/followers",
"following_url": "https://api.github.com/users/jamshid/following{/other_user}",
"gists_url": "https://api.github.com/users/jamshid/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jamshid",
"id": 8549,
"login": "jamshid",
"node_id": "MDQ6VXNlcjg1NDk=",
"organizations_url": "https://api.github.com/users/jamshid/orgs",
"received_events_url": "https://api.github.com/users/jamshid/received_events",
"repos_url": "https://api.github.com/users/jamshid/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jamshid/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jamshid/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jamshid",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-02-15T02:38:28Z | 2021-09-08T12:00:56Z | 2017-02-15T05:24:11Z | NONE | resolved | Using requests 2.13.0 I can't seem to pass a non-ascii value as "data" on a PUT.
This might be a duplicate of issue https://github.com/kennethreitz/requests/issues/2638.
How should I send a unicode string in a request body? Doing an `.encode('utf-8')` seems to workaround the problem in first example, but that still fails in the second.
```
>>>AUTH = requests.auth.HTTPBasicAuth("john", "password")
>>>requests.put('http://localhost:8084/',headers={'Content-type':'text/plain; charset=utf-8'}, data=u'\u24B6\u24B7\u24B8\u24B9',auth=AUTH)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/requests/api.py", line 124, in put
return request('put', url, data=data, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib64/python2.7/httplib.py", line 1020, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python2.7/httplib.py", line 1054, in _send_request
self.endheaders(body)
File "/usr/lib64/python2.7/httplib.py", line 1016, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 871, in _send_output
self.send(message_body)
File "/usr/lib64/python2.7/httplib.py", line 840, in send
self.sock.sendall(data)
File "/usr/lib64/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
```
Btw the same PUT with AWS S3 auth (V2 or V4) has similar error but different stack (I added the "!!!" prints for debugging):
```
>>> AUTH=AWS4Auth('john', 'password', 'eu-west-1', 's3')
>>> requests.put('http://localhost:8084/',headers={'Content-type':'text/plain'}, data=u'\u24B6\u24B7\u24B8\u24B9',auth=AUTH)
!!!1 u'PUT / HTTP/1.1\r\nHost: localhost:8084\r\nConnection: keep-alive\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nUser-Agent: python-requests/2.13.0\r\ncontent-type: text/plain; charset=utf-8\r\nContent-Length: 12\r\nx-amz-date: 20170215T023125Z\r\nx-amz-content-sha256: 7ec37a06579472c0743b58bd45af589cca817f65bbd8c6e528bc5e3092166396\r\nAuthorization: AWS4-HMAC-SHA256 Credential=john/20170215/eu-west-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=e83f7e17d7c6e25a940965962df32e9c690681b158f6d9ad9f484bf9c09bb963\r\n\r\n'
!!!2 '\xe2\x92\xb6\xe2\x92\xb7\xe2\x92\xb8\xe2\x92\xb9'
!!!3 u'PUT / HTTP/1.1\r\nHost: localhost:8084\r\nConnection: keep-alive\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nUser-Agent: python-requests/2.13.0\r\ncontent-type: text/plain; charset=utf-8\r\nContent-Length: 12\r\nx-amz-date: 20170215T023125Z\r\nx-amz-content-sha256: 7ec37a06579472c0743b58bd45af589cca817f65bbd8c6e528bc5e3092166396\r\nAuthorization: AWS4-HMAC-SHA256 Credential=john/20170215/eu-west-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=e83f7e17d7c6e25a940965962df32e9c690681b158f6d9ad9f484bf9c09bb963\r\n\r\n\u24b6\u24b7\u24b8\u24b9'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/requests/api.py", line 124, in put
return request('put', url, data=data, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib64/python2.7/httplib.py", line 1020, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python2.7/httplib.py", line 1054, in _send_request
self.endheaders(body)
File "/usr/lib64/python2.7/httplib.py", line 1016, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 865, in _send_output
msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
``` | {
"avatar_url": "https://avatars.githubusercontent.com/u/8549?v=4",
"events_url": "https://api.github.com/users/jamshid/events{/privacy}",
"followers_url": "https://api.github.com/users/jamshid/followers",
"following_url": "https://api.github.com/users/jamshid/following{/other_user}",
"gists_url": "https://api.github.com/users/jamshid/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jamshid",
"id": 8549,
"login": "jamshid",
"node_id": "MDQ6VXNlcjg1NDk=",
"organizations_url": "https://api.github.com/users/jamshid/orgs",
"received_events_url": "https://api.github.com/users/jamshid/received_events",
"repos_url": "https://api.github.com/users/jamshid/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jamshid/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jamshid/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jamshid",
"user_view_type": "public"
} | {
"+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/3875/reactions"
} | https://api.github.com/repos/psf/requests/issues/3875/timeline | null | completed | null | null | false | [
"Hey @jamshid, I believe this is a problem with how you're using unicode in Python 2.7 rather than something requests specific. The repro below fails with the same exception without any requests code. If you pass properly encoded utf-8, it should solve this issue.\r\n\r\n```python\r\nwith open('testfile.out', 'w') ... |
https://api.github.com/repos/psf/requests/issues/3874 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3874/labels{/name} | https://api.github.com/repos/psf/requests/issues/3874/comments | https://api.github.com/repos/psf/requests/issues/3874/events | https://github.com/psf/requests/pull/3874 | 207,565,418 | MDExOlB1bGxSZXF1ZXN0MTA2MTQwNjc2 | 3,874 | variable name consistency | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 7 | 2017-02-14T16:27:56Z | 2021-09-07T00:06:32Z | 2017-02-21T19:04:25Z | MEMBER | resolved | Just need to clean up a few variable names. | {
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3874/reactions"
} | https://api.github.com/repos/psf/requests/issues/3874/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3874.diff",
"html_url": "https://github.com/psf/requests/pull/3874",
"merged_at": "2017-02-21T19:04:25Z",
"patch_url": "https://github.com/psf/requests/pull/3874.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3874"
} | true | [
"All set.",
"So to be clear, the clearer names are on the 3.0 branch already: I just accidentally busted them with names from the master branch like a dummy.",
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3874?src=pr&el=h1) Report\n> :exclamation: No coverage uploaded for pull request base (`pr... |
https://api.github.com/repos/psf/requests/issues/3873 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3873/labels{/name} | https://api.github.com/repos/psf/requests/issues/3873/comments | https://api.github.com/repos/psf/requests/issues/3873/events | https://github.com/psf/requests/pull/3873 | 207,537,708 | MDExOlB1bGxSZXF1ZXN0MTA2MTIwMzE0 | 3,873 | properly handled failed seek | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 6 | 2017-02-14T14:54:52Z | 2021-09-07T00:06:33Z | 2017-02-14T15:43:19Z | MEMBER | resolved | This is a minor bug in the way we're handling exceptions for `super_len` in `prepare_body`. The mocked `seek` method wasn't created with the optional `whence` parameter and was failing with a `TypeError` when called. A legacy exception block for the older version of `super_len` caught this and made it appear the test was passing.
This commit will wrap the seek->tell->seek process in the appropriate exceptions and fix the test.
I think there's two things that may need further discussion though. The first minor one being, we've been using `super_len` in `prepare_content_length` without this broad exception block from `prepare_body` for two releases without issue. I'm going to suggest we remove it from `prepare_body` because I don't think these exceptions can be raised from `super_len` any longer, except in cases we probably don't want them caught.
The second is, if we seek to the end of a file and fail on the `tell` or `seek` back to the original position, do we want to actually send the request? At that point, we'd probably want to raise an exception, right? This probably is something for 3.0.0 since it will be breaking, but wanted to address it before we merge this. | {
"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/3873/reactions"
} | https://api.github.com/repos/psf/requests/issues/3873/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3873.diff",
"html_url": "https://github.com/psf/requests/pull/3873",
"merged_at": "2017-02-14T15:43:19Z",
"patch_url": "https://github.com/psf/requests/pull/3873.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3873"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3873?src=pr&el=h1) Report\n> Merging [#3873](https://codecov.io/gh/kennethreitz/requests/pull/3873?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/90f3842ed60f91ff101189f792ce21f7c762b1a0?src=pr&el=desc) will **decrease**... |
https://api.github.com/repos/psf/requests/issues/3872 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3872/labels{/name} | https://api.github.com/repos/psf/requests/issues/3872/comments | https://api.github.com/repos/psf/requests/issues/3872/events | https://github.com/psf/requests/issues/3872 | 207,409,032 | MDU6SXNzdWUyMDc0MDkwMzI= | 3,872 | HSTS support | {
"avatar_url": "https://avatars.githubusercontent.com/u/410452?v=4",
"events_url": "https://api.github.com/users/sylvinus/events{/privacy}",
"followers_url": "https://api.github.com/users/sylvinus/followers",
"following_url": "https://api.github.com/users/sylvinus/following{/other_user}",
"gists_url": "https://api.github.com/users/sylvinus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sylvinus",
"id": 410452,
"login": "sylvinus",
"node_id": "MDQ6VXNlcjQxMDQ1Mg==",
"organizations_url": "https://api.github.com/users/sylvinus/orgs",
"received_events_url": "https://api.github.com/users/sylvinus/received_events",
"repos_url": "https://api.github.com/users/sylvinus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sylvinus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sylvinus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sylvinus",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 6 | 2017-02-14T03:37:11Z | 2021-09-08T10:00:52Z | 2017-02-14T08:29:52Z | NONE | resolved | Hello!
Not sure this falls in the scope of requests, but nobody seems to have mentioned it so far so here it goes :)
I think it would be great to have an opt-in flag for requests that reads the [HSTS preload list](https://hstspreload.org/), and automatically switches to https if there's a match, just like a browser would.
This would save users from reimplementing this logic when they want to avoid useless http requests (they could already have known they would result in a redirect to https).
Additionally, it could be great to store HSTS headers from the server responses locally (just like a cookie jar?)
Thanks! | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3872/reactions"
} | https://api.github.com/repos/psf/requests/issues/3872/timeline | null | completed | null | null | false | [
"Hi there!\r\n\r\nThis is a substantial feature request, and it's one we do want to support, but there's a big chunk of work involved. There has been some initial progress made on shazow/urllib3#608, which could be used to bootstrap this work into urllib3 (which is where it would have to go).\r\n\r\nHowever, some o... |
https://api.github.com/repos/psf/requests/issues/3871 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3871/labels{/name} | https://api.github.com/repos/psf/requests/issues/3871/comments | https://api.github.com/repos/psf/requests/issues/3871/events | https://github.com/psf/requests/pull/3871 | 207,304,806 | MDExOlB1bGxSZXF1ZXN0MTA1OTU0NTE5 | 3,871 | altered internal loops of how ``SessionRedirectMixin.resolve_redirect… | {
"avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4",
"events_url": "https://api.github.com/users/jvanasco/events{/privacy}",
"followers_url": "https://api.github.com/users/jvanasco/followers",
"following_url": "https://api.github.com/users/jvanasco/following{/other_user}",
"gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jvanasco",
"id": 204779,
"login": "jvanasco",
"node_id": "MDQ6VXNlcjIwNDc3OQ==",
"organizations_url": "https://api.github.com/users/jvanasco/orgs",
"received_events_url": "https://api.github.com/users/jvanasco/received_events",
"repos_url": "https://api.github.com/users/jvanasco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jvanasco",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 6 | 2017-02-13T18:46:05Z | 2021-09-07T00:06:32Z | 2017-02-23T16:09:59Z | CONTRIBUTOR | resolved | This is an idea for updating the `resolve_redirects` loop.
The existing code was hard to untangle as variables get overwritten midway through the loop (`resp` switches between the previous and the next, which can be easy to miss). It manages the `hist` by omitting the first request, appending the previous request, then shuffling some stuff around in a cleanup during the `send` method.
In this approach, populating the `hist` is moved down the loop so the current request is topmost on the stack. The cleanup function is then simplified to just popping it off.
This passes all tests, but causes a slight undocumented API change -- the value of `request.history` changes, requiring a slightly different cleanup. The only code that calls `resolve_redirects` is within `Session.send`, but I don't know if this would break any hooks.
anyways, I think this makes the block more straightforward as the "cleanup" function in `send` is simplified and the context of `resp` when appending the history doesn't change as much. another approach I thought of was using inline comments or variable name changes to clearly note which is the "previous_request" in that loop. | {
"avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4",
"events_url": "https://api.github.com/users/jvanasco/events{/privacy}",
"followers_url": "https://api.github.com/users/jvanasco/followers",
"following_url": "https://api.github.com/users/jvanasco/following{/other_user}",
"gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jvanasco",
"id": 204779,
"login": "jvanasco",
"node_id": "MDQ6VXNlcjIwNDc3OQ==",
"organizations_url": "https://api.github.com/users/jvanasco/orgs",
"received_events_url": "https://api.github.com/users/jvanasco/received_events",
"repos_url": "https://api.github.com/users/jvanasco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jvanasco",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3871/reactions"
} | https://api.github.com/repos/psf/requests/issues/3871/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3871.diff",
"html_url": "https://github.com/psf/requests/pull/3871",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/3871.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3871"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3871?src=pr&el=h1) Report\n> Merging [#3871](https://codecov.io/gh/kennethreitz/requests/pull/3871?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/90f3842ed60f91ff101189f792ce21f7c762b1a0?src=pr&el=desc) will **decrease**... |
https://api.github.com/repos/psf/requests/issues/3869 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3869/labels{/name} | https://api.github.com/repos/psf/requests/issues/3869/comments | https://api.github.com/repos/psf/requests/issues/3869/events | https://github.com/psf/requests/pull/3869 | 207,032,956 | MDExOlB1bGxSZXF1ZXN0MTA1NzgxNTQ5 | 3,869 | revert removal of request param from resolve_redirects | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2017-02-12T06:39:29Z | 2021-09-07T00:06:34Z | 2017-02-12T07:33:14Z | MEMBER | resolved | This will fix the build issue on the proposed/3.0.0 branch.
When the `resp` and `req` parameters were condensed into `response`, it had some unintentional effects on responses modified by hooks. The `req` parameter was the request prior to being sent and hooks being run. Since `handle_401` resends the request again with the Authorization header, using `response.request` continues to pass it on with every redirect.
Reverting this change is the simplest approach since it's mostly cosmetic. We could alternatively look into a more explicit removal of Authorization headers on redirects. | {
"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/3869/reactions"
} | https://api.github.com/repos/psf/requests/issues/3869/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3869.diff",
"html_url": "https://github.com/psf/requests/pull/3869",
"merged_at": "2017-02-12T07:33:14Z",
"patch_url": "https://github.com/psf/requests/pull/3869.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3869"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3869?src=pr&el=h1) Report\n> :exclamation: No coverage uploaded for pull request base (`proposed/3.0.0@85a29f1`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).\n> The diff coverage is `10... |
https://api.github.com/repos/psf/requests/issues/3868 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3868/labels{/name} | https://api.github.com/repos/psf/requests/issues/3868/comments | https://api.github.com/repos/psf/requests/issues/3868/events | https://github.com/psf/requests/pull/3868 | 207,005,170 | MDExOlB1bGxSZXF1ZXN0MTA1NzY2MTk3 | 3,868 | Make Response.raise_for_status() return the response object if the response is successful | {
"avatar_url": "https://avatars.githubusercontent.com/u/28710?v=4",
"events_url": "https://api.github.com/users/vmalloc/events{/privacy}",
"followers_url": "https://api.github.com/users/vmalloc/followers",
"following_url": "https://api.github.com/users/vmalloc/following{/other_user}",
"gists_url": "https://api.github.com/users/vmalloc/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/vmalloc",
"id": 28710,
"login": "vmalloc",
"node_id": "MDQ6VXNlcjI4NzEw",
"organizations_url": "https://api.github.com/users/vmalloc/orgs",
"received_events_url": "https://api.github.com/users/vmalloc/received_events",
"repos_url": "https://api.github.com/users/vmalloc/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/vmalloc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vmalloc/subscriptions",
"type": "User",
"url": "https://api.github.com/users/vmalloc",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 6 | 2017-02-11T20:12:31Z | 2021-09-07T00:06:34Z | 2017-02-12T09:58:09Z | NONE | resolved | This allows for chaining method calls in cases where we want to raise for bad codes but use the response otherwise,
e.g. `requests.get(URL).raise_for_status().json()['value']` | {
"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/3868/reactions"
} | https://api.github.com/repos/psf/requests/issues/3868/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3868.diff",
"html_url": "https://github.com/psf/requests/pull/3868",
"merged_at": "2017-02-12T09:58:09Z",
"patch_url": "https://github.com/psf/requests/pull/3868.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3868"
} | true | [
"@Lukasa added a changelog entry to 3.0-HISTORY. Also the Travis build fails, but it doesn't appear like it's because of my change... not sure how to investigate...",
"Yeah, I don't think it is: the 3.0.0 build has a breakage on it that was caused by one of the recent merges. I'll chase it on Monday. In the meant... |
https://api.github.com/repos/psf/requests/issues/3867 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3867/labels{/name} | https://api.github.com/repos/psf/requests/issues/3867/comments | https://api.github.com/repos/psf/requests/issues/3867/events | https://github.com/psf/requests/issues/3867 | 206,980,309 | MDU6SXNzdWUyMDY5ODAzMDk= | 3,867 | Update certifi certs to 2017.01.23 | {
"avatar_url": "https://avatars.githubusercontent.com/u/1782831?v=4",
"events_url": "https://api.github.com/users/klensy/events{/privacy}",
"followers_url": "https://api.github.com/users/klensy/followers",
"following_url": "https://api.github.com/users/klensy/following{/other_user}",
"gists_url": "https://api.github.com/users/klensy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/klensy",
"id": 1782831,
"login": "klensy",
"node_id": "MDQ6VXNlcjE3ODI4MzE=",
"organizations_url": "https://api.github.com/users/klensy/orgs",
"received_events_url": "https://api.github.com/users/klensy/received_events",
"repos_url": "https://api.github.com/users/klensy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/klensy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/klensy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/klensy",
"user_view_type": "public"
} | [] | closed | true | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | [
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url... | null | 1 | 2017-02-11T13:40:35Z | 2021-09-08T12:00:58Z | 2017-02-11T14:15:03Z | NONE | resolved | Version 2017.01.23 latest (for today).
Tnx. | {
"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/3867/reactions"
} | https://api.github.com/repos/psf/requests/issues/3867/timeline | null | completed | null | null | false | [
"Thanks, but this is part of our release process. We generally don't update the master branch ahead of releases. \r\n\r\nIf you want to stay up-to-date with certifi you should install it directly: requests will automatically use it in preference to its own trust store. "
] |
https://api.github.com/repos/psf/requests/issues/3866 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3866/labels{/name} | https://api.github.com/repos/psf/requests/issues/3866/comments | https://api.github.com/repos/psf/requests/issues/3866/events | https://github.com/psf/requests/pull/3866 | 206,896,894 | MDExOlB1bGxSZXF1ZXN0MTA1Njk4Njc1 | 3,866 | More extensive while-loop altering | {
"avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4",
"events_url": "https://api.github.com/users/jvanasco/events{/privacy}",
"followers_url": "https://api.github.com/users/jvanasco/followers",
"following_url": "https://api.github.com/users/jvanasco/following{/other_user}",
"gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jvanasco",
"id": 204779,
"login": "jvanasco",
"node_id": "MDQ6VXNlcjIwNDc3OQ==",
"organizations_url": "https://api.github.com/users/jvanasco/orgs",
"received_events_url": "https://api.github.com/users/jvanasco/received_events",
"repos_url": "https://api.github.com/users/jvanasco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jvanasco",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 5 | 2017-02-10T20:20:19Z | 2021-09-07T00:06:33Z | 2017-02-10T21:47:33Z | CONTRIBUTOR | resolved | This is offered as an alternate/addition to my other PR, https://github.com/kennethreitz/requests/pull/3846
Specifically the code is in this commit: https://github.com/jvanasco/requests/commit/5e9371854176164db9ce5fee5ceb39b58f4035b2
This passes current tests, but it's a bit of a change so I'm offering it separately.
The existing redirect code was incredibly confusing, because objects were being overwritten mid-loop, select items had to be removed, and then everything needed to be switched back again.
This approach does a major reorganization of the logic, but I think for the better:
# SessionRedirectMixin.resolve_redirects
The `hist` tracker makes more sense.
* `hist` is started off with the original response.
* after the redirect response is created, it is updated with the "current" history
* `hist` is then updated with the new response
# Session.send
Because the `Request.history` was carefully constructed within the loop context, the history had to then be shuffled around and response updated. The above change makes that unnecessary, and instead `r ` is just popped off and used as-is.
I think this makes the code easier to read and maintain, and it removes that weird shuffle at the end. It's a bit of a change though, and might break the API in a way that is currently untested.
| {
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3866/reactions"
} | https://api.github.com/repos/psf/requests/issues/3866/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3866.diff",
"html_url": "https://github.com/psf/requests/pull/3866",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/3866.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3866"
} | true | [
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3866?src=pr&el=h1) Report\n> Merging [#3866](https://codecov.io/gh/kennethreitz/requests/pull/3866?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/ad65b0cb19124b5ae4dd01bf19d82c16ffb2485d?src=pr&el=desc) will **decrease**... |
https://api.github.com/repos/psf/requests/issues/3865 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3865/labels{/name} | https://api.github.com/repos/psf/requests/issues/3865/comments | https://api.github.com/repos/psf/requests/issues/3865/events | https://github.com/psf/requests/pull/3865 | 206,862,008 | MDExOlB1bGxSZXF1ZXN0MTA1Njc0NDk4 | 3,865 | Allow use of 'no_proxy' in the proxies argument | {
"avatar_url": "https://avatars.githubusercontent.com/u/578155?v=4",
"events_url": "https://api.github.com/users/JohnVillalovos/events{/privacy}",
"followers_url": "https://api.github.com/users/JohnVillalovos/followers",
"following_url": "https://api.github.com/users/JohnVillalovos/following{/other_user}",
"gists_url": "https://api.github.com/users/JohnVillalovos/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/JohnVillalovos",
"id": 578155,
"login": "JohnVillalovos",
"node_id": "MDQ6VXNlcjU3ODE1NQ==",
"organizations_url": "https://api.github.com/users/JohnVillalovos/orgs",
"received_events_url": "https://api.github.com/users/JohnVillalovos/received_events",
"repos_url": "https://api.github.com/users/JohnVillalovos/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/JohnVillalovos/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JohnVillalovos/subscriptions",
"type": "User",
"url": "https://api.github.com/users/JohnVillalovos",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-02-10T17:49:26Z | 2021-09-07T00:06:34Z | 2017-02-10T21:50:11Z | CONTRIBUTOR | resolved | Add the ability to add 'no_proxy' and a value to the 'proxies'
dictionary argument.
https://github.com/kennethreitz/requests/issues/2817
Closes gh-2817 | {
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3865/reactions"
} | https://api.github.com/repos/psf/requests/issues/3865/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3865.diff",
"html_url": "https://github.com/psf/requests/pull/3865",
"merged_at": "2017-02-10T21:50:11Z",
"patch_url": "https://github.com/psf/requests/pull/3865.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3865"
} | true | [
"Had done this previously as: https://github.com/kennethreitz/requests/pull/3561",
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3865?src=pr&el=h1) Report\n> Merging [#3865](https://codecov.io/gh/kennethreitz/requests/pull/3865?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/reque... |
https://api.github.com/repos/psf/requests/issues/3864 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3864/labels{/name} | https://api.github.com/repos/psf/requests/issues/3864/comments | https://api.github.com/repos/psf/requests/issues/3864/events | https://github.com/psf/requests/pull/3864 | 206,855,244 | MDExOlB1bGxSZXF1ZXN0MTA1NjcwMTI3 | 3,864 | Proposed/3.0.0 | {
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
} | [
{
"color": "e102d8",
"default": false,
"description": null,
"id": 117745,
"name": "Planned",
"node_id": "MDU6TGFiZWwxMTc3NDU=",
"url": "https://api.github.com/repos/psf/requests/labels/Planned"
},
{
"color": "eb6420",
"default": false,
"description": null,
"id": 44501... | closed | true | null | [] | {
"closed_at": null,
"closed_issues": 29,
"created_at": "2013-11-17T11:29:34Z",
"creator": {
"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"
},
"description": null,
"due_on": null,
"html_url": "https://github.com/psf/requests/milestone/20",
"id": 487518,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/20/labels",
"node_id": "MDk6TWlsZXN0b25lNDg3NTE4",
"number": 20,
"open_issues": 12,
"state": "open",
"title": "3.0.0",
"updated_at": "2024-05-19T18:43:00Z",
"url": "https://api.github.com/repos/psf/requests/milestones/20"
} | 12 | 2017-02-10T17:23:04Z | 2021-09-01T00:11:46Z | 2018-11-13T12:55:45Z | CONTRIBUTOR | resolved | # v3.0.0 of Requests
This is a long-polling pull request for the next breaking-change version of Requests — version 3.0.0.
Any feature requests should be added as comments here — this is the time to get anything into Requests, if there's any time at at all.
**Expected landing date**: *this year*.
## Upcoming changes
- Remove the HTTPProxyAuth class in favor of supporting proxy auth via the proxies parameter.
- Relax how Requests strips bodies from redirects. 3.0.0 only supports body removal on 301/302 POST redirects and all 303 redirects.
- Remove support for non-string/bytes parameters in _basic_auth_str.
- Prevent Session.merge_environment from erroneously setting the verify parameter to None instead of True.
- Streaming responses with Response.iter_lines or Response.iter_content now requires an encoding to be set if one isn't provided by the server.
- Raise exception if multiple locations are returned during a redirect.
- Update ConnectionPool connections when TLS/SSL settings change.
- Remove simplejson import and only use standard json module.
- Strip surrounding whitespace from urls.
- MissingSchema and InvalidSchema renamed to MissingScheme and InvalidScheme respectively.
- Change merge order for environment settings to avoid excluding Session-level settings.
- Encode redirect URIs as latin-1 before performing redirects in Python 3 to avoid mangling during the requoting process.
- Remove the __bool__ and __nonzero__ methods from a Response object.
- This has been a planned feature for over a year. The behaviour is surprising to most people and breaks most of the assumptions that people have about Response objects. This resolves issue #2002
- Skip over empty chunks in iterators. Empty chunks could prematurely signal the end of a request body's transmission, skipping them allows all of the data through. See #2631 for more details.
- Remove the req argument from Session.resolve_redirects method.
- Rename the resp argument from Session.resolve_redirects to response.
- New PreparedRequest.send method. Now, you can Request().prepare().send().
- All porcelain API functions (e.g. requests.get, etc) now accept an optional session parameter. If provided, the session given will be used for the request, in place of one being created for you.
- URLs are now automatically stripped of leading/trailing whitespace.
## What's left
- Pluggable redirect handler (#3846)
- Anything Kenneth thinks of.
- Urllib3 v2 update | {
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3864/reactions"
} | https://api.github.com/repos/psf/requests/issues/3864/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3864.diff",
"html_url": "https://github.com/psf/requests/pull/3864",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/3864.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3864"
} | true | [
"Needs a rebase!",
"Needs a rebase!",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=h1) Report\n> :exclamation: No coverage uploaded for pull request base (`master@5697148`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit... |
https://api.github.com/repos/psf/requests/issues/3863 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3863/labels{/name} | https://api.github.com/repos/psf/requests/issues/3863/comments | https://api.github.com/repos/psf/requests/issues/3863/events | https://github.com/psf/requests/issues/3863 | 206,843,320 | MDU6SXNzdWUyMDY4NDMzMjA= | 3,863 | Socks5 proxy do not resolves dns through the proxy server | {
"avatar_url": "https://avatars.githubusercontent.com/u/11490531?v=4",
"events_url": "https://api.github.com/users/wavenator/events{/privacy}",
"followers_url": "https://api.github.com/users/wavenator/followers",
"following_url": "https://api.github.com/users/wavenator/following{/other_user}",
"gists_url": "https://api.github.com/users/wavenator/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wavenator",
"id": 11490531,
"login": "wavenator",
"node_id": "MDQ6VXNlcjExNDkwNTMx",
"organizations_url": "https://api.github.com/users/wavenator/orgs",
"received_events_url": "https://api.github.com/users/wavenator/received_events",
"repos_url": "https://api.github.com/users/wavenator/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wavenator/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wavenator/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wavenator",
"user_view_type": "public"
} | [
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
},
{
"color": "fad8c7",
"default": false,
"descrip... | closed | true | null | [] | null | 7 | 2017-02-10T16:36:16Z | 2020-12-06T21:48:26Z | 2017-09-02T02:11:16Z | NONE | resolved | since requests==2.13.0
Using socks5 proxy seems to resolve domains through the client instead of the proxy server.
downgrading to requests==2.12.0 ... 2.10.0 resolves the problem.
```python
In [1]: import requests
In [2]: requests.get(url='https://3g2upl4pq6kufc4m.onion/', proxies={'https': 'socks5://127.0.0.1:9050'})
---------------------------------------------------------------------------
gaierror Traceback (most recent call last)
/usr/lib/python3.6/site-packages/socks.py in connect(self, dest_pair)
782 negotiate = self._proxy_negotiators[proxy_type]
--> 783 negotiate(self, dest_addr, dest_port)
784 except socket.error as error:
/usr/lib/python3.6/site-packages/socks.py in _negotiate_SOCKS5(self, *dest_addr)
447 self.proxy_peername, self.proxy_sockname = self._SOCKS5_request(self,
--> 448 CONNECT, dest_addr)
449
/usr/lib/python3.6/site-packages/socks.py in _SOCKS5_request(self, conn, cmd, dst)
510 writer.write(b"\x05" + cmd + b"\x00")
--> 511 resolved = self._write_SOCKS5_address(dst, writer)
512 writer.flush()
/usr/lib/python3.6/site-packages/socks.py in _write_SOCKS5_address(self, addr, file)
562 # Resolve locally
--> 563 addresses = socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM, socket.IPPROTO_TCP, socket.AI_ADDRCONFIG)
564 # We can't really work out what IP is reachable, so just pick the
/usr/lib/python3.6/socket.py in getaddrinfo(host, port, family, type, proto, flags)
742 addrlist = []
--> 743 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
744 af, socktype, proto, canonname, sa = res
gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
GeneralProxyError Traceback (most recent call last)
/usr/lib/python3.6/site-packages/requests/packages/urllib3/contrib/socks.py in _new_conn(self)
87 timeout=self.timeout,
---> 88 **extra_kw
89 )
/usr/lib/python3.6/site-packages/socks.py in create_connection(dest_pair, proxy_type, proxy_addr, proxy_port, proxy_rdns, proxy_username, proxy_password, timeout, source_address, socket_options)
212 if err:
--> 213 raise err
214
/usr/lib/python3.6/site-packages/socks.py in create_connection(dest_pair, proxy_type, proxy_addr, proxy_port, proxy_rdns, proxy_username, proxy_password, timeout, source_address, socket_options)
202
--> 203 sock.connect((remote_host, remote_port))
204 return sock
/usr/lib/python3.6/site-packages/socks.py in connect(self, dest_pair)
786 self.close()
--> 787 raise GeneralProxyError("Socket error", error)
788 except ProxyError:
GeneralProxyError: Socket error: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
NewConnectionError Traceback (most recent call last)
/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
599 body=body, headers=headers,
--> 600 chunked=chunked)
601
/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
344 try:
--> 345 self._validate_conn(conn)
346 except (SocketTimeout, BaseSSLError) as e:
/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py in _validate_conn(self, conn)
843 if not getattr(conn, 'sock', None): # AppEngine might not have `.sock`
--> 844 conn.connect()
845
/usr/lib/python3.6/site-packages/requests/packages/urllib3/connection.py in connect(self)
283 # Add certificate verification
--> 284 conn = self._new_conn()
285
/usr/lib/python3.6/site-packages/requests/packages/urllib3/contrib/socks.py in _new_conn(self)
109 self,
--> 110 "Failed to establish a new connection: %s" % error
111 )
NewConnectionError: <requests.packages.urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x7f99daa25978>: Failed to establish a new connection: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last)
/usr/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
422 retries=self.max_retries,
--> 423 timeout=timeout
424 )
/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
648 retries = retries.increment(method, url, error=e, _pool=self,
--> 649 _stacktrace=sys.exc_info()[2])
650 retries.sleep()
/usr/lib/python3.6/site-packages/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
375 if new_retry.is_exhausted():
--> 376 raise MaxRetryError(_pool, url, error or ResponseError(cause))
377
MaxRetryError: SOCKSHTTPSConnectionPool(host='3g2upl4pq6kufc4m.onion', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x7f99daa25978>: Failed to establish a new connection: [Errno -2] Name or service not known',))
During handling of the above exception, another exception occurred:
ConnectionError Traceback (most recent call last)
<ipython-input-2-ad633d784dc6> in <module>()
----> 1 requests.get(url='https://3g2upl4pq6kufc4m.onion/', proxies={'https': 'socks5://127.0.0.1:9050'})
/usr/lib/python3.6/site-packages/requests/api.py in get(url, params, **kwargs)
68
69 kwargs.setdefault('allow_redirects', True)
---> 70 return request('get', url, params=params, **kwargs)
71
72
/usr/lib/python3.6/site-packages/requests/api.py in request(method, url, **kwargs)
54 # cases, and look like a memory leak in others.
55 with sessions.Session() as session:
---> 56 return session.request(method=method, url=url, **kwargs)
57
58
/usr/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
486 }
487 send_kwargs.update(settings)
--> 488 resp = self.send(prep, **send_kwargs)
489
490 return resp
/usr/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
607
608 # Send the request
--> 609 r = adapter.send(request, **kwargs)
610
611 # Total elapsed time of the request (approximately)
/usr/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
485 raise ProxyError(e, request=request)
486
--> 487 raise ConnectionError(e, request=request)
488
489 except ClosedPoolError as e:
ConnectionError: SOCKSHTTPSConnectionPool(host='3g2upl4pq6kufc4m.onion', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x7f99daa25978>: Failed to establish a new connection: [Errno -2] Name or service not known',))
```
after `pip install -U requests[socks]==2.12.0`
```python
In [1]: import requests
In [2]: requests.get(url='https://3g2upl4pq6kufc4m.onion/', proxies={'https': 'socks5://127.0.0.1:9050'})
Out[2]: <Response [200]>
``` | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | {
"+1": 2,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/3863/reactions"
} | https://api.github.com/repos/psf/requests/issues/3863/timeline | null | completed | null | null | false | [
"Yes, this change was intentional. This was to bring us in line with curl, which uses different schemes to decide whether to resolve via the proxy or via the client. If you use the scheme `socks5h` that should be sufficient to return to the prior behaviour.",
"I agree, it should be documented",
"This change is ... |
https://api.github.com/repos/psf/requests/issues/3862 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3862/labels{/name} | https://api.github.com/repos/psf/requests/issues/3862/comments | https://api.github.com/repos/psf/requests/issues/3862/events | https://github.com/psf/requests/pull/3862 | 206,766,274 | MDExOlB1bGxSZXF1ZXN0MTA1NjA2NDIy | 3,862 | Updated docs for Pipenv | {
"avatar_url": "https://avatars.githubusercontent.com/u/4329213?v=4",
"events_url": "https://api.github.com/users/mattkohl/events{/privacy}",
"followers_url": "https://api.github.com/users/mattkohl/followers",
"following_url": "https://api.github.com/users/mattkohl/following{/other_user}",
"gists_url": "https://api.github.com/users/mattkohl/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mattkohl",
"id": 4329213,
"login": "mattkohl",
"node_id": "MDQ6VXNlcjQzMjkyMTM=",
"organizations_url": "https://api.github.com/users/mattkohl/orgs",
"received_events_url": "https://api.github.com/users/mattkohl/received_events",
"repos_url": "https://api.github.com/users/mattkohl/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mattkohl/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mattkohl/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mattkohl",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2017-02-10T10:56:00Z | 2021-09-07T00:06:38Z | 2017-02-10T12:19:01Z | NONE | resolved | Removed out-of-date advice for installing `py.test` with `requirements.txt` | {
"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/3862/reactions"
} | https://api.github.com/repos/psf/requests/issues/3862/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/3862.diff",
"html_url": "https://github.com/psf/requests/pull/3862",
"merged_at": "2017-02-10T12:19:01Z",
"patch_url": "https://github.com/psf/requests/pull/3862.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/3862"
} | true | [
"Sorry I missed that! Done."
] |
https://api.github.com/repos/psf/requests/issues/3861 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/3861/labels{/name} | https://api.github.com/repos/psf/requests/issues/3861/comments | https://api.github.com/repos/psf/requests/issues/3861/events | https://github.com/psf/requests/issues/3861 | 206,763,473 | MDU6SXNzdWUyMDY3NjM0NzM= | 3,861 | gevent + requests blocks when using socks | {
"avatar_url": "https://avatars.githubusercontent.com/u/4971925?v=4",
"events_url": "https://api.github.com/users/xsren/events{/privacy}",
"followers_url": "https://api.github.com/users/xsren/followers",
"following_url": "https://api.github.com/users/xsren/following{/other_user}",
"gists_url": "https://api.github.com/users/xsren/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/xsren",
"id": 4971925,
"login": "xsren",
"node_id": "MDQ6VXNlcjQ5NzE5MjU=",
"organizations_url": "https://api.github.com/users/xsren/orgs",
"received_events_url": "https://api.github.com/users/xsren/received_events",
"repos_url": "https://api.github.com/users/xsren/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/xsren/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/xsren/subscriptions",
"type": "User",
"url": "https://api.github.com/users/xsren",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2017-02-10T10:43:35Z | 2021-09-08T12:00:59Z | 2017-02-10T16:46:33Z | NONE | resolved | I use python(2.7.6),gevnet(1.1.2),requests(2.11.1) to make http requests concurrent, and it works good. But when I add socks proxy to requests, it blocks.
This is my code:
```
import time
import requests
import logging
import click
import gevent
from gevent import monkey
monkey.patch_all()
FORMAT = '%(asctime)-15s %(message)s'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger('test')
#socks proxy
user = MY_SOCKS_PROXY_USERNAME
password = MY_SOCKS_PROXY_PASSWORD
host = MY_SOCKS_PROXY_HOST
port = MY_SOCKS_PROXY_PORT
proxies = {
'http': 'socks5://{0}:{1}@{2}:{3}'.format(user, password, host, port),
'https': 'socks5://{0}:{1}@{2}:{3}'.format(user, password, host, port),
}
url = 'https://www.youtube.com/user/NBA'
def fetch_url(i,with_proxy):
while True:
logger.warning('thread %s fetch url'%i)
try:
if with_proxy:
res = requests.get(url,proxies=proxies, timeout=5)
else:
res = requests.get(url, timeout=5)
except Exception as e:
logger.error(str(e))
continue
logger.warning(res.status_code)
def do_other_thing():
while True:
logger.warning('do other thing...')
time.sleep(1)
@click.command()
@click.option('--with_proxy/--without_proxy',help='if use proxy', default=True)
def run(with_proxy):
if with_proxy:
logger.warning('with proxy......')
else:
logger.warning('without proxy......')
ts = []
ts.append(gevent.spawn(do_other_thing))
for i in xrange(3):
ts.append(gevent.spawn(fetch_url,i,with_proxy))
gevent.joinall(ts)
if __name__=='__main__':
run()
```
These pictures show the result.
[run with proxy](https://i.stack.imgur.com/RfTbM.png)
[run without proxy](https://i.stack.imgur.com/9UVVM.png)
>With proxy, do_other_thing will blocks before fetch_url done.
>Without proxy, it works good. (timeout error occurs, because of the GFW)
Can anyone help me solving this problem? Thanks very much! | {
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/3861/reactions"
} | https://api.github.com/repos/psf/requests/issues/3861/timeline | null | completed | null | null | false | [
"My best guess is that you are monkeypatching too late. When using gevent you must monkeypatch *first*, before importing anything else. Doing it later runs the risk of breaking anything that has done a `from` import from the things that gevent monkeypatches.\n\nCan you try moving your import and monkeypatch to the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.