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 far as I can see) downloadable from PyPI either.\r\n\r\nAll of this together suggests that adding optional libproxy support would provide minimal benefit: an overwhelming majority of users do not have access to libproxy, and we have no way to distribute it to them.\r\n\r\nMy suggestion, then, is that someone (anyone who wants to be helpful) starts distributing binary wheels of libproxy on PyPI. At that point, once there is a reliable distribution method, we can discuss how reasonable it is to have Requests migrate to use it. However, until that time it's just not practical for Requests to add that dependency.\r\n\r\nSorry! ",
"I think pypac (https://pypac.readthedocs.io/en/latest/) is offering this functionality, correct ?\r\nShould it be integrated / merged in some way to requests ?\r\nThe could allow a proxies=\"pac\" kind of functionality out of the box.",
"Yeah seems like it should work. I'll see if I can get it to function at work."
] |
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 searching the issues.\r\n\r\nAlthough its related to the Location header issue, when further digging into requests, I think it might be more of encoding issue.\r\n\r\nlooking at the following code (from [here](https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L122))\r\n\r\n```python\r\n # Handle redirection without scheme (see: RFC 1808 Section 4)\r\n if url.startswith('//'):\r\n parsed_rurl = urlparse(resp.url)\r\n url = '%s:%s' % (parsed_rurl.scheme, url)\r\n``` \r\n\r\non python2, `urlparse(u'http://google.com').scheme` is a unicode string.\r\nfor `urlparse('http://google.com').scheme` is an str.\r\n\r\non python2, when the original URL is unicode, it is parsed as `str % (unicode, str)` and the error occurs.\r\non python3, it is parsed as `str % (str, str)` and all is fine.\r\n\r\nIMHO, this specific issue (on handling RFC1808) can be fixed by adding `to_native_string(parsed_rurl.scheme)`.\r\n\r\n```python\r\n # Handle redirection without scheme (see: RFC 1808 Section 4)\r\n if url.startswith('//'):\r\n parsed_rurl = urlparse(resp.url)\r\n url = '%s:%s' % (to_native_string(parsed_rurl.scheme), url)\r\n```\r\n\r\nplease tell me what you think, if you think it is relevant I can open some PR with the change and the test.\r\n\r\nThanks,\r\nShmulik",
"As #3888 notes, it's an encoding issue that affects headers generally: it just tends to manifest most noticeably here.\r\n\r\nHowever, you're right that certain manifestations can be resolved by preventing an automatic decode of the header string on Python 2. I'd be willing to review and merge a PR for that failure that includes a test. 😁"
] |
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 <[email protected]>
|
{
"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** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/kennethreitz/requests/pull/3958?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #3958 +/- ##\n=======================================\n Coverage 89.61% 89.61% \n=======================================\n Files 15 15 \n Lines 1946 1946 \n=======================================\n Hits 1744 1744 \n Misses 202 202\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3958?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/kennethreitz/requests/pull/3958?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `85.02% <ø> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3958?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3958?src=pr&el=footer). Last update [f061fb7...1cd173a](https://codecov.io/gh/kennethreitz/requests/pull/3958?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"@Lukasa Done!"
] |
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 exclude the `Set-Cookie` header from joining in this way.",
"This has bitten us and cost us quite a few hours. I'd like to vote to leave `Set-Cookie` intact. Why does requests fiddle with the headers anyways? Is there some good reason for it? IMHO it only complicates things for everybody. What am I missing?\r\nThanks for your good work!",
"Hi, there is a way to parse headers correctly with https://github.com/Ousret/kiss-headers `requests` won't be able to change their representation for headers any time soon.",
"In order to access the unmerged header lines, use the underlying `urllib3` response object ([HTTPResponse](https://urllib3.readthedocs.io/en/latest/reference/urllib3.response.html#urllib3.response.HTTPResponse)):\r\n\r\n~~~py\r\nresp = requests.get('https://myurl.com')\r\nprint(resp.raw.headers.items())\r\n~~~\r\n\r\nYields (for example):\r\n\r\n~~~\r\n[('Cache-Control', 'no-store, no-cache, must-revalidate'),\r\n ('Cache-Control', 'post-check=0, pre-check=0'),\r\n ('Cache-Control', 'no-cache=\"set-cookie\"'),\r\n ('Content-Type', 'text/html; charset=utf-8'),\r\n ('Date', 'Tue, 22 Feb 2022 08:12:47 GMT'),\r\n ('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT'),\r\n ('Last-Modified', 'Tue, 22 Feb 2022 08:12:47 GMT'),\r\n ('Pragma', 'no-cache'),\r\n ('Server', 'Apache/2.4.27 (Amazon) PHP/5.6.35'),\r\n ('Set-Cookie', 'PHPSESSID=q0br22iudsfjjkshfakl54076m1; path=/; HttpOnly'),\r\n ('Set-Cookie', 'lan=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=mydomain.com'),\r\n ...]\r\n~~~",
"In my case, I had to do `response.raw.headers`, adding `.items()` at the end returns an empty `HTTPHeaderDictItemView`.",
"I'm closing this with [the above solution](https://github.com/psf/requests/issues/3957#issuecomment-1047539652) because it's unlikely we'll be changing our Response object anytime soon."
] |
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** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #3956 +/- ##\n=======================================\n Coverage 89.61% 89.61% \n=======================================\n Files 15 15 \n Lines 1946 1946 \n=======================================\n Hits 1744 1744 \n Misses 202 202\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.42% <ø> (ø)` | :arrow_up: |\n| [requests/api.py](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=tree#diff-cmVxdWVzdHMvYXBpLnB5) | `81.81% <ø> (ø)` | :arrow_up: |\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `92.93% <ø> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=footer). Last update [342096a...ead8fba](https://codecov.io/gh/kennethreitz/requests/pull/3956?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"> Using raw strings for docstrings tends to surprise people.\r\n\r\nHow so?",
"> My experience has been that people don't really grasp that you can prefix the string literal for docstrings, so they expect them to be plain strings.\r\n\r\nMy (admittedly anecdotal) experience has been with tools that suggest using raw-strings for this exact use-case (e.g., pydocstyle, etc.). *shrug* I don't particularly care either way.",
"I personally prefer raw strings, they remove any ambiguity and make it clear that escape sequences do not work inside the string. They also remove noise which makes them easier to read. But I don't really care either.\r\n\r\nShould I squash this commits or is it fine this way?",
"Squashing the commits might be nice.",
"I'm not partial to either approach but as a data point [PEP257](https://www.python.org/dev/peps/pep-0257/#what-is-a-docstring) seems to suggest raw docstrings are the way to go in the case of backslashes.\r\n\r\n> Use r\"\"\"raw triple double quotes\"\"\" if you use any backslashes in your docstrings.",
"Hrm. I'll accept that as a preponderance of evidence that I'm an idiot then. ;) I'm outvoted 2-to-1, so back to raw strings we go. Sorry @rubendura!",
"No worries. I'll revert that now.",
"Done. Should be ready now :)",
"Yup, looks good. Thanks @rubendura!"
] |
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 doesn't the owner mint a valid certificate?",
"In this case the hostname is generic and the same in multiple configurations that will have different certificates - the certificate is specific to the environment. So the desktop client (which is outside of the environment) uses the ip address to connect. I disagree that this doesn't have utility. Another case is with mobile applications where the app does the verification. There is less reason to \"mint a valid certificate\" if the app itself is in charge of validating that certificate. ",
"> There is less reason to \"mint a valid certificate\" if the app itself is in charge of validating that certificate.\r\n\r\nThis is where I don't agree. If you are capable of getting a TLS certificate that will chain to an appropriate trust root, it should be essentially a trivial amount of extra work to ensure that that the certificate will also pass hostname validation.\r\n\r\nRegardless, Requests is not going to add an option for this. You can use a Transport Adapter to pass urllib3 a fingerprint to use the validate the certificate for any of these connections if that's what you'd rather do, or you can do the same to disable hostname validation in urllib3, but requests isn't going to add a high-level switch to enable this functionality. Its use in 99%+ of cases would be dangerous.",
"That's what I'm saying the certificate is not chained to the trust root. It's validated by the app only. There is less need for the chain of trust if the app itself is validating the cert. ",
"If the certificate is not chained to a trust root then it won't pass cert validation *at all*, and so you'd need to pass `verify=False`.",
"Yes, the point is there are other ways to validate a cert. chained to a trust root is one that is used a lot, but it's not the only way. Cert pinning is another way. \r\n",
"Sure, and `verify=False` exists to satisfy those use cases. Why is `verify=False` insufficient for you?",
" Well in this case I'd have to add it at the application level or fork the library I'm using. ",
"Hang on, let's stop back for a moment.\r\n\r\nYour feature request, as I originally understood it, was to disable hostname verification *only*. I assumed, from the nature of that question, that disabling verification *entirely* was insufficient. That appears to be wrong: your follow-up responses appear to me say that that would be fine. I think this means I don't understand what you want. :smile:\r\n\r\nSo let's step back so that I can better understand your problem. You are using pykube, correct? Your problem, as I understand it, is that you would like to disable certificate validation *entirely* so that you can use untrusted certificates with pykube, because you plan to validate them some other way. Your last comment suggests that you would like a way to do that that does not involve touching pykube. Does all of that sound correct, or have I misunderstood?",
"I don't think we really want to turn verify off as it is using client certificates. I think it's using the filename path to a CA Bundle for validation. The host in the cert bundle simply doesn't match what's in the k8s config file, as by default it uses the IP :/",
"Hrm. Is it worth resolving this by adding a hosts file entry instead? Alternatively, does the remote cert have the appropriate iPAddress subject alternative name field?",
"The discussion here has stalled for months and there's very little clarity on what's desired. I'm happy to reopen this, but for now I'm closing this."
] |
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/python3.6/site-packages/requests/api.py:67: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/api.py:80: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/api.py:93: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/api.py:108: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/api.py:122: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/api.py:136: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/api.py:148: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/sessions.py:498: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/sessions.py:509: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/sessions.py:520: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/sessions.py:533: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/sessions.py:544: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/sessions.py:555: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/venv/lib/python3.6/site-packages/requests/sessions.py:565: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n```",
"Yup, so these almost all seem to be in docstrings where the backslashes should be being doubled-up. Anyone who likes to is welcome to submit a PR to remove these.",
"(By the way, that \"anyone who likes to\" includes yourself @rubendura! Just wanted to make sure that you didn't think I was excluding you.)",
"I am on it. I just forked the repo ;)",
"For some reason I can't get the deprecation warnings to show when running the tests against the requests test suite.\r\nI tried running them as shown in http://docs.python-requests.org/en/latest/dev/todo/#development-dependencies\r\nBut doing that doesn't allow me (or I don't know how) to pass the -Wd option to python, so I tried running them as \r\n```~/.local/share/virtualenvs/requests-ThIWAgEP/bin/python -Wd setup.py test```\r\n\r\nThat seems to run them and displays DeprecationWarnings in other packages, but not on requests.\r\n\r\nI want to get them against master and not use the warnings from my project because there could (and will) be differences in the source code for requests. Also this will show me how to set up my env in case I wanted to contribute to requests in the future.\r\n\r\nSome help would be appreciated.",
"The easiest thing to do is to note that `py.test` is a Python script, and so you can do `python $(which py.test)` which should get you closer.",
"Won't `python -m pytest` work?",
"Thanks. But that gets me the same output. No DeprecationWarnings for requests when there should be some.\r\n\r\nBelow the full output of the command (I activated the venv created by pipenv before running it):\r\n\r\n```\r\n(requests-ThIWAgEP) ✘ ~/src/requests master ● python -Wd $(which py.test)\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/bin/../lib/python3.6/site.py:165: DeprecationWarning: 'U' mode is deprecated\r\n f = open(fullname, \"rU\")\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:7: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses\r\n import imp\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_httpbin/plugin.py:4: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import serve, certs\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/plugin.py:8: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import embed\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/plugin.py:9: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import engine\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/engine.py:11: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from .compat import StringIO\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/plugin.py:10: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import compat\r\n============================================================================================================================= test session starts ==============================================================================================================================\r\nplatform darwin -- Python 3.6.1, pytest-3.0.7, py-1.4.33, pluggy-0.4.0\r\nrootdir: /Users/ruben/src/requests, inifile:\r\nplugins: mock-1.6.0, httpbin-0.0.7, cov-2.4.0\r\ncollected 483 items\r\n\r\ntests/test_hooks.py ...\r\ntests/test_lowlevel.py ............\r\ntests/test_requests.py ............................................................................................................................................................X................X.......................................................................................\r\ntests/test_structures.py ...........................\r\ntests/test_testserver.py ...........\r\ntests/test_utils.py ..s......................................................................................................................................................................\r\n\r\n============================================================================================================== 480 passed, 1 skipped, 2 xpassed in 54.42 seconds ===============================================================================================================\r\n```\r\n\r\nAs you can see requests DeprecationWarnings are not being shown, but I don't get why.",
"@sigmavirus24 Yup, that also works but gives the exact same result as it should be doing the same.",
"That's odd. Do you see them if you just import the code?",
"No luck\r\n\r\n```\r\n(requests-ThIWAgEP) ~/src/requests master ● python -Wd\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/bin/../lib/python3.6/site.py:165: DeprecationWarning: 'U' mode is deprecated\r\n f = open(fullname, \"rU\")\r\nPython 3.6.1 (default, Mar 23 2017, 16:49:06)\r\n[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>>\r\n```",
"Ok, so that suggests that the deprecation warning there is either not coming from Requests or not valid in the current master branch.",
"So I thought, but it's easy to find an example where that still happens. For example, in requests/models.py:862 there is a tripe-quoted doc string containing an invalid escape sequence \"\\\\*\".\r\n\r\nUnless I'm getting something wrong, that should be flagged as a DeprecationWarning in Python 3.6",
"That's very interesting",
"Sure, but it isn't. ;) So...what is going on?",
"Funny, I had to escape \\ in that comment before for GitHub not to escape \\ 😅",
"I tried running the same with -Wa and adding a random line to the code containing a few escape squences and still no luck. Running out of ideas here :S",
"OH! I wonder if you have to remove all the *.pyc files in the repo and any `__pycache__` directories. Want to try that?",
"No luck with that. I started to wonder if py.test does something with Warnings and came across this:\r\nhttps://docs.pytest.org/en/features/warnings.html#ensuring-function-triggers\r\n\r\nI can't figure out if that has something to do with it or not. My guess is that the problem lies somewhere else because DeprecationWarnings were not seen when importing requests.",
"Yeah, my assumption is that py.test does not by default suppress these. But I have no idea why you aren't seeing them.",
"Ok, this is interesting. If I interrupt py.test with Ctrl+C DeprecationWarnings will be printed. Compare this two sessions.\r\n\r\nWithout Ctrl+C\r\n```\r\n(requests-ThIWAgEP) ✘ ~/src/requests master ● python -Wall -m pytest\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/bin/../lib/python3.6/site.py:165: DeprecationWarning: 'U' mode is deprecated\r\n f = open(fullname, \"rU\")\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:7: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses\r\n import imp\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_httpbin/plugin.py:4: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import serve, certs\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/plugin.py:8: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import embed\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/plugin.py:9: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import engine\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/engine.py:11: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from .compat import StringIO\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/plugin.py:10: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import compat\r\n============================================================================================================================= test session starts ==============================================================================================================================\r\nplatform darwin -- Python 3.6.1, pytest-3.0.7, py-1.4.33, pluggy-0.4.0\r\nrootdir: /Users/ruben/src/requests, inifile:\r\nplugins: mock-1.6.0, httpbin-0.0.7, cov-2.4.0\r\ncollected 483 items\r\n\r\ntests/test_hooks.py ...\r\ntests/test_lowlevel.py ............\r\ntests/test_requests.py ............................................................................................................................................................X...............127.0.0.1 - - [05/Apr/2017 15:28:27] \"GET /stream/4 HTTP/1.1\" 200 1080\r\n.X.......................................................................................\r\ntests/test_structures.py ...........................\r\ntests/test_testserver.py ...........\r\ntests/test_utils.py ..s......................................................................................................................................................................\r\n\r\n============================================================================================================== 480 passed, 1 skipped, 2 xpassed in 54.95 seconds ===============================================================================================================\r\n```\r\n\r\n\r\nWith Ctrl+C\r\n```\r\n(requests-ThIWAgEP) ✘ ~/src/requests master ● python -Wall -m pytest\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/bin/../lib/python3.6/site.py:165: DeprecationWarning: 'U' mode is deprecated\r\n f = open(fullname, \"rU\")\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:7: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses\r\n import imp\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_httpbin/plugin.py:4: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import serve, certs\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/plugin.py:8: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import embed\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/plugin.py:9: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import engine\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/engine.py:11: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from .compat import StringIO\r\n/Users/ruben/.local/share/virtualenvs/requests-ThIWAgEP/lib/python3.6/site-packages/pytest_cov/plugin.py:10: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n from . import compat\r\n============================================================================================================================= test session starts ==============================================================================================================================\r\nplatform darwin -- Python 3.6.1, pytest-3.0.7, py-1.4.33, pluggy-0.4.0\r\nrootdir: /Users/ruben/src/requests, inifile:\r\nplugins: mock-1.6.0, httpbin-0.0.7, cov-2.4.0\r\ncollected 483 items\r\n\r\ntests/test_hooks.py ...\r\ntests/test_lowlevel.py .^Csource:69: DeprecationWarning: invalid escape sequence \\*\r\nsource:82: DeprecationWarning: invalid escape sequence \\*\r\nsource:95: DeprecationWarning: invalid escape sequence \\*\r\nsource:110: DeprecationWarning: invalid escape sequence \\*\r\nsource:124: DeprecationWarning: invalid escape sequence \\*\r\nsource:138: DeprecationWarning: invalid escape sequence \\*\r\nsource:150: DeprecationWarning: invalid escape sequence \\*\r\nsource:508: DeprecationWarning: invalid escape sequence \\*\r\nsource:519: DeprecationWarning: invalid escape sequence \\*\r\nsource:530: DeprecationWarning: invalid escape sequence \\*\r\nsource:543: DeprecationWarning: invalid escape sequence \\*\r\nsource:554: DeprecationWarning: invalid escape sequence \\*\r\nsource:565: DeprecationWarning: invalid escape sequence \\*\r\nsource:575: DeprecationWarning: invalid escape sequence \\*\r\n\r\n\r\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nto show a full traceback on KeyboardInterrupt use --fulltrace\r\n/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py:586: KeyboardInterrupt\r\n=========================================================================================================================== 4 passed in 2.06 seconds ===========================================================================================================================\r\n```\r\n\r\nI don't know what's going on there, but looks like py.test might be somehow interfering with it.",
"So...why does running python itself exhibit the same behaviour?",
"I have no clue and it's really triggering me. Still investigating.\r\n\r\nHave you been able to reproduce it on your side?",
"Nope, I get the relevant output. Feel free to use it:\r\n\r\n```\r\n/Users/cory/Documents/Python/requests_org/requests/requests/models.py:866: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/api.py:69: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/api.py:82: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/api.py:95: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/api.py:110: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/api.py:124: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/api.py:138: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/api.py:150: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/sessions.py:508: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/sessions.py:519: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/sessions.py:530: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/sessions.py:543: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/sessions.py:554: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/sessions.py:565: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n/Users/cory/Documents/Python/requests_org/requests/requests/sessions.py:575: DeprecationWarning: invalid escape sequence \\*\r\n \"\"\"\r\n```",
"I managed to get the warnings on my system by deleting ```__pycache__``` as you suggested and importing the package. Not deleting ```__pycache__``` or running the test suite was hiding those messages from me."
] |
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 = requests.get(url, stream=True, headers={'Accept-Encoding': None})\r\n```\r\n\r\nThen you get your `Content-Length` header. This has been a header that's been set for quite a long time (I think since around when 1.0 was released) so you must have last used this years ago. I hope this helps.\r\n\r\nCheers!\r\nIan",
"@sigmavirus24 you're the best, thanks - I totally missed this. 👍 ",
"@sigmavirus24 sorry for mention. I still have this issue even when using your suggest.\r\n\r\nfor example when I want to get content-length from this image link\r\n\r\nhttps://kenhsinhvien.vn/topic/conan-chap-699-tieng-viet.371791/ there is no result\r\n\r\nCould you please give some advice?",
"@quyleanh it's possible that server doesn't send the content length ever. Some servers prefer not to calculate that if possible. Regardless, this isn't a question and answer support forum and you'll have better luck on stack overflow",
"@sigmavirus24 thank you for replying. Actually I have already asked on [stackoverflow](https://stackoverflow.com/questions/62496190/).\r\nThe thing is although I cannot get the `Content-Length` with `get` method, I still can get with `head` method. So the server sent the content length, right? Then what is the problem?\r\nYou can try with the link I send above.",
"You need to add Content-Encoding param , in my case only with this works, and content-length is not zero\r\n\r\n`r = requests.get(url, stream=True, headers={'Accept-Encoding': None, 'Content-Encoding':'gzip' })`"
] |
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** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/kennethreitz/requests/pull/3952?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #3952 +/- ##\n======================================\n Coverage 89.6% 89.6% \n======================================\n Files 15 15 \n Lines 1944 1944 \n======================================\n Hits 1742 1742 \n Misses 202 202\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3952?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/pull/3952?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `92.93% <ø> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3952?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3952?src=pr&el=footer). Last update [993cbf5...a63ae02](https://codecov.io/gh/kennethreitz/requests/pull/3952?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments)."
] |
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/993cbf57419fca7562ff0990df1bd32f748a9bfe/requests/adapters.py#L247\r\n\r\nDo you think this justifies a documentation example? ",
"It can also be provided per call to requests.*. This is documented in [the docs](http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification), but could be expanded on I think.",
"opened a PR, it was probably just me missing the obvious. but hopefully this helps the next person!",
"Improvement in documentation clarity is always helpful!"
] |
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're receiving the redirect url which ends with `gewäsch-und#_=_` as the already `latin-1` encoded byte sequence `gew\\xc3\\xa4sch-und#_=_`. This allows the redirect to succeed because that's the correct encoding for the address.\r\n\r\nIn Python 3, it stores the strings as `utf-8` by default, which when decoded back to bytes ends with the utf-8 equivalent byte sequence `gew\\xc3\\x83\\xc2\\xa4sch-und#_=_`. This is causing the redirect to continuously loop because the utf-8 encoding isn't correct.\r\n\r\nFor the time being, you should be able to manually encode the redirect headers containing non-ascii characters as `latin-1` bytes in Python 3. That's obviously not ideal, but seems to be the only thing we can suggest at present.",
"Yeah, I'm closing this as a dupe. The suggested fix on #3888 should be the direction we go. ",
"Okay, thanks for suggesting a workaround. For so. else here's a workaround using the information above:\r\n```\r\nimport requests\r\nfrom requests import exceptions\r\n\r\nurl=\"http://ansgar-skoda.tumblr.com/post/96703389502\"\r\n\r\ntry:\r\n r = requests.get(url)\r\nexcept exceptions.TooManyRedirects as t:\r\n # see https://github.com/kennethreitz/requests/issues/3949\r\n r = requests.get(url, allow_redirects=False)\r\n latin1_location = r.headers['Location'].encode('latin1')\r\n r = requests.get(latin1_location)\r\n \r\nprint('========')\r\nprint(r.status_code)\r\nprint(r.headers)\r\n```\r\n"
] |
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 versions?",
"2.11.1 when working, and 2..12.5 inside the container. Does it make any difference?",
"Yeah, there are some decent code changes between those two versions. Want to try downgrading to 2.11 quickly in the container to see what happens?",
"Still failing, but with a different error message\r\n...\r\n...\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 491, in send\r\n raise SSLError(e, request=request)\r\nSSLError: EOF occurred in violation of protocol (_ssl.c:590)\r\n\r\n",
"Hrm. That different error is pretty much the same error. Can you reveal to us what web server you're trying to contact?",
"Thats my own server, which has a self signed certificate. I am sending verify=False to ignore SSL but doesnt seem to like it\r\n\r\nresponse=sess.post(url,params, headers=h,verify=False)",
"Can you show the TLS configuration for your server, and what OpenSSL version it is linked against?",
"Its TLS 1.2 and same openSSL version... nothing special. I dont think there\nis anything wrong on server side as it works fine outside the docker\ncontainer\n\nOn Fri, Mar 31, 2017 at 4:07 PM, Cory Benfield <[email protected]>\nwrote:\n\n> Can you show the TLS configuration for your server, and what OpenSSL\n> version it is linked against?\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/kennethreitz/requests/issues/3948#issuecomment-290738188>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AMK55o2K5PaiflW3wHWD_rZYm_WFXXGyks5rrRa6gaJpZM4Mvjzc>\n> .\n>\n",
"So, \"wrong\" here is defined only in whether there is a mismatch between what the client and server expect. Out of interest, does your server expect SNI? Are you reaching your server via hostname or IP?",
"In that container, can you curl your server with the same URL? Or even just telnet to it? I wonder if requests can even reach the server from where you've deployed the container.",
"Hi\n\nIn response to both. it expects SNI and i reach it via hostname\n\nFrom the container i can telnet to the server, there is no problem with\nthat. I have exposed another service via http and it works fine, its purely\nthe SSL handshake what is failing\n\nOn Fri, Mar 31, 2017 at 4:16 PM, Ian Cordasco <[email protected]>\nwrote:\n\n> In that container, can you curl your server with the same URL? Or even\n> just telnet to it? I wonder if requests can even reach the server from\n> where you've deployed the container.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/kennethreitz/requests/issues/3948#issuecomment-290740743>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AMK55kVKzprqGA1n1PKJznWX_g_V7nsxks5rrRi-gaJpZM4Mvjzc>\n> .\n>\n",
"Ok, what's the result of running `openssl s_client -connect host:port` to your server from inside the container?",
"Hi\n\nIt connects without any issue (connected(00003))\n\nOn Fri, Mar 31, 2017 at 4:19 PM, Cory Benfield <[email protected]>\nwrote:\n\n> Ok, what's the result of running openssl s_client -connect host:port to\n> your server from inside the container?\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/kennethreitz/requests/issues/3948#issuecomment-290741631>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AMK55oeDzw5HhrujLbMFLA6CCowT0umwks5rrRmLgaJpZM4Mvjzc>\n> .\n>\n",
"Sorry, the *whole* result. I'm interested in what the result of the negotiation is.",
"Verify return code: 19 (self signed certificate in certificate chain)\n\nOn Fri, Mar 31, 2017 at 4:34 PM, Cory Benfield <[email protected]>\nwrote:\n\n> Sorry, the *whole* result. I'm interested in what the result of the\n> negotiation is.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/kennethreitz/requests/issues/3948#issuecomment-290746053>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AMK55o4JyAkpP5h1ZPLBOkRONN2z9Em8ks5rrRz-gaJpZM4Mvjzc>\n> .\n>\n",
"That is not the whole result. Please copy and paste everything from that command.",
"No, the *whole* result. All the output. Everything it prints.",
"There is nothing else interesting there, just tls version, cert info etc...\n\nIm having exactly the same response outside the container\nEl El vie, 31 mar 2017 a las 16:40, Cory Benfield <[email protected]>\nescribió:\n\n> No, the *whole* result. All the output. Everything it prints.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/kennethreitz/requests/issues/3948#issuecomment-290747930>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AMK55iD8dY2eDxdfz1j0YzpteN8ThFJ3ks5rrR58gaJpZM4Mvjzc>\n> .\n>\n",
"That information is exactly what I am interested in. Something in our TLS Client Hello is making your server mad, and so I'm interested in seeing what your server is negotiating.",
"Ok, lets do something to be sure its not my certificate. I will search any\nother page that uses a self signed certificate ( if you know of any please\nshare) and i will try against that, so you will be able to connect that\nserver too\n\nEl El vie, 31 mar 2017 a las 16:46, Cory Benfield <[email protected]>\nescribió:\n\nThat information is exactly what I am interested in. Something in our TLS\nClient Hello is making your server mad, and so I'm interested in seeing\nwhat your server is negotiating.\n\n—\nYou are receiving this because you authored the thread.\nReply to this email directly, view it on GitHub\n<https://github.com/kennethreitz/requests/issues/3948#issuecomment-290749603>,\nor mute the thread\n<https://github.com/notifications/unsubscribe-auth/AMK55oT_6jlrkIO4VlXRsoohjEGzNy3pks5rrR_TgaJpZM4Mvjzc>\n.\n",
"It's not your certificate. The error message in question (Unexpected EOF) means that during the TLS handshake the *server has sent us* a TCP FIN or RST packet. That means the *server* has chosen to close the connection, not us. That means the *server* has decided we are not doing something it likes. As a result, this cannot be the fault of your certificate: we haven't gotten to the point of validating it yet.",
"@javixeneize without the information we've asked you for, I'm not sure what else we can do to help.",
"Ok ok... i will provide that on monday\nEl El vie, 31 mar 2017 a las 17:19, Ian Cordasco <[email protected]>\nescribió:\n\n> @javixeneize <https://github.com/javixeneize> without the information\n> we've asked you for, I'm not sure what else we can do to help.\n>\n> —\n> You are receiving this because you were mentioned.\n>\n>\n> Reply to this email directly, view it on GitHub\n> <https://github.com/kennethreitz/requests/issues/3948#issuecomment-290759070>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AMK55ugTXZp-cZpp9JJJ7WmACcYXho2Rks5rrSeegaJpZM4Mvjzc>\n> .\n>\n",
"```\r\nroot@4f66ccbaef3c:/# openssl s_client -connect api.quinto.ai:443\r\nCONNECTED(00000003)\r\ndepth=2 O = Digital Signature Trust Co., CN = DST Root CA X3\r\nverify return:1\r\ndepth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3\r\nverify return:1\r\ndepth=0 CN = fbbot.quintoapp.com\r\nverify return:1\r\n---\r\nCertificate chain\r\n 0 s:/CN=fbbot.quintoapp.com\r\n i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3\r\n 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3\r\n i:/O=Digital Signature Trust Co./CN=DST Root CA X3\r\n---\r\nServer certificate\r\n-----BEGIN CERTIFICATE-----\r\nMIIFCjCCA/KgAwIBAgISA1Bg18LrjA3qyyrEDmzE+5YSMA0GCSqGSIb3DQEBCwUA\r\nMEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD\r\nExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xNzAzMTQwNzMyMDBaFw0x\r\nNzA2MTIwNzMyMDBaMB4xHDAaBgNVBAMTE2ZiYm90LnF1aW50b2FwcC5jb20wggEi\r\nMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQD0xbEa4W4k4BlPrIxeVX+ekPl1\r\nOd4OuwepY5Ha2BQd6YMiphh+we5H6JVu2XDuPbQnmQMtEwGa2T2Adhic4bGPPC7+\r\n0j+utJuqGBRIbYJ09A5EQOhB4HhOSI82l1ZpPkHpvOiC4UoEgG4KOLnqBX0JydI3\r\n8vhiV4EgbLr77wARsEeinK+Zj+7bpsEK8q+B7mR5km6f6tKT/i++Wd4Fx3Pz7iuK\r\naCulKzG4IMxopE/9DDf608H/3cFcSHvg/4IguPoOCx2ArNKE7QCNFGYAx9HhnV2y\r\nAYVbd2WGWeJKuNWEwCF+nvxGDo4cHdT6kq9HHB6kPTYrZb7PrKtkq1C3MNB/AgMB\r\nAAGjggIUMIICEDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEG\r\nCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFENiqFyUkXGaxd/woyxi\r\n6SqQz2WqMB8GA1UdIwQYMBaAFKhKamMEfd265tE5t6ZFZe/zqOyhMHAGCCsGAQUF\r\nBwEBBGQwYjAvBggrBgEFBQcwAYYjaHR0cDovL29jc3AuaW50LXgzLmxldHNlbmNy\r\neXB0Lm9yZy8wLwYIKwYBBQUHMAKGI2h0dHA6Ly9jZXJ0LmludC14My5sZXRzZW5j\r\ncnlwdC5vcmcvMB4GA1UdEQQXMBWCE2ZiYm90LnF1aW50b2FwcC5jb20wgf4GA1Ud\r\nIASB9jCB8zAIBgZngQwBAgEwgeYGCysGAQQBgt8TAQEBMIHWMCYGCCsGAQUFBwIB\r\nFhpodHRwOi8vY3BzLmxldHNlbmNyeXB0Lm9yZzCBqwYIKwYBBQUHAgIwgZ4MgZtU\r\naGlzIENlcnRpZmljYXRlIG1heSBvbmx5IGJlIHJlbGllZCB1cG9uIGJ5IFJlbHlp\r\nbmcgUGFydGllcyBhbmQgb25seSBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIENlcnRp\r\nZmljYXRlIFBvbGljeSBmb3VuZCBhdCBodHRwczovL2xldHNlbmNyeXB0Lm9yZy9y\r\nZXBvc2l0b3J5LzANBgkqhkiG9w0BAQsFAAOCAQEAf80at95dsb9WsSMaChtKNEJR\r\nFfuPd/5MZaqFxWM6+AtEGZt2qbeOExIShEHFehUSWQnrCBTiPY6ildK1E5nhduap\r\n4K0O7FrnMVaNBhnoBT7jsZMs7ivLpaKCT6imR71hQTUv07xw1kQJMu/jrHHtVjNi\r\n9iI+VryZeETIVBtCXbirwKxT0JYLicdS/9M9m9wC7/H8xWVkcRR5dMI2Im+4klX4\r\neGmgi+XCJPkDZZEpfQHmIqQQ9ccCpP0BFs0JqfwLich71NdPihVnJDhVZrEVMcgs\r\n+412WdWCOTIXrEzsL6xddypVETY2k5Z3S8sZTInWA9nYOGHW82xwh6/tRU+yiQ==\r\n-----END CERTIFICATE-----\r\nsubject=/CN=fbbot.quintoapp.com\r\nissuer=/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3\r\n---\r\nNo client certificate CA names sent\r\nPeer signing digest: SHA512\r\nServer Temp Key: ECDH, P-256, 256 bits\r\n---\r\nSSL handshake has read 3157 bytes and written 433 bytes\r\n---\r\nNew, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-GCM-SHA256\r\nServer public key is 2048 bit\r\nSecure Renegotiation IS supported\r\nCompression: NONE\r\nExpansion: NONE\r\nNo ALPN negotiated\r\nSSL-Session:\r\n Protocol : TLSv1.2\r\n Cipher : ECDHE-RSA-AES128-GCM-SHA256\r\n Session-ID: 78B1ABFE5A7BF1E698FB5D43D1A75D6F874DD9D2E12816E3276B349FC0C4B96B\r\n Session-ID-ctx:\r\n Master-Key: B6EE0F224CB1A93379B86524E9F01D618A018E2F1D68F5AB29F7570611F0D9CF4210F9946335A9FAAEEA143B0BC98D26\r\n Key-Arg : None\r\n PSK identity: None\r\n PSK identity hint: None\r\n SRP username: None\r\n TLS session ticket lifetime hint: 300 (seconds)\r\n TLS session ticket:\r\n 0000 - 00 39 b1 81 4d f9 90 0a-b2 dd a8 e7 b5 6b 74 7c .9..M........kt|\r\n 0010 - ba 4e 8b 51 75 df c4 ae-e1 6c dc 3e 05 a1 0e fc .N.Qu....l.>....\r\n 0020 - 4e 61 83 34 f4 ea 06 b7-8d 54 82 01 a8 b2 fa 2a Na.4.....T.....*\r\n 0030 - 48 69 01 b5 06 6b ee 18-3d 93 f5 d7 31 d8 66 8f Hi...k..=...1.f.\r\n 0040 - a4 6f f4 6c 2d 48 37 9f-33 b7 36 49 39 1f 2f 31 .o.l-H7.3.6I9./1\r\n 0050 - 1a 0d 8f 8e 34 36 3d d1-09 fb 6b 5b 5d 68 80 3e ....46=...k[]h.>\r\n 0060 - 66 d9 44 11 4d 12 d5 cc-df eb c3 45 ae 04 10 56 f.D.M......E...V\r\n 0070 - 34 ad 98 8f f9 1b f2 33-00 a4 b3 3c a5 40 80 8e 4......3...<.@..\r\n 0080 - 9b f1 b5 40 e5 2b 29 86-7e 2b f6 95 03 4b e3 b4 ...@.+).~+...K..\r\n 0090 - ab 16 25 bc 47 bf fb 87-dc 13 0e 10 a8 1b 18 fb ..%.G...........\r\n 00a0 - 3b 65 07 96 05 ce 1a c2-9a d4 d8 73 fd 38 40 8b ;e.........s.8@.\r\n 00b0 - 0e 52 df 26 19 fc 9f 04-06 28 b3 25 5c e2 64 51 .R.&.....(.%\\.dQ\r\n\r\n Start Time: 1496212705\r\n Timeout : 300 (sec)\r\n Verify return code: 0 (ok)\r\n---\r\nread:errno=0\r\n```",
"What's your actual problem @harry1064?",
"@Lukasa if you see the above result of `openssl s_client -connect api.quinto.ai:443` command i ran inside docker container running on my server, You will see CN to be fbbot.quintoapp.com which is pointing to host server where my docker container is running.\r\nBut the same command i ran on host server, CN was api.quinto.ai.\r\nSo basically, i have a python server running on docker container and i want to make request to another server api.quinto.ai but I am not not able to do that using requests. Same python code i ran on interpreter on host machine, that is working fine but when i log in to docker container and ran same code from inside the python interpreter, its not working",
"By default OpenSSL s_client does not present the server name indication field, which means that the remote server will present whatever certificate it chooses. Do you get the same output in both cases if you change your command to:\r\n\r\n```\r\nopenssl s_client -connect api.quinto.ai:443 -servername api.quinto.ai\r\n```\r\n\r\nEven if you don't, this sounds like a problem with docker, not with Requests: you appear to be reproducing a problem using the openssl command line, which doesn't use Requests in any way. So I'm not sure how you want us to solve your problem."
] |
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 replicate that behaviour yourself in two lines of code.\n\nWe added it only because the simple use of JSON was a neat shortcut that most users would find helpful. For more advanced uses, we strongly recommend just rolling your own.\n\nIs that likely to work out for you?",
"Yeah sounds reasonable, that's probably a line more code on my side to just\ndump the json myself, and keeps the library conceptually simpler.\n\n:+1:\n\nOn Fri, Mar 31, 2017 at 12:24 AM, Cory Benfield <[email protected]>\nwrote:\n\n> So, we absolutely can do that, but ultimately I'm not sure that the value\n> proposition is worth it. In 99% of use-cases the JSON argument literally\n> only does json.dumps and then sets the Content-Type header to\n> application/json. If you're not setting the JSON field *and* some other\n> fields, you can totally replicate that behaviour yourself in two lines of\n> code.\n>\n> We added it only because the simple use of JSON was a neat shortcut that\n> most users would find helpful. For more advanced uses, we strongly\n> recommend just rolling your own.\n>\n> Is that likely to work out for you?\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/kennethreitz/requests/issues/3947#issuecomment-290637261>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ARTsilP7WEVWcFaatRHlciSUbnMNIe6Iks5rrKoigaJpZM4MvKsR>\n> .\n>\n"
] |
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 pointer at 2.13. I tried that one and the same problem occurred. Then I realized that it only happens when I use the `--system-site-packages` argument to `virtualenv`. I'll need to do more digging to find out what's going on here.",
"Oh that's very interesting. It's possible that the delay you're seeing is actually to do with PyOpenSSL, which has in some older versions had very long import times."
] |
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_unicode=True):\r\n print(type(chunk), repr(chunk[:50]))\r\n break\r\n\r\nresponse = requests.get('https://s3-us-west-2.amazonaws.com/org.mozilla.crash-stats.symbols-public/v1/ntdll.pdb/120028FA453F4CD5A6A404EC37396A582/ntdll.sym', stream=True)\r\nfor chunk in response.iter_content(100, decode_unicode=True):\r\n print(type(chunk), repr(chunk[:50]))\r\n break\r\n```\r\nYields\r\n```\r\n▶ python3.5 test.py\r\n<class 'str'> 'MODULE windows x86 D74F79EB1F8D4A45ABCD2F476CCABAC'\r\n<class 'bytes'> b'MODULE windows x86 120028FA453F4CD5A6A404EC37396A5'\r\n```",
"Err... Nevermind. It was my wrongful assumption that both files were UTF-8 encoded and that that's exposed in some header. They might very well be UTF-8 but S3's download headers doesn't not expose that. \r\n\r\nI can manually set the response encoding, before I consume the stream, with \r\n\r\n```python\r\nresponse = requests.get('https://s3-us-west-2.amazonaws.com/org.mozilla.crash-stats.symbols-public/v1/ntdll.pdb/120028FA453F4CD5A6A404EC37396A582/ntdll.sym', stream=True)\r\nresponse.encoding = 'utf-8'\r\nfor chunk in response.iter_content(100, decode_unicode=True):\r\n print(type(chunk), repr(chunk[:50]))\r\n break\r\n```\r\nNow it works. "
] |
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://apidata.mos.ru/v1/{0}'.format(method), json=data_list)\r\nprint response.url\r\n\r\nif response.status_code == 200:\r\n pprint.pprint(response.json())\r\nelse: # TODO - use custom exceptions\r\n message = \"A request to the DataMos API was unsuccessful. The server returned HTTP {0} {1}.\"\r\n print message.format(response.status_code, response.reason)\r\n```",
"It's work. Thank you:)))"
] |
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** coverage by `0.01%`.\n> The diff coverage is `83.33%`.\n\n[](https://codecov.io/gh/kennethreitz/requests/pull/3943?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #3943 +/- ##\n==========================================\n- Coverage 89.6% 89.58% -0.02% \n==========================================\n Files 15 15 \n Lines 1944 1950 +6 \n==========================================\n+ Hits 1742 1747 +5 \n- Misses 202 203 +1\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3943?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/kennethreitz/requests/pull/3943?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `92.55% <83.33%> (-0.27%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3943?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3943?src=pr&el=footer). Last update [993cbf5...1be6a17](https://codecov.io/gh/kennethreitz/requests/pull/3943?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"I've added copies of the existing timeout tests using Timeout() objects instead of timeout tuples.",
"Great, thanks so much!"
] |
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 maintain this for backwards compatibility.\r\n\r\nThanks for taking the time to check in on this though!"
] |
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-Encoding, Connection. We will manage all of those for you. You'll find if you just unset the Host header that everything works fine. :smile:"
] |
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 then forgotten, causing users to put themselves at enormous risk unexpectedly and silently.\r\n\r\nGenerally I'd recommend resolving the actual problem by locating all the relevant root certificates you need and bundling them. That way you get the security benefits of HTTPS *and* a functioning application, rather than sacrificing the former for the latter.\r\n\r\nHope that helps!",
"@Lukasa Thanks for your comments!\r\n\r\nI was able to resolve this by explicitly specifying the certificate like below:\r\nos.environ[\"REQUESTS_CA_BUNDLE\"] = \"F:/emulator_certificate.cer\"\r\n\r\nI wanted to avoid checking-in this certificate in my file system for running my automated tests. Is there a way in which Python can look into my Windows Certification Manager store to see if this certificate is installed and use it rather than me having to explicitly export it and provide it as above?\r\n",
"So you can use [wincertstore](https://pypi.python.org/pypi/wincertstore). Otherwise, we need to wait for [PEP 543](https://www.python.org/dev/peps/pep-0543/).",
"@Lukasa Thanks for the suggestion!\r\nI went ahead and used wincertstore and it works without me having to extract and specify the certificate."
] |
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 posting to Github in general.\r\n\r\nIf you add ``` before on the lines before and after your stack trace, it formats it as code and makes it easier to read.\r\n\r\n```\r\nTraceback (most recent call last):\r\nFile \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py\", line 436, in wrap_socket\r\ncnx.do_handshake()\r\nFile \"/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py\", line 1426, in do_handshake\r\nself._raise_ssl_error(self._ssl, result)\r\nFile \"/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py\", line 1167, in _raise_ssl_error\r\nraise SysCallError(-1, \"Unexpected EOF\")\r\nOpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')\r\n```\r\n\r\nVerse:\r\nTraceback (most recent call last):\r\nFile \"/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py\", line 436, in wrap_socket\r\ncnx.do_handshake()\r\nFile \"/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py\", line 1426, in do_handshake\r\nself._raise_ssl_error(self._ssl, result)\r\nFile \"/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py\", line 1167, in _raise_ssl_error\r\nraise SysCallError(-1, \"Unexpected EOF\")\r\nOpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')\r\n",
"Hrm. This error has been caused by the remote peer shutting the connection in our face, causing us to see an EOF that we weren't previously expecting. What does your code look like? I *suspect* that you're encountering a problem with forking.",
"Thanks @Lukasa here is the code that failing\r\n\r\n``` python\r\ndef get(self, token):\r\n response = requests.get(self.url, auth=HTTPBasicAuth(token, ''))\r\n response.raise_for_status()\r\n user = response.json()\r\n logger = get_logger(__name__, user)\r\n logger.info(\"User token is good.\")\r\n return user\r\n```",
"Hrm, there is no global state here. You're confident that `self.url` is *exactly the same* each time? Can you add a print statement to your code to print it each time just to confirm it's identical?",
"@Lukasa Yes it should be the same in this case(hardcoded shown below). Also I made one simple request using postman which should have only triggered this once and got the same error.\r\n`self.url = base_url + \"/api/platform/v1/session\"`\r\n\r\nand `base_url` is const and in this case name of the other linked container",
"Turned out i was trying to connect using https when the other server only support http. Sorry about creating this confusion. Everything works great now....maybe a better error message would be nice to have."
] |
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\nsession = Session()\r\nsession.verify = False\r\ntransport = Transport(session=session)\r\n\r\nclient = Client('https://37.230.149.6:10004/emias-soap-service/PGUServicesInfo2?wsdl',\r\n , transport=transport, wsse=Signature(key_filename, cert_filename))\r\n```\r\nBut it doesn't solved my problem",
"So that second example should work. You're sure you got exactly the same error in both cases?",
"Either way: the core problem is that we can't validate the TLS certificate. Setting `verify` to `False` should fix that problem, so this is really a bug report on zeep to ask how to get that setting to apply in their library.",
"Yes, absolutely the same. But there is one thing when I try do this\r\n`curl https://37.230.149.6:10004/emias-soap-service/PGUServicesInfo2?wsdl --cert /etc/ssl/certs/cert.crt.pem --key /etc/ssl/certs/cert.key.pem`\r\nI get this message:\r\n```\r\n curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none\r\nMore details here: http://curl.haxx.se/docs/sslcerts.html\r\n\r\ncurl performs SSL certificate verification by default, using a \"bundle\"\r\n of Certificate Authority (CA) public keys (CA certs). If the default\r\n bundle file isn't adequate, you can specify an alternate file\r\n using the --cacert option.\r\nIf this HTTPS server uses a certificate signed by a CA represented in\r\n the bundle, the certificate verification probably failed due to a\r\n problem with the certificate (it might be expired, or the name might\r\n not match the domain name in the URL).\r\nIf you'd like to turn off curl's verification of the certificate, use\r\n the -k (or --insecure) option.\r\n```\r\n",
"Yes, this is curl telling you to do the same thing that I just told you to do: disable verification. Setting `verify` to `False` is how you do that in Requests, and you say that that didn't help: that means that zeep must be ignoring or controlling that setting somehow. You need to take that up with them.",
"About bug report to zeep, they replied me\r\n\r\n> \r\nSee http://docs.python-zeep.org/en/master/transport.html#transports (the verify option). If that doesn't solve it then perhaps the requests docs have more info. Basically zeep uses requests for the http communication with the server\r\n> ",
"Yup, so that code demonstrates the same thing as you showed. That is exactly how you disable cert validation. Can you please show me the traceback your *second* example produces?",
"```\r\nTraceback (most recent call last):\r\n File \"/home/max/bot_project/Bots_Django/TelegramBot/bot/simple_soap_client.py\", line 19, in <module>\r\n wsse=Signature(key_filename, cert_filename), transport=transport)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/client.py\", line 120, in __init__\r\n self.wsdl = Document(wsdl, self.transport, strict=strict)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/wsdl/wsdl.py\", line 76, in __init__\r\n document = self._get_xml_document(location)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/wsdl/wsdl.py\", line 137, in _get_xml_document\r\n location, self.transport, self.location, strict=self.strict)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/loader.py\", line 66, in load_external\r\n content = transport.load(url)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/transports.py\", line 111, in load\r\n content = self._load_remote_data(url)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/zeep/transports.py\", line 126, in _load_remote_data\r\n response = self.session.get(url, timeout=self.load_timeout)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/sessions.py\", line 501, in get\r\n return self.request('GET', url, **kwargs)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/sessions.py\", line 488, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/sessions.py\", line 609, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/adapters.py\", line 497, in send\r\n raise SSLError(e, request=request)\r\nrequests.exceptions.SSLError: (\"bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert handshake failure')],)\",)\r\n```",
"So, that is *not* the exact same error: that error is different. :) Specifically, it's telling you that at this point the remote server is erroring out about some part of the handshake. This is likely because the remote server has incompatible TLS settings.\r\n\r\nThe only way I can help debug that at this point is to see a packet capture from the connection, captured using a tool like Wireshark or tcpdump. Are you familiar with either tool?",
"No I don't:( If I'll do something like this:\r\n `openssl s_client -connect 37.230.149.6:10004 -cert /etc/ssl/certs/cert.crt.pem -key /etc/ssl/certs/cert.key.pem`\r\nDoes this help me?",
"The output of that would certainly be very helpful.",
"Is it confidential information? Can I place it here? \r\n",
"It should not be confidential information, no. If it is, I can edit your comment and will remove it.",
"Ok here it is:\r\n```\r\nCONNECTED(00000003)\r\ndepth=0 C = RU, ST = RU, CN = TST.MPGU\r\nverify error:num=18:self signed certificate\r\nverify return:1\r\ndepth=0 C = RU, ST = RU, CN = TST.MPGU\r\nverify return:1\r\n---\r\nCertificate chain\r\n 0 s:/C=RU/ST=RU/CN=TST.MPGU\r\n i:/C=RU/ST=RU/CN=TST.MPGU\r\n---\r\nServer certificate\r\n-----BEGIN CERTIFICATE-----\r\nMIICczCCAdygAwIBAgIIertkcbUl3AEwDQYJKoZIhvcNAQEFBQAwLTELMAkGA1UE\r\nBhMCUlUxCzAJBgNVBAgTAlJVMREwDwYDVQQDEwhUU1QuTVBHVTAeFw0xNjA1MTMx\r\nMzEyMDdaFw0yNjA1MTExMzEyMDdaMC0xCzAJBgNVBAYTAlJVMQswCQYDVQQIEwJS\r\nVTERMA8GA1UEAxMIVFNULk1QR1UwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB\r\nAK9apLncyd3UKWrfTQUOZjMBa7M+ZKTgsNkeT4u8+dv0uWwJrYtGlQRa7Z2l1eMC\r\nOKt9M8DCZ+9UskHZ7PStBNbCIBsVCC2G6ohNMWtv1wN0WWM23934/w2rzMzDeb1i\r\nH0o41kHiwUBOmro+6PDHOg9mycY8Ci20vTj7v7nijWGtAgMBAAGjgZswgZgwDAYD\r\nVR0TBAUwAwEB/zAdBgNVHQ4EFgQU8sAoYxenXmdHScV2xcK4R5SYusIwXAYDVR0j\r\nBFUwU4AU8sAoYxenXmdHScV2xcK4R5SYusKhMaQvMC0xCzAJBgNVBAYTAlJVMQsw\r\nCQYDVQQIEwJSVTERMA8GA1UEAxMIVFNULk1QR1WCCHq7ZHG1JdwBMAsGA1UdDwQE\r\nAwICvDANBgkqhkiG9w0BAQUFAAOBgQCUQ8kzsOrItNMVoqDpVflDhshoLL9UN7IA\r\n/dzQy0rlrt40vAmwhrLu3qaSOwKJZYzqXCGhnBudU60iAYOUYqxIx0Ea2H7PmYYH\r\nVoYM3iPEhCE+9TMDi9BZGDOH4KHewHiHOJ1qBskDaMyLwc+NZCDykUqRIvSuhUmw\r\nbBEk2NE7PQ==\r\n-----END CERTIFICATE-----\r\nsubject=/C=RU/ST=RU/CN=TST.MPGU\r\nissuer=/C=RU/ST=RU/CN=TST.MPGU\r\n---\r\nNo client certificate CA names sent\r\nClient Certificate Types: RSA sign, DSA sign\r\nRequested Signature Algorithms: RSA+SHA512:DSA+SHA512:RSA+SHA384:DSA+SHA384:RSA+SHA256:DSA+SHA256:RSA+SHA224:DSA+SHA224:RSA+SHA1:DSA+SHA1:RSA+MD5\r\nShared Requested Signature Algorithms: RSA+SHA512:DSA+SHA512:RSA+SHA384:DSA+SHA384:RSA+SHA256:DSA+SHA256:RSA+SHA224:DSA+SHA224:RSA+SHA1:DSA+SHA1\r\n---\r\nSSL handshake has read 825 bytes and written 1416 bytes\r\n---\r\nNew, TLSv1/SSLv3, Cipher is AES256-GCM-SHA384\r\nServer public key is 1024 bit\r\nSecure Renegotiation IS supported\r\nCompression: NONE\r\nExpansion: NONE\r\nNo ALPN negotiated\r\nSSL-Session:\r\n Protocol : TLSv1.2\r\n Cipher : AES256-GCM-SHA384\r\n Session-ID: 5D9660F74AF22F3583C850702A24E4059B48594D6003D87FED6F9F4B67A68848\r\n Session-ID-ctx: \r\n Master-Key: 38953C1D2A52B36665A009B40AB906E773ABC924F0DE2C54E0D837E1012749500C4980A63CACE1A7C09814D16ECBDE2D\r\n Key-Arg : None\r\n PSK identity: None\r\n PSK identity hint: None\r\n SRP username: None\r\n Start Time: 1490280114\r\n Timeout : 300 (sec)\r\n Verify return code: 18 (self signed certificate)\r\n```",
"Hrm. Those TLS settings largely seem to be ok. I wonder if you're not sending your client cert properly. :(\r\n\r\nCan I also ask what system you're running on?",
"Linux max12 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux\r\n",
"Ok, so that OpenSSL should be representative of what's actually being used. Hrm.\r\n\r\nWe definitely need to be able to see the handshake here, I'm afraid, because everything seems fine.",
"I generate my ssl cert and key:\r\n```\r\nopenssl pkcs12 -in testSSLClient.p12 -out cert.crt.pem -clcerts -nokeys\r\nopenssl pkcs12 -in testSSLClient.p12 -out cert.key.pem -nodes -nocerts\r\n```",
"testSSLClient.p12 has password and I know it's OK\r\nBut I have RootMedCA.cer and I don't how can I used it?",
"You could try doing `cat cert.crt.pem RootMedCA.cer > cert.crt.pem` and see if that helps.",
"Yes, my cert.crt.pem already contains RootMedCA.cer. ",
"And now I have no idea how can I fix it :( ",
"Yeah, I'm really uncertain either. :( It doesn't seem like there's any specific problem other than the server not liking what you're sending. Without seeing the handshake, again, I'm not sure.",
"Ok, thanks you!:)",
"Sorry I couldn't be more help!",
"Hi, I have some more information about my problem. What do you think about it?\r\n\r\nhttp://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification\r\nWhen I try this:\r\n```\r\nimport os\r\nimport requests\r\nfrom requests import Session\r\n\r\nkey_filename = \"/etc/ssl/certs/cert.key.pem\"\r\ncert_filename = \"/etc/ssl/certs/cert.crt.pem\"\r\nsession = Session()\r\nsession.verify = False\r\n\r\nr = requests.get('https://37.230.149.6:10004/emias-soap-service/PGUServicesInfo2?wsdl',\r\n cert=(cert_filename, key_filename))\r\nprint r\r\n```\r\nI have this Error:\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/max/bot_project/Bots_Django/TelegramBot/bot/simple_soap_client.py\", line 17, in <module>\r\n cert=(cert_filename, key_filename))\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/api.py\", line 70, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/api.py\", line 56, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/sessions.py\", line 488, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/sessions.py\", line 609, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/adapters.py\", line 497, in send\r\n raise SSLError(e, request=request)\r\nrequests.exceptions.SSLError: (\"bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)\",)\r\n```",
"But if I use this:\r\n\r\n```\r\nimport os\r\nimport requests\r\n\r\nkey_filename = \"/etc/ssl/certs/cert.key.pem\"\r\ncert_filename = \"/etc/ssl/certs/cert.crt.pem\"\r\n\r\nr = requests.get('https://37.230.149.6:10004/emias-soap-service/PGUServicesInfo2?wsdl',\r\n cert=(cert_filename, key_filename), verify=False)\r\nprint r\r\n```\r\nI have this... seems like OK\r\n\r\n```\r\n/home/max/bot_project/Bots_Django/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n InsecureRequestWarning)\r\n<Response [200]>\r\n```",
"I think, when I use code:\r\n\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\nsession = Session()\r\nsession.verify = False\r\ntransport = Transport(session=session)\r\n\r\nclient = Client('https://37.230.149.6:10004/emias-soap-service/PGUServicesInfo2?wsdl',\r\n , transport=transport, wsse=Signature(key_filename, cert_filename))\r\n```\r\nThis the same error.",
"Your code in your first example was wrong. You have to change it to this:\n\n```python\nimport os\nimport requests\nfrom requests import Session\n\nkey_filename = \"/etc/ssl/certs/cert.key.pem\"\ncert_filename = \"/etc/ssl/certs/cert.crt.pem\"\nsession = Session()\nsession.verify = False\n\nr = session.get('https://37.230.149.6:10004/emias-soap-service/PGUServicesInfo2?wsdl',\n cert=(cert_filename, key_filename))\nprint r\n```\n\nNote that I changed `requests.get` to `session.get`.",
"Sorry, my bad! It was my last hope...Can you advice me any SOAP client with ssl, not zeep and suds? "
] |
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** coverage by `1.97%`.\n> The diff coverage is `0%`.\n\n[](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #3937 +/- ##\n==========================================\n- Coverage 89.73% 87.75% -1.98% \n==========================================\n Files 17 16 -1 \n Lines 1978 1985 +7 \n==========================================\n- Hits 1775 1742 -33 \n- Misses 203 243 +40\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/\\_bug.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-cmVxdWVzdHMvX2J1Zy5weQ==) | `0% <0%> (ø)` | |\n| [requests/utils.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `85.02% <0%> (-1.23%)` | :arrow_down: |\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `92.93% <0%> (-1.17%)` | :arrow_down: |\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.42% <0%> (-0.22%)` | :arrow_down: |\n| [requests/adapters.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `92.82% <0%> (-0.11%)` | :arrow_down: |\n| [requests/structures.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-cmVxdWVzdHMvc3RydWN0dXJlcy5weQ==) | `100% <0%> (ø)` | :arrow_up: |\n| [requests/compat.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-cmVxdWVzdHMvY29tcGF0LnB5) | `100% <0%> (ø)` | :arrow_up: |\n| [tests/testserver/\\_\\_init\\_\\_.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-dGVzdHMvdGVzdHNlcnZlci9fX2luaXRfXy5weQ==) | | |\n| [requests/packages.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-cmVxdWVzdHMvcGFja2FnZXMucHk=) | | |\n| [requests/\\_\\_version\\_\\_.py](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree#diff-cmVxdWVzdHMvX192ZXJzaW9uX18ucHk=) | | |\n| ... and [5 more](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=tree-more) | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=footer). Last update [a44284c...f180980](https://codecov.io/gh/kennethreitz/requests/pull/3937?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"This also (obviously) needs tests. I just want Kenneth's opinion on it before progressing. I'm also completely open to renaming the public interfaces to the function =P I am not emotionally attached to them here.",
"Love the concept. I'd just tweak the module name a bit. I like `requests.report` or `requests.bugtrap` or something. ",
"merged this into the \"help\" branch, with some changes"
] |
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\r\nimport requests\r\nimport json\r\n\r\nr = requests.post(url, data=json.dumps(your_json, ensure_ascii=False), headers={'Content-Type': 'application/json'})\r\n```"
] |
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 trouble with? Can you tell us what version of Python and OpenSSL you're using? The reason is that Requests *does* trust LE certificates.",
"@MonsterDeveloper I also cannot reproduce this, but there's also too many versions of Python, OpenSSL, and Requests to try to guess at your current problematic configuration. Please supply as much information as possible.",
"Python: 3.5\r\nRequests: latest!\r\nPyOPENSSL: latest\r\nOpenSSL: latest\r\nOS: Ubuntu 16.04",
"And what URL?",
"Also...can you tell us what you mean by latest? There are different values of latest depending on where you're getting those packages from.",
"I got these packages from PyPi",
"You definitely didn't get OpenSSL from PyPI. So can you please provide the actual version numbers in all of those cases?",
"@MonsterDeveloper it would also be helpful to say what site you are trying to access. One of the most common problems is that a site is misconfigured and doesn't serve its intermediate certificate (as described in #2955).",
"There's been very little detail provided to help us debug this issue. Since the discussion stopped months ago, I'm closing this. We can reopen if necessary."
] |
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 moving 1.0.1 to 1.1.0 on 3.5.2.\r\n2. Does bug 2 go away when you remove pyopenssl?\r\n3. Does this reproduce with a simpler scenario? That is, if you change the response to, for example, be a simple 200 OK? What about if you change the SSL method to SSLv23_METHOD?\r\n4. Does this reproduce on different distributions? Your docker image is Debian stretch: if you use, say, Fedora Rawhide, does that problem go away?\r\n\r\nI'm not super well at the moment so I probably won't be looking at this in the next day or two, so if anyone else wants to dive in then feel free. Also, I'm going to CC some folks associated with PyOpenSSL: @hynek @alex @reaperhulk.",
"1. Since 3.5.2 doesn't exhibit problem 2.2 I didn't try upgrading libssl there (from base of 1.0.1t), for 3.5.3 I tried with both 1.0.1t and 1.1.0e and both leaked for issue 2.2\r\n2. The only way to get rid of bug 2.2 is using 3.5.2 w/o pyopenssl\r\n3. I was able to reproduce this with our internal server that simply does a 301 w/o body. Also note that I'm doing `head` in the test, and not `get`. I haven't tried with different SSL methods. The core is simply: \r\n```python\r\ndef do_one_req():\r\n global _req_num\r\n\r\n try:\r\n response = requests.head(URL, verify=VERIFY, allow_redirects=False, timeout=1)\r\n for r in response.history:\r\n r.close()\r\n response.close()\r\n return response\r\n except:\r\n traceback.print_exc()\r\n finally:\r\n _req_num.value += 1\r\n```\r\n4. that is a good question, I haven't tried different distributions yet.",
"I hope you feel better soon btw! These last few months have been pretty terrible for colds/flus :(",
"also btw, perhaps in general requests shouldn't be trying to pull in pyOpenSSL for 3+ since from what I understand it's not needed in those releases anymore?",
"So we pull in PyOpenSSL generally because it often has access to newer copies of OpenSSL, especially if installed via pip. ",
"ah, following the trail I see how it can dynamically load the openssl library, but couldn't find the code where it picks the newest version if multiple versions are installed: https://github.com/pyca/cryptography/blob/master/src/_cffi_src/build_openssl.py.",
"I believe I've verified this is a bug in SSLSocket. I've updated the gist to support raw sockets and aiohttp and I see the leak there as well.\r\n\r\nI've validated that calling `close()` vs `shutdown()` doesn't seem to make a difference, nor does using a global `ssl.create_default_context()` (as this doesn't have a `close()` method I was curious). I just opened: http://bugs.python.org/issue29870. Hopefully someone looks into it.",
"I've validated that this happens in Fedora:Rawhide w/ python 3.6.1rc1 as well, and 3.5.2's behavior is night and day. There were a few interesting SSL changes in 3.5.3 (https://docs.python.org/3.5/whatsnew/changelog.html#python-3-5-3) so probably caused by one of them. Take a look at this, Deb 3.5.2 on bottom vs fedora 3.6 on top (similar to all 3.5.3+ versions).\r\n\r\n\r\n",
"Interesting. Let's leave this issue open while upstream takes a look at theirs and see what happens. ",
"leak found! they're working on the correct fix now",
"btw, think it's worth adding a python warning when we know the definitive list of versions that leak?",
"It's a leak in the code that handles CRL distribution points extension, https://github.com/python/cpython/pull/1085",
"I think a warning might be a bit aggressive: the leak is a bug that should get fixed, so users should deal with that in the standard manner they deal with all bugs in dependencies. If we take it upon ourselves to warn for all bugs in dependencies we'll find that takes basically all our maintenance time. 😉",
"Also, well done to all involved to track down and diagnose this leak! ❤️",
"ok closing issue then"
] |
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 make it difficult for other users. \r\n3. Rely on private parts of the codebase that we may change or break otherwise. \r\n\r\nThis is none of those things as far as I can see: it's simple to implement, moderately widely useful but not anything like 50% of users, and relies entirely on published parts of the API. So I'm inclined to say there isn't much value add in bringing that code in. Does that make sense?",
"I'm 100% fine with it not being implemented upstream. I think maybe 10% of users would find this useful. I've just done this enough times to think it was worth discussing.",
"Agreed, you should always feel tee to propose new feature ideas. It's just worth knowing what our policy is on them. 😁\r\n\r\nThanks for the suggestion!"
] |
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 as a joke. 😉"
] |
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's really nice to override the user/pass.\r\nShort explanation about my situation related to social library:\r\nI'm using a webservice that requires you to use the username/password HTTP authentication, for this I require the use of `.netrc` which is perfect. But on the same domain/path there is a oAuth2 endpoint that uses the `Authorization` header with the oAuth tokens.\r\n\r\nIf the `.netrc` feature/standard is only supporting username/password, why not replacing header when not containing a bearer or any other token. This could be done with checking the contents if the header is manually provided.",
"So, I am *open* to that, but nervous about it. There are failure modes at either side, and trying to be \"clever\" may cause us to just be difficult to understand. The virtue of the model we have today is that it is very *simple* and *consistent*. So my question stands: do the functions currently available suffice for your use case?",
"Well I agree on the fact that it's not really nice to change such behavior right now as it's always breaking something. And indeed the usage of the trust_env is a good option, but in this case the author of the library should give us an option to enable/disable it as a backend developer. Also the trust_env will disable more environmental settings or behavior and not only the netrc function, like proxy settings if I understood right.\r\n\r\nAnother option would be turning it on/off per request that overrides the session trust_env, or have another way to not override one specific header.\r\n\r\nAnyway, the module is already trying to be \"clever\" by replacing the whole header :smiley: . Which is great when you have full control over the `Session`.",
"So it is quite possible that the library wrapping requests should be setting `trust_env` to `False` if it is handling headers itself. ",
"Yep, and that should be the case. But it remains that if you have mixed requests, like I have, it's kinda hard to manage. You need to have two sessions.",
"Well, you don't really. You can just flip the setting around as-and-when you need it.\r\n\r\nHowever, here's a framework I'd consider for handling auth in the 3.0 branch. I'd welcome a PR to make this the case.\r\n\r\n1. If the user sets an Authorization header themselves, either via the request or on the Session, we don't bother to look at the netrc file.\r\n2. If they didn't, we look at the netrc file for basic auth.\r\n3. If we get redirected, we fall back to only looking at the netrc file (which we already currently do).\r\n\r\nDoes that sound like a reasonable approach to your case?",
"That sounds like a pretty clear way to solve this case. Only downside is that it can cause breaking code. But it's better to not force override when user manually given the details in my opinion.\r\n\r\nI'm not sure if I'm capable of doing the PR myself due to time limits.",
"[I encountered this problem](https://github.com/koalalorenzo/python-digitalocean/issues/130#issuecomment-291766204) when trying to figure out why the [python-digitalocean](https://github.com/koalalorenzo/python-digitalocean) module, which uses Requests, was failing due to an unexpected authentication error.\r\n\r\nThe root cause turned out to be this `default` directive in my `$HOME/.netrc`:\r\n\r\n`default login anonymous password anonymous@`\r\n\r\nwhich I used, many years ago, to automate my anonymous FTP logins.\r\n\r\nI'm surprised that this directive in my `.netrc` would cause Requests to automatically override the authentication information that is being specified explicitly by `python-digitalocean`, especially since the directive is merely setting _default_ login information that is used when accessing a host that lacks an explicit `machine` entry in `.netrc`.\r\n\r\nSo I like @Lukasa's idea above: when the caller specifies an Authorization header, I think the `.netrc` directives (whether `default` or `machine`) should be ignored. Thanks!",
"Got bitten by this one as well :(\r\nTo answer @Lukasa question:\r\n> do the functions currently available suffice for your use case?\r\n\r\nI would say no, because `trust_env` is not only `netrc`, it's also `REQUESTS_CA_BUNDLE` for instance. Right now it's a little too much \"take it or leave it\" for the entire set of possible env stuff I could want to use :(",
"It would be nice to allow to disable reading from `.netrc` explicitly. Currently, it looks `requests` also handles an existing `.netrc` even if for `requests.get` which is expected to be a anonymous request in most cases.",
"How about provide a auth class something like `NetrcAuth` instead?",
"Coming here after spending several hours debugging an issue which ended up being the presence of a ~/.netrc file. This behavior violates POLA and should be explicitly enabled rather than enabled by default. ",
"I lost half a day because I could not log to production any more, and I couldn't find the issue in our infrastructure. Found out it was because I stored my password in `~/.netrc` and requests read it and added an `Authorization` header when I was using a `Bearer` instead, and got rejected from the server.\r\n\r\nIt should only happen with an explicit `BasicAuth()`.",
"This issue still exists.\r\nIdeally, requests would only use the credentials in the netrc when there is no authorization header explicitly supplied.",
"I think this behavior should be changed. I installed an FTP package that silently generated a sample ~/.netrc. This prevented me from using gcloud (the GCP CLI) because gcloud uses Requests and Requests prefers ~/.netrc over gcloud's OAuth headers. I agree fullly with [Lord-of-the-Galaxy](https://github.com/Lord-of-the-Galaxy)'s suggestion.",
"I also just came across this behavior (based on a user report and it took us about a month to figure out that the presence of a `.netrc` was the \"issue\" in the user's environment)\r\nIt's quite incredible that python-requests will overwrite a header *explicitly set by the programmer* - I mean, I'm not writing `headers={'Authorization': 'xyz'}` for fun in my code!",
"I also spent a while debugging this exact problem, and I'll add my voice: requests should not override an explicitly set \"Authentication\" header.",
"I tried in https://github.com/psf/requests/pull/6555, guys 😅 \r\n\r\nI essentially just implemented @Lukasa's [suggestion](https://github.com/psf/requests/issues/3929#issuecomment-287721484), but I got slapped first with \"It's documented!\", followed by \"Why aren't you writing an auth adapter instead of adding/modifying the header?\", and finally \"It's not backwards compatible so fuck off!\". The standoffish attitude seems to be typical behavior for this maintainer so at least it's not personal.\r\n\r\nI would've been happy to discuss alternatives such as displaying a warning to the user when the Authorization header has been set and has been overridden by `.netrc` or introducing a new parameter to control `.netrc` or waiting for a major release for the changes to adopted. \r\n\r\nIt's disappointing to say the least.",
"I also struggled with this problem for about a day and had to dig deep into the http library to figure out that my .netrc file (which was valid but for another host was to blame). No warnings, nothing.\r\n\r\nThe behavior doesn't makes sens, and is also inconsistent.\r\n\r\n- If you set basic permissions in the request using the \"auth\" parameters, this is used, and .netrc is ignored\r\n- If you explicitly set \"Authorization: Bearer <token>\", in the header, then this is ignored, .netrc us used\r\n\r\nI think its fair to call this a bug, that has cos a lot of working hours for many people. In my case i need to keep the .netrc file for another API\r\n\r\nA workaround for the bug is something like this\r\n\r\n```\r\ns=requests.Session()\r\ns.trust_env=False\r\nresponse = s.get(CUSTOMER_LOCATIONS_ENDPOINT, headers = hdr, data=data2, verify=None) \r\n```\r\n\r\n\r\nSo 3 lines of code, instead of one for the same operation. \r\n\r\nTrue, the trus_env variable is documented, but why not set it to false as default, or at very least write a warning f headers are ignored.\r\n"
] |
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,
"id": 117745,
"name": "Planned",
"node_id": "MDU6TGFiZWwxMTc3NDU=",
"url": "https://api.github.com/repos/psf/requests/labels/Planned"
},
{
"color": "207de5",
"default": false,
"description": null,
"id": 60620163,
"name": "Minion Seal of Approval",
"node_id": "MDU6TGFiZWw2MDYyMDE2Mw==",
"url": "https://api.github.com/repos/psf/requests/labels/Minion%20Seal%20of%20Approval"
}
] |
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** coverage by `0.27%`.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3927 +/- ##\n=========================================\n+ Coverage 89.32% 89.6% +0.27% \n=========================================\n Files 15 15 \n Lines 1940 1944 +4 \n=========================================\n+ Hits 1733 1742 +9 \n+ Misses 207 202 -5\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3927?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/compare/b60c5a5ed46d75c56e36db5a58a98a50d880141d...4207867aaf917ed8d223064cc5c163dfe027dc00?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `92.93% <ø> (ø)` | :arrow_up: |\n| [requests/api.py](https://codecov.io/gh/kennethreitz/requests/compare/b60c5a5ed46d75c56e36db5a58a98a50d880141d...4207867aaf917ed8d223064cc5c163dfe027dc00?src=pr&el=tree#diff-cmVxdWVzdHMvYXBpLnB5) | `81.81% <ø> (ø)` | :arrow_up: |\n| [requests/adapters.py](https://codecov.io/gh/kennethreitz/requests/compare/b60c5a5ed46d75c56e36db5a58a98a50d880141d...4207867aaf917ed8d223064cc5c163dfe027dc00?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `92.82% <100%> (+2.57%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3927?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3927?src=pr&el=footer). Last update [b60c5a5...4207867](https://codecov.io/gh/kennethreitz/requests/compare/b60c5a5ed46d75c56e36db5a58a98a50d880141d...4207867aaf917ed8d223064cc5c163dfe027dc00?src=pr&el=footer&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"Thanks for the review. In addition I also ported the definitions you provided for the `verify` parameter to the other methods that were getting this argument for consistency",
"I'm happy to help :) Just by curiosity, is it a good practice to squash the commits into one?",
"It depends very much on the project. For my part, I generally allow people to work the way they feel most comfortable unless the number of commits vastly outweighs the complexity of the change. Other projects may ask you to do so: it's polite to do what they want. But if no-one asks, then you're totally safe. :smile:",
"Ok good to know, thanks"
] |
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: ```Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32```\r\nRequests version:```requests (2.13.0)```\r\nOther packages:\r\n```\r\naiohttp (1.3.3)\r\namqp (2.1.4)\r\nanyjson (0.3.3)\r\nappdirs (1.4.0)\r\nasync-timeout (1.1.0)\r\nattrs (16.3.0)\r\nAutomat (0.5.0)\r\nbilliard (3.5.0.2)\r\ncelery (3.1.24)\r\ncffi (1.9.1)\r\nchardet (2.3.0)\r\nclick (6.7)\r\ncolorama (0.3.7)\r\nconfigobj (5.0.6)\r\nconstantly (15.1.0)\r\ncryptography (1.7.2)\r\ncssselect (1.0.1)\r\nDBUtils (1.2)\r\ndecorator (4.0.11)\r\nDjango (1.10.5)\r\ndjango-celery (3.2.1)\r\ndjango-celery-with-redis (3.0)\r\ngevent (1.2.1)\r\ngreenlet (0.4.12)\r\nidna (2.2)\r\nincremental (16.10.1)\r\nipython (5.2.2)\r\nipython-genutils (0.1.0)\r\nkombu (4.0.2)\r\nlxml (3.7.3)\r\nmultidict (2.1.4)\r\nmycli (1.8.1)\r\npackaging (16.8)\r\nparsel (1.1.0)\r\npickleshare (0.7.4)\r\npip (9.0.1)\r\nprompt-toolkit (1.0.13)\r\npyasn1 (0.2.2)\r\npycparser (2.17)\r\nPyDispatcher (2.0.5)\r\nPygments (2.2.0)\r\nPyMySQL (0.7.10)\r\npyOpenSSL (16.2.0)\r\npyparsing (2.1.10)\r\npytz (2016.10)\r\nqueuelib (1.4.2)\r\nredis (2.10.5)\r\nrequests (2.13.0)\r\nsetuptools (34.2.0)\r\nsimplegeneric (0.8.1)\r\nsix (1.10.0)\r\nsqlparse (0.2.2)\r\ntraitlets (4.3.1)\r\nvine (1.1.3)\r\nw3lib (1.17.0)\r\nwcwidth (0.1.7)\r\nweb.py (0.40.dev0)\r\nyarl (0.9.8)\r\nzope.interface (4.3.3)\r\n```\r\n\r\nHere is my relative code: ```resp = requests.get(url, headers=self.__headers, timeout=(10, 30))```, and I also use gevent in my app.\r\n",
"Ok, so I'm not able to reproduce this with a simple equivalent on my end. Can you try a clean virtualenv without gevent to see if it reproduces?",
"@Lukasa Ok, I'll have a try.",
"Any updates on this @i2it? This has gone without an update for 20 days and we cannot reproduce it. Please help us to help you :)",
"@i2it do you use monkey patching?",
"Well, that's one way to solve this issue.\r\n\r\nWe've found similar issue with requests >= 2.14.0 while using gevent and monkey patching socket with `aggressive=True`. I just thought it might be interesting. Also, note that gevent is listed https://github.com/requests/requests/issues/3924#issuecomment-286674716",
"@zstyblik Does it reproduce without gevent?",
"EDIT: fixed some typos :)\r\n\r\n@Lukasa no and we found out by accident(brainstorming and saying stupid ideas). Now, I don't know \"who\" exactly is to blame, but if I remember correctly, it's monkey patching and `aggresive=True`, because it applies some SSL optimizations. I believe/think/if I remember correctly, the reason for monkey patching is either to get better performance from gevent or even to make code(web app/middleware) in question to work with gevent.\r\n\r\nAnyway, no, it's not reproducible if you just do in Python interpreter/CLI or even a script:\r\n\r\n```\r\nimport requests\r\nrequests.get('https://localhost')\r\n```\r\n\r\nAlso, note that HTTP was working just fine, just HTTPS had these issues.",
"Ok, so my inclination then is to assume that this is a gevent bug. Generally speaking if we have code that works under CPython-vanilla and breaks under gevent, the problem is with gevent and not with us. gevent's promise is that it will reproduce a CPython runtime environment with transparent green threading: seems to me it's failing to meet that promise.",
"@Lukasa I agree with you that problem doesn't lie in requests, but either in gevent or monkey patching.\r\n\r\nCheers.",
"I have this exact same issue and it does seem to be with gevent :("
] |
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 **increase** coverage by `0.12%`.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## proposed/3.0.0 #3923 +/- ##\n==================================================\n+ Coverage 89.32% 89.44% +0.12% \n==================================================\n Files 15 15 \n Lines 1929 1932 +3 \n==================================================\n+ Hits 1723 1728 +5 \n+ Misses 206 204 -2\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3923?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/compare/84dc6b66daf3d864737a61bacf86a91b68408656...d491e9f9b28815343d4114be51832960907b12d8?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `94.22% <100%> (+0.48%)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3923?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3923?src=pr&el=footer). Last update [84dc6b6...d491e9f](https://codecov.io/gh/kennethreitz/requests/compare/84dc6b66daf3d864737a61bacf86a91b68408656...d491e9f9b28815343d4114be51832960907b12d8?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"I'll take a look",
"I attempted a fix; though I'm not sure it's correct\r\nMaybe use `self.encoding` or `self.apparent_encoding`?\r\n\r\nWhen `decode_unicode` is False we don't deal with the encoding, so I'm not sure it makes sense to assume utf-8 and to encode only the last byte"
] |
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/29085e7d95915df95848af44f09a894e8b684134?src=pr&el=desc) will **decrease** coverage by `1.44%`.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3922 +/- ##\n==========================================\n- Coverage 89.32% 87.88% -1.45% \n==========================================\n Files 15 15 \n Lines 1940 1940 \n==========================================\n- Hits 1733 1705 -28 \n- Misses 207 235 +28\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3922?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/compat.py](https://codecov.io/gh/kennethreitz/requests/compare/29085e7d95915df95848af44f09a894e8b684134...e0ba82949b82aa387c5fe519f6717007d682fa0d?src=pr&el=tree#diff-cmVxdWVzdHMvY29tcGF0LnB5) | `64.86% <0%> (-35.14%)` | :x: |\n| [requests/__init__.py](https://codecov.io/gh/kennethreitz/requests/compare/29085e7d95915df95848af44f09a894e8b684134...e0ba82949b82aa387c5fe519f6717007d682fa0d?src=pr&el=tree#diff-cmVxdWVzdHMvX19pbml0X18ucHk=) | `83.33% <0%> (-10%)` | :x: |\n| [requests/_internal_utils.py](https://codecov.io/gh/kennethreitz/requests/compare/29085e7d95915df95848af44f09a894e8b684134...e0ba82949b82aa387c5fe519f6717007d682fa0d?src=pr&el=tree#diff-cmVxdWVzdHMvX2ludGVybmFsX3V0aWxzLnB5) | `93.75% <0%> (-6.25%)` | :x: |\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/compare/29085e7d95915df95848af44f09a894e8b684134...e0ba82949b82aa387c5fe519f6717007d682fa0d?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `91.15% <0%> (-2.27%)` | :x: |\n| [requests/adapters.py](https://codecov.io/gh/kennethreitz/requests/compare/29085e7d95915df95848af44f09a894e8b684134...e0ba82949b82aa387c5fe519f6717007d682fa0d?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `89.75% <0%> (-0.49%)` | :x: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3922?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3922?src=pr&el=footer). Last update [29085e7...e0ba829](https://codecov.io/gh/kennethreitz/requests/compare/29085e7d95915df95848af44f09a894e8b684134...e0ba82949b82aa387c5fe519f6717007d682fa0d?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"These CI failures aren't your fault. @kennethreitz, looks like our CI setup has busted again: want to take a look?",
"Yep, this is a bug in the last release of pipenv. There's a patch underway, thanks @Lukasa!"
] |
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** coverage.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3920 +/- ##\n=======================================\n Coverage 89.32% 89.32% \n=======================================\n Files 15 15 \n Lines 1940 1940 \n=======================================\n Hits 1733 1733 \n Misses 207 207\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3920?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3920?src=pr&el=footer). Last update [c43fefa...4acdb99](https://codecov.io/gh/kennethreitz/requests/compare/c43fefa7ed535c41ba7d58021f0f16ed5ba1d584...4acdb99752e2411df542e99dd9baafae7e2ca8e8?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments)."
] |
|
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 what's causing the issues. I'm getting a `TooManyRedirect` exception when trying to use Python3.6 but the request works if I pass the properly decoded Location header: `http://uae.souq.com/ae-ar/ابل-ايفون-7-مع-فيس-تايم-32-جيجا-الجيل-الرابع-ال-تي-اي-ذهبي-11526690/i/`.",
"It depends on what you want to call \"the issue\". If the issue is the header parsing error, that's fixed in 3.6. If the issue is the redirect loop, this is a dupe of #3888."
] |
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** coverage.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3918 +/- ##\n=======================================\n Coverage 89.32% 89.32% \n=======================================\n Files 15 15 \n Lines 1940 1940 \n=======================================\n Hits 1733 1733 \n Misses 207 207\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3918?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3918?src=pr&el=footer). Last update [c43fefa...931adf5](https://codecov.io/gh/kennethreitz/requests/compare/c43fefa7ed535c41ba7d58021f0f16ed5ba1d584...931adf5c92d43a1e9d9fe0d5e4dc49ee2449d881?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"Thanks for this! However, this patch is entirely contained in [urllib3](https://github.com/shazow/urllib3), which we vendor in unchanged. You'll need to propose this patch on that repository.",
"Ok, but it's weird to have another module within requests itself, which made me thought that urllib3 is part of requests. The only other python project I usually got involved in is flexget which never place other external module inside itself.\r\n\r\nAnyway, your comment clears things up for me. Thanks."
] |
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 ways: either use `response.content`, which gives you back un-decoded binary data, or you can set `response.encoding` to whatever encoding you know out-of-band to be appropriate before calling `response.text`, which will cause us to just trust your choices.\r\n\r\nOtherwise, there is very little we can do about this: Requests is and always will be a pure-Python module, so we cannot ship a C extension. We could optionally allow the use of cchardet, but ultimately the fastest thing to do here is to just not force us to guess at all. :)",
"response.content worked for me, thanks!"
] |
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 variables.\r\n\r\nCan you try that test for me please?",
"Given that we don't have enough detail to help debug this and there hasn't been a response since it was opened, I'm closing this. Let us know if it needs to be reopened."
] |
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 any evidence that this will happen, I think this is a nonexistent risk. Thanks for the report!",
"I should note as well that we are likely to drop support for Python 2 *well* before any hypothetical Python 4 comes out, at which point all of the `if PY3` will disappear in favour of just being, you know, the actual control flow of the code.",
"Not only would those `if PY3` or `if not PY2` conditions drop but all the handling around bytes and text would be 100x simpler.",
"Your choice of course, I'm just reporting what I see as an issue.\r\n\r\nIt's not just me though, and not as far fetched as you would have it either. The official \"Porting Python 2 Code to Python 3\" documentation [specifically warns against just this kind of code, *and* tables python 4](https://docs.python.org/3/howto/pyporting.html#use-feature-detection-instead-of-version-detection), stating:\r\n\r\n> The problem with this code is what happens when Python 4 comes out? It would be better to treat Python 2 as the exceptional case instead of Python 3 and assume that future Python versions will be more compatible with Python 3 than Python 2\r\n\r\nIt goes on to recommend not using if-checks on the python version at all, and you may want to look into that too. Or not. :-)\r\n",
"> It goes on to recommend not using if-checks on the python version at all, and you may want to look into that too. Or not. :-)\r\n\r\nThat documentation was written before several libraries were written that break what would otherwise be the best practice for porting. We've dealt with them many times before. These version checks are orders of magnitude better. Please, we know what we're doing.",
"Just to follow up on this matter, the newly accepted [PEP 563](https://www.python.org/dev/peps/pep-0563/) specifically mentions python 4.0 following python 3.9. Seeing how historically, there has been a new python release roughly every 1.5 years, and 3.6 was released in December 2016, we can extrapolate and find that python 4.0 should release somewhere around December 2022, about 2 years after python 2.7 has been officially deprecated. The first development versions of 4.0 will appear 1.5 years before, in mid 2021. My guess is that there will still be a considerable number of python 2.7 users at that time -- it's just 3.5 years, and time flies.\r\n\r\nBut even if you do end up supporting python 2.7 until after python 4 is a thing, I no longer think this code will be a problem, because I'm fairly certain that `six` will be forced to make `six.PY3` be `True` for python 4.0 as well, in order to avoid breaking code like this.\r\n\r\nSo I agree with you that this is a non-issue, though not for the same reasons. :-)\r\n"
] |
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://codecov.io/gh/kennethreitz/requests/commit/62bd9247ba0cef14827f32459a921376b54d56dd?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3913 +/- ##\n=======================================\n Coverage 89.32% 89.32% \n=======================================\n Files 15 15 \n Lines 1940 1940 \n=======================================\n Hits 1733 1733 \n Misses 207 207\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3913?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/api.py](https://codecov.io/gh/kennethreitz/requests/compare/62bd9247ba0cef14827f32459a921376b54d56dd...2e9e944bc16fcf51b9ec4f8fc2f6161fbd2bb194?src=pr&el=tree#diff-cmVxdWVzdHMvYXBpLnB5) | `81.81% <ø> (ø)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3913?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3913?src=pr&el=footer). Last update [62bd924...2e9e944](https://codecov.io/gh/kennethreitz/requests/compare/62bd9247ba0cef14827f32459a921376b54d56dd...2e9e944bc16fcf51b9ec4f8fc2f6161fbd2bb194?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments)."
] |
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.",
"@Lukasa \r\nThanks for answering. But why this warning won't happen if I I don't run the code in a unittest environment?",
"It's hard to know. Depends if they change the warning filter, depends if anything else changes the warnings filter, depends on how your code is written.",
"Does it mean I must call `session.close()` if I want to use the `requests.Session()`?",
"You don't *have* to. The warning is just that: a warning. No error occurs when you see it, and it is not an indication of the program doing the wrong thing. It's entirely expected behaviour, and this is working as designed. However, if you're concerned about them, you *may* call `close`.",
"> You don't have to. The warning is just that: a warning. No error occurs when you see it, and it is not an indication of the program doing the wrong thing. It's entirely expected behaviour, and this is working as designed. However, if you're concerned about them, you may call close.\r\n\r\nI find this advice contrary to Python's typical approach to resource handling. Python encourages deterministic resource handling. For example, the stdlib produces warnings when files are mismanaged in a non-deterministic way to help guide developers. Developers _should_ take action on the warnings produced by stdlib. See the following Python bug where core developers discuss warnings during destructors:\r\n\r\nhttps://bugs.python.org/issue28867\r\n\r\nAdditionally, Python [docs](https://docs.python.org/3/reference/datamodel.html#object.__del__) warn against relying on `__del__` for resource management:\r\n\r\n> It is not guaranteed that `__del__()` methods are called for objects that still exist when the interpreter exits.\r\n\r\nAnd, exceptions occurring during `__del__` are ignored and can't be handled:\r\n\r\n> Due to the precarious circumstances under which `__del__()` methods are invoked, exceptions that occur during their execution are ignored, and a warning is printed to `sys.stderr` instead.\r\n\r\nI run all my tests and environments with warnings enabled to help catch _real_ bugs and upgrade paths. If this warning really should be ignored as suggested here, then maybe it shouldn't be logged. As it is now, people are taking this advice of not calling close and this results in lots of (ignorable?) noise in my output.",
"Hi!\r\nI've same problem with my test only they never end because this error (?)\r\n\r\nCould you provide an example of how to solve this issue?",
"> If this warning really should be ignored as suggested here, then maybe it shouldn't be logged.\r\n\r\n@jdufresne I don't believe Requests is actually logging this at all. That's the interpreter logging it. Also, I'm rather confident that Requests doesn't rely on `__del__` so I'm confused as to why you're mentioning that here. It seems you're arguing against an invisible person and I'm not sure why you're doing that here.\r\n\r\n> I've same problem with my test only they never end because this error (?)\r\n\r\n@Garito, this is not StackOverflow - the designated Q&A resource for Requests - so please post your question there with code snippets. As a hint, this is likely something to do with your code and not the ResourceWarning. An unclosed socket *should not* cause your tests to hang so there's likely something else going on with your code.\r\n\r\n---\r\n\r\nGiven the shear amount of off-topic discussion on this issue, I'm locking it."
] |
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 which wasn't patched until 3.4. So my request error was just a hostname lookup failure.\r\n\r\nIt's possible that the error was obfuscated due to the fact that my python code is packaged into a binary using pyinstaller, but I'm not sure.\r\n\r\nThanks for taking a look. Closing :)"
] |
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** coverage.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3909 +/- ##\n=======================================\n Coverage 89.32% 89.32% \n=======================================\n Files 15 15 \n Lines 1940 1940 \n=======================================\n Hits 1733 1733 \n Misses 207 207\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3909?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/structures.py](https://codecov.io/gh/kennethreitz/requests/compare/41a33f2e869e1fdcd88062be469775f613ee8ced...8e6e47af43d1d89a0201bd58e97c700bebbddd5e?src=pr&el=tree#diff-cmVxdWVzdHMvc3RydWN0dXJlcy5weQ==) | `100% <100%> (ø)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3909?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3909?src=pr&el=footer). Last update [41a33f2...8e6e47a](https://codecov.io/gh/kennethreitz/requests/compare/41a33f2e869e1fdcd88062be469775f613ee8ced...8e6e47af43d1d89a0201bd58e97c700bebbddd5e?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
":cake:"
] |
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____ [~] ____ $ python3 -c 'import ssl; print(ssl.OPENSSL_VERSION)'\r\nOpenSSL 1.0.2j 26 Sep 2016\r\n```\r\n\r\nWould that be the cause? FWIW, the calls to https://localhost:8080 validate successfully when using `REQUESTS_CA_BUNDLE=cert.pem`, it's everything else that fails.",
"@dbazile are the cert chains for the other websites in `cert.pem`? If not then that is absolutely the expected behaviour.",
"@sigmavirus24: They're not in `cert.pem`.\r\n\r\nBut it's not the same behavior that I saw in Python 3.5 (which checked `REQUESTS_CA_BUNDLE` first and fell back on the system's trust store for everything else).\r\n\r\nIs there a way to configure this previous behavior without `cat`ing the entire system's trust chain into cert.pem?",
"Perhaps 3.5 did not use a bundled OpenSSL, but whenever your OpenSSL isn't linked against the (horrific) Apple provided one, you will see exactly what you're seeing now.",
"So, to clarify: Apple's bundled OpenSSL will check against our cert bundle and then, if validation fails, it will check against the system. This is a dangerous behaviour because it makes it very hard to validate that the correct trust roots are being used. \r\n\r\nRight now Requests does not support using the macOS trust roots. If you want to, the `security` command line tool can be used to extract the system trust roots to PEM. ",
"I think you're right; Python 3.5 didn't bundle OpenSSL but 3.6 does:\r\n\r\n```\r\n____ [terra:~/code/ssl] ____ $ ls /Library/Frameworks/Python.framework/Versions/3.6/lib/*ssl*\r\n/Library/Frameworks/Python.framework/Versions/3.6/lib/libssl.1.0.0.dylib /Library/Frameworks/Python.framework/Versions/3.6/lib/libssl.dylib\r\n\r\n____ [terra:~/code/ssl] ____ $ ls /Library/Frameworks/Python.framework/Versions/3.5/lib/*ssl*\r\nls: /Library/Frameworks/Python.framework/Versions/3.5/lib/*ssl*: No such file or directory\r\n```\r\n\r\nI think my solution is to grab and concat all the certs my code will be using into an actual bundle and use that instead.\r\n\r\nThank you much, @Lukasa @sigmavirus24!"
] |
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 what OS entware considers to be its base, but it could *easily* be poll, if not epoll or kqueue), but does not actually support it.\r\n\r\nIt'd be really nice to get a whole traceback, but if you can't do it can you show me what selectors are present? That is, in a Python shell, run:\r\n\r\n```python\r\nimport select\r\nprint(select.select)\r\nprint(select.poll)\r\nprint(select.epoll)\r\nprint(select.kqueue)\r\n```",
"To be frank, I'm not a Python dev and is currently facing this issue while using Flexget. The code in Flexget that triggers the exception is,\r\n```\r\nresponse = requests.get(self.base_url, params=params)\r\n```\r\n\r\nI've run the command you mentioned above and the result is as follow,\r\n```\r\nPython 3.6.0 (default, Feb 17 2017, 13:43:51)\r\n[GCC 5.4.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import select\r\n>>> print(select.select)\r\n<built-in function select>\r\n>>> print(select.poll)\r\n<built-in function poll>\r\n>>> print(select.epoll)\r\n<class 'select.epoll'>\r\n>>> print(select.kqueue)\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\nAttributeError: module 'select' has no attribute 'kqueue'\r\n```\r\n\r\nI'll be happy to perform whatever tasks you ask of me to resolve this issue.",
"Ok, so `poll` and `epoll` seem to be the problems there. Do you mind running this Python code quickly?\n\n```python\nimport socket\nfrom requests.packages.urllib3.util import wait\n\ns = socket.create_connection(('httpbin.org', 80))\nprint(wait.wait_for_write([s])\n```",
"Here's the result. Seems like we're on the right track,\r\n```\r\nPython 3.6.0 (default, Feb 17 2017, 13:43:51)\r\n[GCC 5.4.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import socket\r\n>>> from requests.packages.urllib3.util import wait\r\n>>> s = socket.create_connection(('httpbin.org', 80))\r\n>>> print(wait.wait_for_write([s])\r\n... )\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/opt/lib/python3.6/site-packages/requests/packages/urllib3/util/wait.py\", line 40, in wait_for_write\r\n return _wait_for_io_events(socks, EVENT_WRITE, timeout)\r\n File \"/opt/lib/python3.6/site-packages/requests/packages/urllib3/util/wait.py\", line 22, in _wait_for_io_events\r\n with DefaultSelector() as selector:\r\n File \"/opt/lib/python3.6/site-packages/requests/packages/urllib3/util/selectors.py\", line 364, in __init__\r\n self._epoll = select.epoll()\r\nOSError: [Errno 89] Function not implemented\r\n```\r\n",
"Aha, ok, so we're getting there. An explanation:\n\nRequests, when using PyOpenSSL, needs to implement some logic to do non-blocking I/O. We do this by looking for the best available selector on the platform and using that. We check for the available selectors by looking at which names are defined in the `select` namespace.\n\nIt seems that this Python distribution is defining the `epoll` selector, but cannot actually *use* it. This is probably because the underlying OS defines the `epoll` syscall but cannot actually use it, and returns `ENOSYS`.\n\nNow, we can work on this by extending our `selectors` module to actually attempt to create a selector on startup and looking to see if that works (/cc @SethMichaelLarson), but in the short term you can resolve this by running a small monkeypatch just after you import requests.\n\nIn your code, if you add:\n\n```python\nimport requests.packages.urllib3.util.selectors\nrequests.packages.urllib3.util.selectors.DefaultSelector = requests.packages.urllib3.util.selectors.SelectSelector\n```\n\nBefore you start running your main code, that should re-introduce the older behaviour. If `poll` works on your OS, you may want to use `PollSelector` instead of `SelectSelector`.\n\nLonger term, you should consider reporting a bug upstream to suggest that they remove the definitions for syscalls that don't actually work on their platform: I imagine they'll run into trouble elsewhere.",
"Ok, thanks.\r\n\r\nI'm not so familiar with Linux so who should I be reporting this issue to?\r\n- Firmware dev (http://asuswrt.lostrealm.ca/), or\r\n- Entware NG dev (https://github.com/Entware-ng/Entware-ng)\r\n\r\nEntware is installed onto the firmware (I don't even know my sentence is correct or not). Then via Entware's opkg exec, I installed Python3.",
"I would *guess* that the firmware developer is the place to go. One thing that might be useful information to provide the firmware developer, if you can, is a copy of the Python script I wrote you above (the one that calls `wait_for_write`) along with the `strace` output that produces. It should show the epoll syscall failing.",
"Ok, thanks for the help.",
"@Lukasa, while I think this should be closed (since it's not a Requests bug), I also wonder if the selectors code in urllib3 should attempt to fallback to less efficient methods in cases like this and only then let the OS error bubble up. Thoughts?",
"@sigmavirus24 Yeah, so I said a few comments ago that the selectors module can detect this case by actually trying to *instantiate* the selectors, at least for some of them where the selector itself is an FD (we can't do it so easily for poll/select). That's why I tagged @SethMichaelLarson: this is a bit his baby.",
"I clearly need to finish my coffee before commenting. =)",
"Fix for this is coming within shazow/urllib3#1128. Basically when determining what `DefaultSelector` should be we'll attempt to allocate a single object in addition to checking whether `select` advertises the service if using non-`select.select` selectors. I would hope most firmware developers would not advertise `select.select` if it's not available because it's much more of a drastic difference from a usual platform."
] |
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 it looks like you were referring to the latest version of Requests. This doesn't seem to be reproducible with 2.13.0 which has the patch included in urllib3. Thanks for taking the time to open this issue, @theyoprst!"
] |
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 (or what this site thinks is one) is getting any HTML result at all:\r\n\r\n $ curl -v -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36' http://bgp.he.net/AS36375\r\n * Trying 72.52.94.234...\r\n * Connected to bgp.he.net (72.52.94.234) port 80 (#0)\r\n > GET /AS36375 HTTP/1.1\r\n > Host: bgp.he.net\r\n > Accept: */*\r\n > User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36\r\n >\r\n < HTTP/1.1 302 Found\r\n < Date: Wed, 01 Mar 2017 21:05:02 GMT\r\n < Server: Apache/2.4.7 (Ubuntu)\r\n < Cache-Control: no-cache\r\n < X-Runtime: 1\r\n < X-Powered-By: Phusion Passenger 5.0.30\r\n < Set-Cookie: c=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT\r\n < Set-Cookie: path=BAgiDS9BUzM2Mzc1--8b1b2f0af47aa09b29bfa2d05c37c7456a16a074; path=/\r\n < Location: http://bgp.he.net/cc\r\n < Content-Length: 86\r\n < Status: 302 Found\r\n < Content-Type: text/html; charset=utf-8\r\n <\r\n * Connection #0 to host bgp.he.net left intact\r\n <html><body>You are being <a href=\"http://bgp.he.net/cc\">redirected</a>.</body></html>\r\n\r\nRequest will get the same result unless it follows the redirect to http://bgp.he.net/cc. You don't have a problem, everything is working fine (except the server being stupid).",
"This is what I get using requests\r\n\r\n```\r\n>>> req = requests.get(url,headers=headers, allow_redirects=True)\r\n>>> print req.content\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\r\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\r\n<head>\r\n<!-- rmosher 2010 - 2016 -->\r\n<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\" />\r\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\r\n<script src=\"/javascripts/jquery/jquery-1.3.2.js?1235084520\" type=\"text/javascript\"></script>\r\n<script src=\"/javascripts/jquery/jquery.history.js?1364589087\" type=\"text/javascript\"></script>\r\n<script src=\"/javascripts/jquery/jquery-ui.js?1269850573\" type=\"text/javascript\"></script>\r\n<script src=\"/javascripts/jquery/jrails.js?1269850578\" type=\"text/javascript\"></script>\r\n<script src=\"/javascripts/bgp.js?1260526324\" type=\"text/javascript\"></script>\r\n<link href=\"/stylesheets/bgp.css?1455825849\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n\r\n\r\n<script src=\"/javascripts/jstest.js?1442294748\" type=\"text/javascript\"></script>\r\n<meta http-equiv=\"refresh\" content=\"15; url=/jf\">\r\n\r\n\r\n</head>\r\n\r\n<body>\r\n\t<div id='header'>\r\n\t\t<a href=\"http://www.he.net/\"><img alt='Hurricane Electric' src='/helogo.gif' /></a>\r\n\t\t<form action=\"/search\" method=\"get\">\r\n\t\t\t<div class='search'>\r\n\t\t\t<input id=\"search_search\" name=\"search[search]\" size=\"15\" type=\"text\" />\r\n\t\t\t<input name=\"commit\" type=\"submit\" value=\"Search\" />\r\n\t\t</div>\r\n\t\t</form>\r\n\t\t\r\n\t\t<div class='clear'></div>\r\n\t\t<div class='floatleft'>\r\n\t\t\t<div class='leftsidemenu'>\r\n\t\t\t\t<div class='menuheader'>Quick Links</div>\r\n\t\t\t\t<ul class='leftsidemenuitems'>\r\n\t\t\t\t\t<li><a href='http://bgp.he.net/'>BGP Toolkit Home</a></li>\r\n\t\t\t\t\t<li><a href=\"/report/prefixes\">BGP Prefix Report</a></li>\r\n\t\t\t\t\t<li><a href=\"/report/peers\">BGP Peer Report</a></li>\r\n\t\t\t\t\t<li><a href=\"/report/exchanges\">Exchange Report</a></li>\r\n\t\t\t\t\t<li><a href=\"/report/bogons\">Bogon Routes</a></li>\r\n\t\t\t\t\t<li><a href=\"/report/world\">World Report</a></li>\r\n\t\t\t\t\t<li><a href=\"/report/multi-origin-routes\">Multi Origin Routes</a></li>\r\n\t\t\t\t\t<li><a href=\"/report/dns\">DNS Report</a></li>\r\n\t\t\t\t\t<li><a href=\"/report/tophosts\">Top Host Report</a></li>\r\n\t\t\t\t\t<li><a href=\"/report/netstats\">Internet Statistics</a></li>\r\n\t\t\t\t\t<li><a href='http://lg.he.net/'>Looking Glass</a></li>\r\n\t\t\t\t\t<li><a href='http://networktools.he.net/'>Network Tools App</a></li>\r\n\t\t\t\t\t<li><a href='http://tunnelbroker.net/'>Free IPv6 Tunnel</a></li>\r\n\t\t\t\t\t<li><a href='http://ipv6.he.net/certification/'>IPv6 Certification</a></li>\r\n\t\t\t\t\t<li><a href='http://bgp.he.net/ipv6-progress-report.cgi'>IPv6 Progress</a></li>\r\n\t\t\t\t\t<li><a href='http://bgp.he.net/going-native.pdf'>Going Native</a></li>\r\n\t\t\t\t\t<li><a href='http://bgp.he.net/contact/'>Contact Us</a></li>\r\n\t\t\t\t</ul>\r\n\t\r\n\t\t\t</div>\r\n\t\t\t<div class='clear'></div>\r\n\t\t\t<div class='social'>\r\n\t\t\t\r\n\t\t\t\t<a href=\"/r/Twitter\" title=\"Hurricane Electric on Twitter\"><img alt=\"Hurricane Electric on Twitter\" src=\"/images/twitter.png?1215539178\" /></a>\r\n\t\t\t\r\n\t\t\t\t<a href=\"/r/Facebook\" title=\"Hurricane Electric on Facebook\"><img alt=\"Hurricane Electric on Facebook\" src=\"/images/facebook.png?1215539178\" /></a>\r\n\t\t\t\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\r\n\t<div id='content'>\r\n\t\t\t\r\n\t\t\r\n\r\n\t\t\r\n\r\n\r\n\r\n<div class='clear'></div>\r\n\r\n<div id='error' class='tabdata'>\r\nPlease wait while we validate your browser.\r\n</div>\r\n<script type='text/javascript'>\r\nvar _0xb539=[\"\\x62\\x67\\x70\\x2E\\x68\\x65\\x2E\\x6E\\x65\\x74\\x20\\x72\\x65\\x71\\x75\\x69\\x72\\x65\\x73\\x20\\x6A\\x61\\x76\\x61\\x73\\x63\\x72\\x69\\x70\\x74\\x20\\x61\\x6E\\x64\\x20\\x63\\x6F\\x6F\\x6B\\x69\\x65\\x73\\x20\\x74\\x6F\\x20\\x66\\x75\\x6E\\x63\\x74\\x69\\x6F\\x6E\\x2E\\x20\\x20\\x50\\x6C\\x65\\x61\\x73\\x65\\x20\\x65\\x6E\\x61\\x62\\x6C\\x65\\x20\\x74\\x68\\x65\\x73\\x65\\x20\\x69\\x6E\\x20\\x79\\x6F\\x75\\x72\\x20\\x62\\x72\\x6F\\x77\\x73\\x65\\x72\\x2E\",\"\\x74\\x65\\x78\\x74\",\"\\x23\\x65\\x72\\x72\\x6F\\x72\",\"\\x68\\x61\\x73\\x68\",\"\\x6C\\x6F\\x63\\x61\\x74\\x69\\x6F\\x6E\",\"\\x3F\\x68\\x3D\",\"\\x72\\x65\\x73\\x70\\x6F\\x6E\\x73\\x65\",\"\\x70\\x61\\x74\\x68\",\"\\x63\\x6F\\x6F\\x6B\\x69\\x65\",\"\\x6A\\x73\\x74\\x65\\x73\\x74\",\"\\x70\\x6F\\x73\\x74\",\"\\x61\\x6A\\x61\\x78\"];function printerror(){$(_0xb539[2])[_0xb539[1]](_0xb539[0])}function doredirect(_0x1cc4x3){url='/cr';if(window[_0xb539[4]][_0xb539[3]]){url+=_0xb539[5]+encodeURIComponent(window[_0xb539[4]][_0xb539[3]])};window[_0xb539[4]]=url;}$(function(){$[_0xb539[11]]({url:'/i',dataType:_0xb539[1],complete:function(_0x1cc4x3){ip=_0x1cc4x3[_0xb539[6]];$[_0xb539[11]]({url:'/jc',data:{p:$[_0xb539[9]]($[_0xb539[8]](_0xb539[7])),i:$[_0xb539[9]](ip)},type:_0xb539[10],error:printerror,complete:doredirect});},error:printerror})});\r\n</script>\r\n\r\n\r\n\r\n\t</div>\r\n\t\r\n\t<div id='footer'>\r\n\tUpdated 28 Feb 2017 13:45 PST © 2017 Hurricane Electric\r\n\t</div>\r\n\t\r\n\t<script type=\"text/javascript\">\r\n\t\tvar gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");\r\n\t\tdocument.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));\r\n\t</script>\r\n\t<script type=\"text/javascript\">\r\n\t\ttry {\r\n\t\t\tvar pageTracker = _gat._getTracker(\"UA-12276073-1\");\r\n\t\t\tpageTracker._trackPageview();\r\n\t\t} catch(err) {}\r\n\t</script>\r\n</body>\r\n</html>\r\n```",
"I need what it's inside this div\r\n\r\n```\r\n<div id='error' class='tabdata'>\r\nPlease wait while we validate your browser.\r\n</div>\r\n<script type='text/javascript'>\r\nvar _0xb539=[\"\\x62\\x67\\x70\\x2E\\x68\\x65\\x2E\\x6E\\x65\\x74\\x20\\x72\\x65\\x71\\x75\\x69\\x72\\x65\\x73\\x20\\x6A\\x61\\x76\\x61\\x73\\x63\\x72\\x69\\x70\\x74\\x20\\x61\\x6E\\x64\\x20\\x63\\x6F\\x6F\\x6B\\x69\\x65\\x73\\x20\\x74\\x6F\\x20\\x66\\x75\\x6E\\x63\\x74\\x69\\x6F\\x6E\\x2E\\x20\\x20\\x50\\x6C\\x65\\x61\\x73\\x65\\x20\\x65\\x6E\\x61\\x62\\x6C\\x65\\x20\\x74\\x68\\x65\\x73\\x65\\x20\\x69\\x6E\\x20\\x79\\x6F\\x75\\x72\\x20\\x62\\x72\\x6F\\x77\\x73\\x65\\x72\\x2E\",\"\\x74\\x65\\x78\\x74\",\"\\x23\\x65\\x72\\x72\\x6F\\x72\",\"\\x68\\x61\\x73\\x68\",\"\\x6C\\x6F\\x63\\x61\\x74\\x69\\x6F\\x6E\",\"\\x3F\\x68\\x3D\",\"\\x72\\x65\\x73\\x70\\x6F\\x6E\\x73\\x65\",\"\\x70\\x61\\x74\\x68\",\"\\x63\\x6F\\x6F\\x6B\\x69\\x65\",\"\\x6A\\x73\\x74\\x65\\x73\\x74\",\"\\x70\\x6F\\x73\\x74\",\"\\x61\\x6A\\x61\\x78\"];function printerror(){$(_0xb539[2])[_0xb539[1]](_0xb539[0])}function doredirect(_0x1cc4x3){url='/cr';if(window[_0xb539[4]][_0xb539[3]]){url+=_0xb539[5]+encodeURIComponent(window[_0xb539[4]][_0xb539[3]])};window[_0xb539[4]]=url;}$(function(){$[_0xb539[11]]({url:'/i',dataType:_0xb539[1],complete:function(_0x1cc4x3){ip=_0x1cc4x3[_0xb539[6]];$[_0xb539[11]]({url:'/jc',data:{p:$[_0xb539[9]]($[_0xb539[8]](_0xb539[7])),i:$[_0xb539[9]](ip)},type:_0xb539[10],error:printerror,complete:doredirect});},error:printerror})});\r\n</script>\r\n```",
"That's not a problem request can help you with. Use a HTML parser like https://www.crummy.com/software/BeautifulSoup/ or http://lxml.de/lxmlhtml.html.",
"BeautifulSoup will parse only after opening and reading the content, so it doesn't work.",
"Requests cannot run the JavaScript for you. If you need to run JavaScript (and it looks like you do), then you'll need to use something like selenium that can automate a web browser for you. ",
"@Lukasa I was just going to that direction. Thanks.",
"I'm going to close this, as this isn't an issue with Requests. Cheers @brangi @lutzhorn!",
"> @Lukasa I was just going to that direction. Thanks.\r\n\r\n@brangi did you solved this?"
] |
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** coverage by `0.15%`.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3903 +/- ##\n==========================================\n+ Coverage 89.17% 89.32% +0.15% \n==========================================\n Files 15 15 \n Lines 1940 1940 \n==========================================\n+ Hits 1730 1733 +3 \n+ Misses 210 207 -3\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3903?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/__init__.py](https://codecov.io/gh/kennethreitz/requests/compare/3f3df8b5ffbbd617a32a9b01503f02e30a0818ee...21972c4601378fcad28cbc63466775b76d6a888a?src=pr&el=tree#diff-cmVxdWVzdHMvX19pbml0X18ucHk=) | `93.33% <0%> (+10%)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3903?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3903?src=pr&el=footer). Last update [3f3df8b...21972c4](https://codecov.io/gh/kennethreitz/requests/compare/3f3df8b5ffbbd617a32a9b01503f02e30a0818ee...21972c4601378fcad28cbc63466775b76d6a888a?src=pr&el=footer&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"Can you do a rebase? ",
"If you need help with that, let me know. ",
"I'm going to merge this by hand. "
] |
|
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 documentation: [More complicated POST requests](http://docs.python-requests.org/en/master/user/quickstart/#more-complicated-post-requests). My proposed change is right after the first code block.",
"this sounds good to me!",
"go for it @garywu!"
] |
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** coverage by `0.15%`.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3901 +/- ##\n==========================================\n+ Coverage 89.17% 89.32% +0.15% \n==========================================\n Files 15 15 \n Lines 1940 1940 \n==========================================\n+ Hits 1730 1733 +3 \n+ Misses 210 207 -3\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3901?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/__init__.py](https://codecov.io/gh/kennethreitz/requests/compare/3f3df8b5ffbbd617a32a9b01503f02e30a0818ee...722a2dfb63b87f13875bc9e60193774feaeafa5a?src=pr&el=tree#diff-cmVxdWVzdHMvX19pbml0X18ucHk=) | `93.33% <0%> (+10%)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3901?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3901?src=pr&el=footer). Last update [3f3df8b...eca8351](https://codecov.io/gh/kennethreitz/requests/compare/3f3df8b5ffbbd617a32a9b01503f02e30a0818ee...eca835149157f49e53f6e77dff7d839021ed79bf?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"Nice first commit, thanks @nedbat!"
] |
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** coverage.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3900 +/- ##\n=======================================\n Coverage 89.32% 89.32% \n=======================================\n Files 15 15 \n Lines 1940 1940 \n=======================================\n Hits 1733 1733 \n Misses 207 207\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3900?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/api.py](https://codecov.io/gh/kennethreitz/requests/compare/2aaf6ac03862d29ef8664aa8650a3c34ac4a0b2d...3d22f9f5ab52a0a58b7ffca13ea5aba9f37b6536?src=pr&el=tree#diff-cmVxdWVzdHMvYXBpLnB5) | `81.81% <ø> (ø)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3900?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3900?src=pr&el=footer). Last update [2aaf6ac...3d22f9f](https://codecov.io/gh/kennethreitz/requests/compare/2aaf6ac03862d29ef8664aa8650a3c34ac4a0b2d...3d22f9f5ab52a0a58b7ffca13ea5aba9f37b6536?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments)."
] |
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. This is correct, passing it unencoded using a plain colon `:` is not recommended.\r\n\r\nSo if the server you try to access can't URL decode the parameter value, the server should be fixed.",
"Requests will avoid aggressively handling your string if you do what @patallen suggests, which should resolve your problem, but @lutzhorn is right: the server should accept both, and is at fault here. :smile:",
"I'd also add that sending a password via a http connection isn't a good\nidea either, especially as part of the url\n",
"Hi All\r\n\r\nthank you for your help\r\n@lutzhorn is true, and i have reported the problem as well, but i'm sure that is a bit difficult to solve from the server part, is Asterisk the open source PBX and have a very large list of issues.\r\n@TetraEtc yes but the URL is into the internal network and have no external access\r\n\r\n@Lukasa and @patallen , thank you i will use your suggestion, hope is work well\r\n\r\n"
] |
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 **increase** coverage by `0.11%`.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## proposed/3.0.0 #3897 +/- ##\n==================================================\n+ Coverage 89.21% 89.32% +0.11% \n==================================================\n Files 15 15 \n Lines 1928 1930 +2 \n==================================================\n+ Hits 1720 1724 +4 \n+ Misses 208 206 -2\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3897?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/kennethreitz/requests/compare/60339d17eede9d424df9ed685ff8d60caeb3a521...be2f92b9e300d0b5c7af0fed7d1f421b06676d3a?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `85.93% <100%> (+0.14%)` | :white_check_mark: |\n| [requests/exceptions.py](https://codecov.io/gh/kennethreitz/requests/compare/60339d17eede9d424df9ed685ff8d60caeb3a521...be2f92b9e300d0b5c7af0fed7d1f421b06676d3a?src=pr&el=tree#diff-cmVxdWVzdHMvZXhjZXB0aW9ucy5weQ==) | `100% <100%> (ø)` | :white_check_mark: |\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/compare/60339d17eede9d424df9ed685ff8d60caeb3a521...be2f92b9e300d0b5c7af0fed7d1f421b06676d3a?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.73% <100%> (+0.4%)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3897?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3897?src=pr&el=footer). Last update [60339d1...be2f92b](https://codecov.io/gh/kennethreitz/requests/compare/60339d17eede9d424df9ed685ff8d60caeb3a521...be2f92b9e300d0b5c7af0fed7d1f421b06676d3a?src=pr&el=footer&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"@nateprewitt nice work on this, thanks for getting this over the finish line",
"@davidsoncasey, glad we're able to get all of your work merged, thanks again!\r\n\r\n@Lukasa, 3.0-HISTORY is updated :)",
"It's the little things you forget setting up a new machine 😅 Time to add a global .gitignore. "
] |
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\n requests.put(\r\n url,\r\n data=open(file_path, 'rb'),\r\n headers={\r\n 'x-ms-blob-type': 'BlockBlob',\r\n }\r\n )\r\n```",
"You. Are. So. Handsome. Thanks a ton!! That was about an hour spent trying to fix that, agh!",
"This really helped me, too. Thanks a ton, @Lukasa "
] |
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.quandl.com', port=443): With the proxy dict it is successful. (this is without a redirect to amazon)\r\n\r\nI'm on windows so it uses either Kerberos or NTLM not sure which?",
"Requests does not transparently support Kerberos or NTLM. You'd need to use something like requests-kerberos or requests-ntlm to support those auth challenges. However, I don't think *either* support authing to CONNECT tunnelling proxies via those protocols.",
"Why would 1st connection to quandl.com authenticate via proxy automatically but the redirect does not?",
"@toasteez Can you show me the proxy dictionary?",
"proxies = {'http': 'http://proxy.company.org:8080',\r\n 'https': 'http://proxy.company.org:8080',}",
"So, my best guess is that the first request does not need auth because the proxy server has decided that requests to that hostname (www.quandl.com) do not need authorization, while requests to the second hostname (which belongs to Amazon) do. That is, that this is a proxy concern.",
"OK. Thanks. How do I pass the auth and pw via requests to try this out? My preferred option is to make this seamless without hard coding my credentials anywhere though.",
"If you can auth to the proxy using basic auth you need to pass them in the URL to the proxy, e.g. `{'https': 'http://username:[email protected]:8080'}`. If you need to auth using Kerberos or NTLM you'll need to consult the documentation for those modules.",
"Or could this be wrapped up somehow to work?\r\n\r\nimport win32com.client\r\n\r\nurl = 'https://...'\r\n\r\nh = win32com.client.Dispatch('WinHTTP.WinHTTPRequest.5.1')\r\nh.SetAutoLogonPolicy(0)\r\nh.Open('GET', url, False)\r\nh.Send()\r\nresult = h.responseText\r\nresult",
"It's not at all clear to me what you're trying to do with the above code.",
"Ignoring the above the adding the user:password to the proxy results in:\r\n\r\nSSLError: (\"bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)\",)\r\n",
"Ok, so it looks very much like the proxy is attempting to place itself as a man-in-the-middle on your HTTPS connection by decrypting the traffic to Amazon. To allow that you'll need to get the certificate authority your proxy is using to build its TLS certificates and pass the path to that cert to `verify`.",
"OK thanks, is there a way to not have to have the user:pass in any script?",
"Yes. Requests supports reading proxy data from the environment variables `HTTP_PROXY` and `HTTPS_PROXY`. You can set those up to have the same strings in them that you have as the values of the proxy dictionary. The proxy dictionary then becomes unnecessary. Otherwise, you should write code to read them from config files.",
"It still requires user : password to be in plaintext somewhere which I don't like.\r\n\r\nDo you where the machine certificate store would be located on windows? (I can make it work with verify false now.)\r\n",
"The windows certificate store is in the registry. The `wincertstore` module can help you with that.",
"using the example on the wincertstore site what would I pass to verify? \r\n\r\n import wincertstore\r\n for storename in (\"CA\", \"ROOT\"):\r\n with wincertstore.CertSystemStore(storename) as store:\r\n for cert in store.itercerts(usage=wincertstore.SERVER_AUTH):\r\n print(cert.get_pem())\r\n print(cert.get_name())\r\n print(cert.enhanced_keyusage_names())",
"You'd need to iterate over the store and write out all of `cert.get_pem()` to a file, and then use that.",
"OK, one other thing, what is easier to implement requests-kerberos or requests-ntlm? I think our proxy supports either and want to try easiest first.",
"I am honestly not sure. Might be worth trying either. :smile:",
"I've made good progress now, appreciate the input. I hope quandl add the proxy and the verify to their implementation.",
"Indeed, good luck!",
"requests-kerberos gives a MutualAuthenticationError: Unable to authenticate <Response [302]>\r\n\r\nI think this is now related to [issue 64](https://github.com/requests/requests-kerberos/issues/64)\r\n\r\nrequest-ntlm requires the user and password so doesn't add value.\r\n\r\n"
] |
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,
"description": null,
"id": 136616769,
"name": "Documentation",
"node_id": "MDU6TGFiZWwxMzY2MTY3Njk=",
"url": "https://api.github.com/repos/psf/requests/labels/Documentation"
}
] |
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-urlencoded data.\r\n\r\nSo, in general I'd say that our behaviour is in-line with what most users who have used other libraries would expect, but it also can't hurt to elaborate a bit. This is a good PR for a first-time contributor to pick up, so I'm going to attach some labels and let someone come along to fix it.",
"I also expected it to be urlencoded. But I had to think 15sec to conclude that urlencoding was what made the most of sense. So +1 for a PR to clarify the doc.",
"In http://docs.python-requests.org/en/master/api/#lower-level-classes, the form-encoding is mentioned:\r\n\r\n> data -- the body to attach to the request. If a dictionary is provided, form-encoding will take place.\r\n"
] |
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** coverage by `0.24%`.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3892 +/- ##\n==========================================\n+ Coverage 89.08% 89.32% +0.24% \n==========================================\n Files 15 15 \n Lines 1896 1940 +44 \n==========================================\n+ Hits 1689 1733 +44 \n Misses 207 207\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3892?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/kennethreitz/requests/compare/d6f4818c0b40bc6c00433c013b7daaea83b2cd51...e5aa914e6aac14363a651ecc8d01a46a8757ce82?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `85.02% <ø> (+0.08%)` | :white_check_mark: |\n| [requests/structures.py](https://codecov.io/gh/kennethreitz/requests/compare/d6f4818c0b40bc6c00433c013b7daaea83b2cd51...e5aa914e6aac14363a651ecc8d01a46a8757ce82?src=pr&el=tree#diff-cmVxdWVzdHMvc3RydWN0dXJlcy5weQ==) | `100% <0%> (ø)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3892?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3892?src=pr&el=footer). Last update [d6f4818...e5aa914](https://codecov.io/gh/kennethreitz/requests/compare/d6f4818c0b40bc6c00433c013b7daaea83b2cd51...e5aa914e6aac14363a651ecc8d01a46a8757ce82?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"This looks good now, I think. @vpfautz if you feel like it, this can be patched in [urllib3](https://github.com/shazow/urllib3) too.\r\n\r\nAlso thanks for catching this! I shouldn't be typing without spell check in my IDE :)"
] |
|
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.",
"@SirCmpwn is it possible Amazon is relying on cookies set by JavaScript?",
"I get different results in my browser on amazon.com when I have JavaScript disabled. I can't log in without it - I get a captcha that seems to be impossible to solve. But this is different from the behavior I get with requests.",
"What if you use your browser's User-Agent string in Requests? Do you get the same behaviour then?",
"Yes.",
"So, Amazon requires javascript and a UA that looks vaguely like a browser. This is pretty clearly **not** a bug in requests."
] |
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 the process, but there is really nothing we can do to meaningfully prevent this. If you mess with the socket object, it will affect us too: nothing can be done about that.",
"This does not make any sense.\r\n\r\n`wrapmodule` implies that it will only be applied for the module (and possibly its children).\r\n\r\nAt the very least the naming is wrong.\r\n\r\nCould it not be possible to clone the module and ensure it is only applied for `smtplib` and children?",
"> This does not make any sense.\n\nPossibly you meant to say, \"I do not understand this\"?\nPossibly you are mistaken. Possibly you are confused. Possibly \"this\"\nmakes total sense.\n\nHumbleness. Try it. Others may find your words more acceptable that way.\n\n\nOn Sun, Nov 18, 2018 at 9:58 PM Pascal van Kooten <[email protected]>\nwrote:\n\n> This does not make any sense.\n>\n> wrapmodule implies that it will only be for the module (and possibly its\n> children).\n>\n> At the very least the naming is wrong.\n>\n> Could it not be possible to clone the module and ensure it is only applied\n> for smtplib and children?\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/issues/3890#issuecomment-439780174>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AADlQLzJ5RWyrqfVmtaqjyRU4EUzfB94ks5uwkiMgaJpZM4MLoxP>\n> .\n>\n",
"I meant what I said. Deal with it, it's the internet. I chose the tone because of the severity of the issue, actually. \r\n\r\nAlso, content-wise, I feel like it deserves a strong reaction because this is a very big problem. \r\nIt's one of the biggest sins when this behavior can cause an interaction based on which other modules are loaded. \r\n\r\nMonkey patching at the level of affecting only smtplib is acceptable, but leaking beyond a single module (and its children) should not be acceptable.\r\n\r\n(I'm happy with any feedback on my projects; user frustration is useful in whatever shape it comes) ",
"Oh, I fully expected that you meant what you said, which is why I felt a need to address your attitude. I meant what I said as well. \r\n\r\nI'm simply an observer on this project. I have very seldom observed rudeness here, especially from anyone expecting cooperation and collaboration in return.\r\n\r\nI'm happy to reiterate: Humbleness. Try it. Better still: Embrace the humility of uncertainty. https://www.ted.com/talks/julia_dhar_how_to_disagree_productively_and_find_common_ground\r\n ",
"I'm sure he won't watch that ted talk that you just posted"
] |
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 a specific encoding you want to do you should disallow redirects and take control over URL encoding yourself. @Lukasa may disagree, though.\r\n\r\n[7230]: https://tools.ietf.org/html/rfc7230\r\n[7231]: https://tools.ietf.org/html/rfc7231\r\n[7232]: https://tools.ietf.org/html/rfc7232\r\n[7233]: https://tools.ietf.org/html/rfc7233\r\n[7234]: https://tools.ietf.org/html/rfc7234\r\n[7235]: https://tools.ietf.org/html/rfc7235",
"Thanks for this report!\r\n\r\nFirstly, RFC 2616 is dead. It has been superseded by RFCs 723[0-3] for HTTP/1.1. Secondly, ISO-8859-1 is not unambiguously the correct encoding for header values. In practice, no HTTP specification has ever unequivocally required that ISO-8859-1 be used for header values, and it is quite common to encounter non-ISO-8859-1 header values. The only requirement RFC 7230 places on the receiver is to parse the HTTP message using an encoding that is a superset of US-ASCII, which allows both ISO-8859-1 and UTF-8.\r\n\r\nHowever, I agree that there is a problem: it's just not been characterised quite right. The *real* problem is that we should be operating on the location header as a set of bytes that are a encoded in some random encoding that is a superset of US-ASCII. Because of httplib's decision to decode using ISO-8859-1 (a *bad* decision, but there we are), we need to *re-encode* using ISO-8859-1 as well to get back to the \"random sequence of bytes\" place.\r\n\r\nSo, I agree that this is an issue, but I'm not entirely confident it's a real bad one. I'd be open to a fix, but I'd definitely want to see a test that reproduces a real problem. You're right that `test_lowlevel.py` is the right place, so if you can write a test there that demonstrates the issue I'll be open to considering a fix for this (and working out whether it is likely to break something or not).",
"Also, worthy of note, in 7230 on [Page 26](https://tools.ietf.org/html/rfc7230#page-26)\r\n\r\n> Historically, HTTP has allowed field content with text in the\r\n> ISO-8859-1 charset [ISO-8859-1], supporting other charsets only\r\n> through use of [RFC2047] encoding. In practice, most HTTP header\r\n> field values use only a subset of the US-ASCII charset [USASCII].\r\n> Newly defined header fields SHOULD limit their field values to\r\n> US-ASCII octets. A recipient SHOULD treat other octets in field\r\n> content (obs-text) as opaque data.\r\n",
"I believe this has also been discussed as an issue to fix in urllib3 in shazow/urllib3#952, which may be the more appropriate location to handle this.",
"Haha, obviously one shouldn't believe everything they read on stackoverflow. I suspected that the rfc might be out of date but didn't put in enough efforts to find the final version :) (As a side note, the quote from 7230 seems to refer to newly defined fields, which Location isn't. But will check it out, as I also reported this as a bug towards the operators of the service.)\r\n\r\nBut indeed how I ran into the issue was a server that sent the location header utf-8 encoded and after some debugging I found that http lib parses it as iso-8859-1 and as a result re-encoding it as utf-8 will cause problems with any non-ascii location header.",
"@nateprewitt Nah, I think these are different issues. This is because requests *does* urlencode the redirect header, but it also *character* encodes it, wrongly.\r\n\r\nBut yeah, I'm prepared to believe that that example is a good example of how we get it wrong. Happily, ISO-8859-1 is round-trippable.",
"Hi all, \r\n\r\nAfter digging into requests, urllib3 and httplib regarding response headers and location encoding lately (on #3963), I am willing to try and solve this issue :smile: .\r\n\r\n# The Problem\r\nAFAICS, the issue starts with the difference between python2 and python3 httplib implementation of reading headers.\r\n\r\nin python3 the code that parse the headers is like this (from [here](https://github.com/python/cpython/blob/master/Lib/http/client.py#L213)):\r\n\r\n```python\r\ndef parse_headers(fp, _class=HTTPMessage):\r\n \"\"\"Parses only RFC2822 headers from a file pointer.\r\n email Parser wants to see strings rather than bytes.\r\n But a TextIOWrapper around self.rfile would buffer too many bytes\r\n from the stream, bytes which we later need to read as bytes.\r\n So we read the correct bytes here, as bytes, for email Parser\r\n to parse.\r\n \"\"\"\r\n headers = []\r\n while True:\r\n line = fp.readline(_MAXLINE + 1)\r\n if len(line) > _MAXLINE:\r\n raise LineTooLong(\"header line\")\r\n headers.append(line)\r\n if len(headers) > _MAXHEADERS:\r\n raise HTTPException(\"got more than %d headers\" % _MAXHEADERS)\r\n if line in (b'\\r\\n', b'\\n', b''):\r\n break\r\n hstring = b''.join(headers).decode('iso-8859-1')\r\n return email.parser.Parser(_class=_class).parsestr(hstring)\r\n```\r\n\r\n**we can clearly see it decodes into iso-8859-1 (aka latin1)**\r\n\r\nnow on python2 the code is completely different (from [here](https://github.com/python/cpython/blob/2.7/Lib/httplib.py#L271)):\r\n\r\n```python\r\n def readheaders(self):\r\n...........\r\n self.headers = hlist = []\r\n self.status = ''\r\n headerseen = \"\"\r\n firstline = 1\r\n tell = None\r\n if not hasattr(self.fp, 'unread') and self.seekable:\r\n tell = self.fp.tell\r\n while True:\r\n if len(hlist) > _MAXHEADERS:\r\n raise HTTPException(\"got more than %d headers\" % _MAXHEADERS)\r\n...........\r\n if headerseen and line[0] in ' \\t':\r\n # XXX Not sure if continuation lines are handled properly\r\n # for http and/or for repeating headers\r\n # It's a continuation line.\r\n hlist.append(line)\r\n self.addcontinue(headerseen, line.strip())\r\n continue\r\n...........\r\n if headerseen:\r\n # It's a legal header line, save it.\r\n hlist.append(line)\r\n self.addheader(headerseen, line[len(headerseen)+1:].strip())\r\n ..........\r\n```\r\n\r\n**on python2 it returns the data encoded (i.e. python2 str)**\r\n\r\nThis inconsistency affect requests (and probably urllib3 - issue https://github.com/shazow/urllib3/issues/952).\r\n\r\n# Possible Solutions\r\n1. solve this on requests:\r\nchange `SessionRedirectMixin.get_redirect_target()` to something like this:\r\n\r\n```python\r\n def get_redirect_target(self, resp):\r\n \"\"\"Receives a Response. Returns a redirect URI or ``None``\"\"\"\r\n if resp.is_redirect:\r\n location = resp.headers['location']\r\n # issue with httplib blbablabla\r\n if is_py3:\r\n location = location.encode('latin1')\r\n return to_native_string(location, 'utf8')\r\n return None\r\n```\r\n\r\n2. solve this on urllib3\r\n\r\nplease advise if any of the solutions (or any other solution) is desired and I can write some PR for it.\r\n\r\nThanks,\r\nShmulik",
"This is solved in the v2 branch of urllib3 so we don't need to worry about it right now. Instead, let's focus on Requests and the here-and-now.\r\n\r\nAs discussed above, I think the thing to do is to do something similar to your suggestion. However, it's vitally important that we have a failing test *first* to validate that this works the way we want it to.\r\n\r\nI am also unsure whether or not this is a breaking change yet. It feels like it might be, given that it changes the return value of `get_redirect_target`.",
"ok lets do this, I'll try write a PR for fixing it. \r\n\r\nCan you provide more info regarding the API changes?\r\nthe code above returns same type (unicode on python3, bytes on python2), its only a fixing the wrong encoding. what am I missing?",
"Oh good spot. So the only risk is that we'll break anyone who is already working around this issue in their code, but I think that's ok. We'll be doing them a favour in the long term. ;)",
"can we close this issue now? anything else that I can help with?",
"It looks like this is wrapped up now with #3969. Thanks for all your work @shmuelamar!"
] |
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 HTTPAdapter already takes `max_retries` as an argument. (But I'm sure you already knew that, so writing it more for others than anything). \r\n\r\nHowever, I was wondering if a PR might be accepted if it consisted of making it possible to max_retries higher up. Ie in `session.send` [method](https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L599) perhaps. We could modify the adapters `max_retry` [here](https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L633). Then it could be bubbled up to the [request method](https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L440), which can be used by [`requests.get`](https://github.com/kennethreitz/requests/blob/master/requests/api.py#L61)\r\n\r\nI've wanted to have a custom max_retries more than once and every time it feels like I need to dig into the internals. It would be nice if you could get a slightly better interface for that :). If you think this could be a viable approach I'd be willing to give a try in making a PR. \r\n\r\n ",
"I'm afraid we don't plan to add anything new to the API at this time. We jealously police the API for any new arguments because we already have a large enough number to start causing confusion: adding more just makes it worse.\r\n\r\nWe want to ensure things like these are possible, and I think we've done that. But it's just not sufficiently pressing to justify the API extension, I'm afraid.",
"I understand. Would you still object if max_retries was extended to `session.send`? Even that would make it a whole lot easier to work with. That way `max_retries` would still be hidden away from the top layer api and any confusion of `max_retries` would be avoided.",
"@Lukasa @jonathan-s My interest was spurred on by this blog post [https://stripe.com/blog/idempotency](https://stripe.com/blog/idempotency). See the \"Being a good distributed citizen\" section.",
"I don't *strongly* object to it, but it is a backward incompatible API change to do it. In this instance, I'm not sure how helpful it is to do it: are you regularly changing the value of `max_retries`?",
"@Lukasa I myself don't particularly care about `max_retries`. I want to easily set the [backoff_factor](https://github.com/kennethreitz/requests/blob/e3f89bf23c53b98593e4248054661472aacac820/requests/packages/urllib3/util/retry.py#L104). By default it is disabled, which is not good.",
"Whenever I'm writing some kind of wrapper or want to make sure that the request that I'm sending doesn't just didn't fail once I would like to change the value of `max_retries`. It's a nice feature add retries with the granularity that the `Retry` class allows you to. \r\n\r\n@ofek, The `max_retries` argument takes the `Retry` class which allows you to set `backoff_factor` :). ",
"Oh, then yes, we need the same thing!",
"@jonathan-s What I'm getting at is: do you have a situation where you will mostly want a default value of `max_retries` but from time-to-time will want a different one? Is there a reason that that cannot be handled with just always using the larger value of `max_retries`?"
] |
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 **decrease** coverage by `-0.02%`.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## proposed/3.0.0 #3886 +/- ##\n==================================================\n- Coverage 89.22% 89.21% -0.02% \n==================================================\n Files 15 15 \n Lines 1931 1928 -3 \n==================================================\n- Hits 1723 1720 -3 \n Misses 208 208\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3886?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/compare/b22833ce2a2c44d9e53f726e10cb3aac08ae49a5...8e07dae0fda85f102976a7e9b55d612cbaaf9cf0?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `93.04% <100%> (-0.08%)` | :x: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3886?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3886?src=pr&el=footer). Last update [b22833c...8e07dae](https://codecov.io/gh/kennethreitz/requests/compare/b22833ce2a2c44d9e53f726e10cb3aac08ae49a5...8e07dae0fda85f102976a7e9b55d612cbaaf9cf0?src=pr&el=footer&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"> The fact that this counts as regressing code review is stupid but there we are.\r\n\r\nHow do you mean, @Lukasa?\r\n\r\nThis looks generally fairly good, but I'm not sure I'm entirely clear. We're changing the ordering of the response history? Is there a good reason why? Has it been wrong all this time?",
"> This looks generally fairly good, but I'm not sure I'm entirely clear. We're changing the ordering of the response history? Is there a good reason why? Has it been wrong all this time?\r\n\r\nThe original approach managed the history *before* a new request was made and ignored the original request. So it was \"wrong\" as it missed the original request. The logic on the loop's construction is somewhat painful to follow, and requires a lot of cleanup in `send` to build the correct history.\r\n\r\nAssuming the URI `a` is requested and `g` is the final URI, the original code sets up history like this:\r\n\r\n history = [b, c, d, e, f, g, ]\r\n\r\nthe send routine then cleans it up as such:\r\n\r\n history.insert(0, a)\r\n r = history.pop()\r\n r.history = history\r\n\r\nSo the result is:\r\n\r\n r = g\r\n r.history = [a, b, c, d, e, f, ]\r\n\r\nThe new setup maintains the actual history:\r\n\r\n history = [a, b, c, d, e, f, g, ]\r\n\r\nSo the cleanup in `send` is more straightforward:\r\n\r\n r = history.pop()\r\n\r\nand we end up with:\r\n\r\n r = g\r\n r.history = [a, b, c, d, e, f, ]\r\n\r\nThis patch makes the `history` less-wrong and removes the weird juggling that was required by the loop. The first element is now correct (the original `a`), however the last element of `history` is still the most-recent request/response and needs to be popped off to replace `r`. in the `send` method, `r.history` and `history` are distinct lists. `r.history` contains the actual history for that response (thanks to the fix in the above loop), however `history` is more like a list of the yielded/generated `responses` (that each contain a history).\r\n\r\n",
"Ah, I see. So this makes it better for folks handling their own redirect logic to see the *complete* history. 👍 Sounds good to me.",
"\n\n> On Feb 25, 2017, at 10:05 AM, Ian Cordasco <[email protected]> wrote:\n> \n> Ah, I see. So this makes it better for folks handling their own redirect logic to see the complete history. 👍 Sounds good to me.\n> \nMore importantly, It will make things much more straightforward for people subclassing \"send\" and future edits to the core redirect logic will be easier (I lost a few hours deciphering what was going on, because the variables swap around midway )."
] |
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** coverage by `0.24%`.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3885 +/- ##\n==========================================\n+ Coverage 89.08% 89.32% +0.24% \n==========================================\n Files 15 15 \n Lines 1896 1940 +44 \n==========================================\n+ Hits 1689 1733 +44 \n Misses 207 207\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3885?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/kennethreitz/requests/compare/d6f4818c0b40bc6c00433c013b7daaea83b2cd51...c121b98c4eb1e4ee8927995d9b9f1d6bdccd9349?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `85.02% <100%> (+0.08%)` | :white_check_mark: |\n| [requests/structures.py](https://codecov.io/gh/kennethreitz/requests/compare/d6f4818c0b40bc6c00433c013b7daaea83b2cd51...c121b98c4eb1e4ee8927995d9b9f1d6bdccd9349?src=pr&el=tree#diff-cmVxdWVzdHMvc3RydWN0dXJlcy5weQ==) | `100% <100%> (ø)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3885?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3885?src=pr&el=footer). Last update [d6f4818...c121b98](https://codecov.io/gh/kennethreitz/requests/compare/d6f4818c0b40bc6c00433c013b7daaea83b2cd51...c121b98c4eb1e4ee8927995d9b9f1d6bdccd9349?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"@Lukasa I see a line like this already in the code base\r\n\r\n```\r\ncurrent_time = getattr(time, 'monotonic', time.time)\r\n```\r\n\r\nas a top level definition. I've attempted to mock those, but my attempts so far have had some code smells. I've added a new commit that attempts to mock those in the least smelly way, but it's not ideal. Can you help me iron these out so they aren't so strange?\r\n\r\nMy approaches so far:\r\n1. I set `current_time` in the class and mock it using `mocker.patch.object`. If I set it as a staticmethod or a classmethod, I'm not able to replace the function with a lambda w/o any args or with one anonymous arg. I'd rather not set it as an instance method of the class as that's a bit strange.\r\n1. I use `mocker.patch` and set `current_time` at the global level of requests.structures. The only problem then is I have to import requests.structures (or just requests.structures.current_time), and pyflakes complains about an unused import.\r\n\r\nWould appreciate any suggestions.",
"Your mocking will get a lot easier if you make the `_current_time` callable a module-level object rather than putting it at class scope. =)",
"I think I must have had a typo, `mocker.patch` with the fully-qualified package name for `current_time` works without doing any extra non-used imports.",
"@Lukasa thanks for your help with this. As for squashing up all of the commits this PR has accumulated--who should do that? Do the maintainers of this lib do that? Or I can squash locally and push to a new PR (or just force push).",
"If you squash locally and force push that's fine, GitHub will work it all out. 👍",
"Force pushed commit addresses the whitespace issues"
] |
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** coverage by `0.01%`.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3884 +/- ##\n==========================================\n+ Coverage 89.32% 89.34% +0.01% \n==========================================\n Files 15 15 \n Lines 1940 1942 +2 \n==========================================\n+ Hits 1733 1735 +2 \n Misses 207 207\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3884?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/auth.py](https://codecov.io/gh/kennethreitz/requests/compare/2aaf6ac03862d29ef8664aa8650a3c34ac4a0b2d...0455544379f21b0a0ae6741fa536c59e47df999c?src=pr&el=tree#diff-cmVxdWVzdHMvYXV0aC5weQ==) | `86.58% <100%> (+0.08%)` | :white_check_mark: |\n| [requests/hooks.py](https://codecov.io/gh/kennethreitz/requests/compare/2aaf6ac03862d29ef8664aa8650a3c34ac4a0b2d...0455544379f21b0a0ae6741fa536c59e47df999c?src=pr&el=tree#diff-cmVxdWVzdHMvaG9va3MucHk=) | `100% <100%> (ø)` | :white_check_mark: |\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/compare/2aaf6ac03862d29ef8664aa8650a3c34ac4a0b2d...0455544379f21b0a0ae6741fa536c59e47df999c?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `92.93% <100%> (ø)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3884?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3884?src=pr&el=footer). Last update [2aaf6ac...0455544](https://codecov.io/gh/kennethreitz/requests/compare/2aaf6ac03862d29ef8664aa8650a3c34ac4a0b2d...0455544379f21b0a0ae6741fa536c59e47df999c?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"Thanks for this! I think this is absolutely worth doing but there's an element of style consideration here, so I'm going to let @kennethreitz make the call on this one."
] |
|
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 will cause a number of these problems.\r\n\r\nThe easiest way to solve this problem for the moment is to `pip install pyopenssl idna`. That will let us use a newer OpenSSL, which should resolve the problem.",
"@Lukasa, this patch is not helping. `pip install pyopenssl idna`.\r\n\r\nStill facing the following error on Mac.\r\n\r\n```\r\nrequests.exceptions.ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))\r\n```\r\n\r\nSame python script works on Ubuntu but not on Mac.",
"Can you provide the output from `python -m requests.help`?",
"@Lukasa updated the requests module, which resolved the issue.\r\n\r\nAnyway, this is the output of `python -m requests.help`\r\n\r\n```\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n }, \r\n \"cryptography\": {\r\n \"version\": \"2.0.3\"\r\n }, \r\n \"idna\": {\r\n \"version\": \"\"\r\n }, \r\n \"implementation\": {\r\n \"name\": \"CPython\", \r\n \"version\": \"2.7.10\"\r\n }, \r\n \"platform\": {\r\n \"release\": \"15.6.0\", \r\n \"system\": \"Darwin\"\r\n }, \r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010006f\", \r\n \"version\": \"17.2.0\"\r\n }, \r\n \"requests\": {\r\n \"version\": \"2.18.3\"\r\n }, \r\n \"system_ssl\": {\r\n \"version\": \"9081df\"\r\n }, \r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n }, \r\n \"using_pyopenssl\": true\r\n}\r\n```\r\n\r\nThanks for getting back.",
"I've also encountered the same issue, and the patch is also not work.\r\n\r\n```\r\n {\r\n \t\"chardet\": {\r\n \t\t\"version\": \"3.0.4\"\r\n \t},\r\n \t\"cryptography\": {\r\n \t\t\"version\": \"2.0.3\"\r\n \t},\r\n \t\"idna\": {\r\n \t\t\"version\": \"2.6\"\r\n \t},\r\n \t\"implementation\": {\r\n \t\t\"name\": \"CPython\",\r\n \t\t\"version\": \"2.7.10\"\r\n \t},\r\n \t\"platform\": {\r\n \t\t\"release\": \"16.6.0\",\r\n \t\t\"system\": \"Darwin\"\r\n \t},\r\n \t\"pyOpenSSL\": {\r\n \t\t\"openssl_version\": \"1010006f\",\r\n \t\t\"version\": \"17.2.0\"\r\n \t},\r\n \t\"requests\": {\r\n \t\t\"version\": \"2.18.3\"\r\n \t},\r\n \t\"system_ssl\": {\r\n \t\t\"version\": \"9081df\"\r\n \t},\r\n \t\"urllib3\": {\r\n \t\t\"version\": \"1.22\"\r\n \t},\r\n \t\"using_pyopenssl\": true\r\n }\r\n```\r\n\r\n```\r\n File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py\", line 808, in do_handshake\r\n self._sslobj.do_handshake()\r\nsocket.error: [Errno 54] Connection reset by peer\r\n```",
"@IAmFQQ In *your* case this is probably related to the server you're contacting not supporting an appropriately recent version of TLS. Can you share the hostname of the server you're contacting? If not, try the patch from [here](https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/).",
"@Lukasa Thanks for your support. The hostname is a company internal address that I can't share with you. But I can get response by postman. \r\nThanks Lukasa.\r\n",
"I faced the same error in my mac and I solved it by upgrading requests version from 2.7.0 to 2.18.4",
"I've also encountered the same issue, and the patch is also not working.\r\n\r\nLooking at python -m requests.help I see \"using_pyopenssl\": false. How do I fix this?\r\n\r\n````\r\n$ python -m requests.help\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"2.7.10\"\r\n },\r\n \"platform\": {\r\n \"release\": \"16.7.0\",\r\n \"system\": \"Darwin\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"9081df\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n },\r\n \"using_pyopenssl\": false\r\n}`\r\n```",
"Hi there @nnayar . Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here. Please also do not revive issues that have been closed for a significant period of time.",
"please check the port number that you are using for RPC.\r\nwe have two ports one for block chain and one for RPC\r\nyou can get this RPC port where you started the multichain..\r\nG:\\data64>multichaind chain0 -daemon\r\n\r\nMultiChain 1.0.5 Daemon (latest protocol 10011)\r\n\r\nOther nodes can connect to this node using:\r\nmultichaind [email protected]:2909\r\n\r\nListening for API requests on port **2908** (local only - see rpcallowip setting)\r\n\r\nNode ready.",
"Installed the above mentioned \r\n\r\n`pip install pyopenssl idna`\r\n\r\nAnd still getting \r\n\r\n> ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))\r\n\r\nfor both iPython and my default installed Python 2.7.10\r\n\r\n`$ python -m requests.help`\r\n> {\r\n> \"chardet\": {\r\n> \"version\": \"3.0.4\"\r\n> }, \r\n> \"cryptography\": {\r\n> \"version\": \"\"\r\n> }, \r\n> \"idna\": {\r\n> \"version\": \"2.6\"\r\n> }, \r\n> \"implementation\": {\r\n> \"name\": \"CPython\", \r\n> \"version\": \"2.7.10\"\r\n> }, \r\n> \"platform\": {\r\n> \"release\": \"14.5.0\", \r\n> \"system\": \"Darwin\"\r\n> }, \r\n> \"pyOpenSSL\": {\r\n> \"openssl_version\": \"\", \r\n> \"version\": null\r\n> }, \r\n> \"requests\": {\r\n> \"version\": \"2.18.4\"\r\n> }, \r\n> \"system_ssl\": {\r\n> \"version\": \"9081df\"\r\n> }, \r\n> \"urllib3\": {\r\n> \"version\": \"1.22\"\r\n> }, \r\n> \"using_pyopenssl\": false\r\n> }\r\n\r\n\r\n\r\n\r\nAnd getting this error:\r\n\r\n> ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))\r\n\r\n\r\nI seem to have more recent versions of openSSL installed:\r\n`$ ls /usr/local/Cellar/openssl/1.0.2`\r\n\r\n> 1.0.2d_1/ 1.0.2h_1/ 1.0.2l/ 1.0.2m/ 1.0.2n/ 1.0.2o_1/ 1.0.2p/\r\n\r\n\r\nBut python is still using:\r\n`$ python -c \"import ssl; print ssl.OPENSSL_VERSION\"`\r\n>OpenSSL 0.9.8zg 14 July 2015",
"@carlcrott then this is an issue with how you've installed python and not an issue with requests. For general purpose Q&A please use stackoverflow."
] |
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 bit distracted so my responses will be a bit.. short. :)",
"Thanks for this request!\r\n\r\nSo I agree with @sigmavirus24. While the `response.url` field is a handy convenience, in general we make sure that the request that triggered a given response is always available at `response.request`, and can be introspected. \r\n\r\nIf you didn't find that obvious, I'd be delighted to merge a pull request with clarifying documentation. "
] |
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 tested whether it really is the timeout? Can you, for example, make a sequence of requests without timeouts and then add one at the end with one to see how that goes?",
"Sure. I added a timer to make it clear that it's not timing out (though I suppose printing the exception takes care of that).\r\n\r\n```\r\nD:> cat repro.py\r\nimport datetime\r\nimport requests\r\n\r\nstart = datetime.datetime.now()\r\nurl = \"http://www.cancer.gov/cam\"\r\nfor i in range(10):\r\n print requests.get(url)\r\ntry:\r\n print requests.get(url, timeout=10)\r\nexcept Exception as e:\r\n print e\r\nprint \"elapsed\", datetime.datetime.now() - start\r\n\r\nD:> python repro.py\r\n<Response [404]>\r\n<Response [404]>\r\n<Response [404]>\r\n<Response [404]>\r\n<Response [404]>\r\n<Response [404]>\r\n<Response [404]>\r\n<Response [404]>\r\n<Response [404]>\r\n<Response [404]>\r\n('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))\r\nelapsed 0:00:01.103000\r\n\r\n```",
"Ok, so this is bizarre. Can you get me a packet capture using a tool like Wireshark?",
"Let me see what I can do.",
"Here you go. Let me know if you need anything else.\r\n\r\n[requests-issue-3880-201702180702.zip](https://github.com/kennethreitz/requests/files/785003/requests-issue-3880-201702180702.zip)\r\n",
"And here's the capture for the same request without the timeout parameter (and without the exception):\r\n\r\n[requests-issue-3880-201702180720.zip](https://github.com/kennethreitz/requests/files/785007/requests-issue-3880-201702180720.zip)\r\n\r\nDoesn't look much different, does it?",
"It seems you are using \"ActivePython\" from ActiveState, did you install Requests with `pip` or is that the Requests that comes builtin with your Python distribution ?",
"ActiveState doesn't bundle Requests, so I used pip. I ran `pip install -U requests` before creating the ticket for this issue.",
"@bkline Ok so some thoughts that leap out to me looking at this capture.\r\n\r\nFirstly, the server is responding with `Connection: keep-alive` and then sending a TCP RST immediately after. And I mean *immediately*, it arrives within 1µs of the 301 response. The packet is a RST because it doesn't even wait for the ACK response. That's really not how that's supposed to go: the webserver should really be sending `Connection: close` if it's planning to slam the door in our face like that. But nevermind, that's not where the problem is.\r\n\r\nIt also redirects you to a new host: cam.cancer.gov, on port 443. That is the actual host that is causing you trouble, I suspect, so it'd be helpful to get a capture that includes both so we can see where in the redirect the problem occurs.\r\n\r\nSo the question becomes, what exactly is going on here? My *suspicion* is that there is a problem in the TLS handshake, but without the packet capture it'll be hard to see. Mind giving that a shot?",
"I'm willing to go down any path to track this down, but if I tell you that the exception is thrown even if I set allow_redirects to False, would you still think additional captures will be useful (or even exist)?\r\n\r\nI have started trying to debug on my end, and I have followed the trail into the first call of `self._sock.recv()` in `socket._fileobject.readline()` and that call never returns (that is, the exception is thrown inside the `recv()` function. I'm trying to figure out how to compile my own DLL for the `_socket` module, but I'm pretty sure we're not getting to the redirect, which would mean that cam.cancer.gov:443 wouldn't be part of the story here. What do you think?",
"Oh, well, that's even weirder.\r\n\r\nOk, new theory. I *suspect* that this is actually an artefact of the way Python handles socket timeouts and RST packets. Specifically, I *suspect* (but cannot prove) that the RST packet on non-blocking sockets (which is what a timeout is) causes the recv call to receive an error. Presumably the blocking socket either returns the read data as-is (thereby causing it to raise on the next call to `recv`), or it swallows the error entirely at treats it as a clean EOF (which would be bad).\r\n\r\nInterestingly, this is *also* probably a Windows artefact: I'm on a Mac and haven't been able to reproduce it, probably because of the different way the Mac socket library behaves to the Windows socket library.\r\n\r\nOut of interest, can you see if this reproduces on Python 3?",
"Same failure on Python 3 (btw, with Python 3 ActiveState bundles in Requests, unlike with 2.7):\r\n\r\n```\r\nC:\\tmp>\\python36\\python.exe\r\nActivePython 3.6.0.3600 (ActiveState Software Inc.) based on\r\nPython 3.6.0 (default, Jan 23 2017, 20:01:14) [MSC v.1900 64 bit (AMD64)] on win\r\n32\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> try:\r\n... requests.get(\"http://www.cancer.gov/cam\", timeout=5)\r\n... except Exception as e:\r\n... print(e)\r\n...\r\n('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))\r\n>>>\r\n```",
"As an aside, I had been hoping that upgrading to 2.7.13 (which we haven't been able to do on our servers just yet) might fix the problem. When I saw that it still persists with 3.6, there wasn't much left of those hopes, but I tried anyway. No joy (but I did see that ActiveState includes Requests with 2.7.13).\r\n\r\nIf anyone has any tips on building a custom `_socket.pyd`, please pass them on.",
"I gave up on building a custom _socket.pyd and plugging it into ActiveState's Python. There's probably a way to get it to work, but I couldn't figure it out. As soon as I dropped in my own _socket.pyd my import of the requests module failed, with an error message complaining that there was \"[n]o module named urllib3.\" I assume some sort of manifest is being embedded in the DLL by the compiler, and used by the interpreter to figure out where other modules are.\r\n\r\nSo I've built my own Python interpreter from source code, which should let me insert some trace logging into the _socket module. I can report that the freshly built Python (with Requests added via pip) reproduces the bug.",
"Here's the relevant output from my debugging efforts inside the _socket DLL:\r\n\r\n```\r\nreturn from internal_select_ex() is 0\r\ncalling recv(s->sock_fd=564, len=8192, flags=0)\r\nrecv() returned -1; windows error is 10054\r\n```\r\n\r\n10054 is WSAECONNRESET; Microsoft's documentation for this error says:\r\n\r\n> Connection reset by peer.\r\n> An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.\r\n\r\nBut you knew that. :-)\r\n\r\nSo Python never sees a byte of the 301 response. I'm open to trying anything you have to suggest, but I've sort of wandered out beyond my depth here. :-)",
"I wonder if something happens with the socket when we call `settimeout`. I wonder if this would happen only with a read timeout (for example).",
"`requests.get(\"http://www.cancer.gov/cam\", timeout=(5, None))` successfully retrieves the 404 response.\r\n\r\n`requests.get(\"http://www.cancer.gov/cam\", timeout=(None, 5))` blows up.",
"Yeah, so to be clear, I now believe pretty strongly that this is a Windows-platform-specific problem with the way Python handles ECONNRESET on Windows for non-blocking sockets. This makes it very difficult for us to work around it: that error is almost certainly masking some actual data so we can't find it.\r\n\r\nIt should be possible to reproduce this with socket level code. E.g.:\r\n\r\n```python\r\nimport socket\r\n\r\nrequest = (\r\n 'GET /cam HTTP/1.1\\r\\n'\r\n 'Host: www.cancer.gov\\r\\n'\r\n '\\r\\n'\r\n)\r\n\r\ns = socket.create_connection(('www.cancer.gov', 80))\r\ns.settimeout(5)\r\ns.sendall(request)\r\ndata = ''\r\nwhile not data.endwith(''):\r\n data += s.recv(8192)\r\n```\r\n\r\nDoes that reproduce the error? If not, I have some other suggestions for possible problems at this level.\r\n",
"I assume you meant `data.endswith('')` in the next-to-last line. That's not an idiom I'm familiar with. At least with my copy of Python (2.7.10.12) the loop is never entered. If I eliminate the loop and just call `s.recv(8192)` directly, I get the exception.",
"Sorry, i mean `data.endswith('\\r\\n\\r\\n')`. That's what happens when I reply on an iPad.",
"I'm going to close this ticket, as I agree that the problem is caused in a layer underneath the Requests package, and there's nothing you can do about it. It's clearly a timing issue and (as you pointed out) platform-specific. If the server sends a packet with the 301 redirection response, followed by another packet with the RST bit set (which it's doing in this case, as you can see from the packet capture you asked me to post), the socket library always delivers the 301 response to the requests library's code on Linux or on OS X. On Windows, it delivers the 301 response to the request library's call **_unless the packet with the RST bit has already arrived_**, in which case the exception is raised. The reason the call succeeded without the timeout, but failed with the timeout was that the millisecond or so that it took to apply the timeout to the read provided enough time for the packet with the RST bit set to arrive. I'm going to guess that the reason you couldn't reproduce the problem on Windows was that your machine was faster than the one we are working with. You should be able to see the exception, even without setting a timeout, by running the create_connection(), sendall(), and recv() calls by hand in the interpreter. No matter how fast you type, there will be enough time for the RST packet to get there. But again, it will only fail on Windows. I've filed a report for the socket library with the Python team (https://github.com/python/cpython/issues/73853).",
"Thanks for following up here @bkline! Good luck with the bug report: I hope your problem gets resolved soon! :sparkles:"
] |
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 upgrade to something approaching a recent release before we can help you.",
"@Lukasa what the highest version that python 2.6.6 supports?",
"Requests still supports Python 2.6 in the most recent versions. We have not dropped support for 2.6 yet, though we may do so this year.",
"@Lukasa i have googled a lot for the error: `ConnectionError: [Errno 2] server failed`,but nothing has been found!\r\nDo you have any idea about this strange error?",
"Assuming you're on Linux errno 2 is ENOENT. This suggests you're having problems resolving the domain name, which is reinforced by the second exception. You should look into whether tools like `nslookup` can resolve the name.",
"the second exception:`ConnectionError: [Errno 3] name does not exist` maybe be related to domain name resolving,but the first exception:`ConnectionError: [Errno 2] server failed` is unrelated to the second exception and has nothing to do with domain name resolving.\r\n\r\n@Lukasa do you have any idea about the first exception?",
"What makes you think it has nothing to do with domain name resolving? It overwhelmingly seems most likely that that's what's gone wrong. If you want to confirm you can use `strace` to see which specific syscall is failing with that errno.",
"@Lukasa Why Linux errno 2 `ENOENT` means having problems resolving the domain name,as far as i know,the `ENOENT` means `No such file or directory`.\r\n",
"Errnos can come up at weird times and in weird places. What I'd like to do is *confirm* which syscall is causing it, which you can do by using `strace`.",
"@Lukasa it is a mutil-process server,and the error occurs sometimes,so i am afraid it can't be straced easily!",
"Hrm. Well in that case we've got a problem. ENOENT should not be raised by any of our syscalls, but it is. I assume, based on the fact that you are having other miscellaneous problems with name resolution, that it is *also* related to name resolution.\n\nWithout the ability to provide any kind of data in the opposite direction, I'm afraid that I don't think I can really help you more than that.",
"@Lukasa anyway,thanks for your response!\r\n\r\nstill,actually,there is another error:\r\n12 SSLError: [Errno 185090050] _ssl.c:330: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib:\r\n2017-02-20 10:59:31,890 ERROR: Exception on /v1/images/1b6c5dbe537403c916f6ea668632a05099a09cdde9a668543e4da2eab5a6b179/layer [GET]\r\nTraceback (most recent call last):\r\n File \"/usr/lib/python2.6/site-packages/flask/app.py\", line 1687, in wsgi_app\r\n response = self.full_dispatch_request()\r\n File \"/usr/lib/python2.6/site-packages/flask/app.py\", line 1360, in full_dispatch_request\r\n rv = self.handle_user_exception(e)\r\n File \"/usr/lib/python2.6/site-packages/flask/app.py\", line 1358, in full_dispatch_request\r\n rv = self.dispatch_request()\r\n File \"/usr/lib/python2.6/site-packages/flask/app.py\", line 1344, in dispatch_request\r\n return self.view_functions[rule.endpoint](**req.view_args)\r\n File \"/usr/lib/python2.6/site-packages/docker-registry/docker_registry/toolkit.py\", line 264, in wrapper\r\n return f(*args, **kwargs)\r\n File \"/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py\", line 35, in wrapper\r\n return f(*args, **kwargs)\r\n File \"/usr/lib/python2.6/site-packages/docker-registry/docker_registry/images.py\", line 56, in wrapper\r\n return f(*args, **kwargs)\r\n File \"/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py\", line 140, in wrapper\r\n flask.request.path, stream=stream, source=source\r\n File \"/usr/lib/python2.6/site-packages/docker-registry/docker_registry/lib/mirroring.py\", line 42, in lookup_source\r\n stream=stream\r\n File \"/usr/lib/python2.6/site-packages/requests/api.py\", line 55, in get\r\n return request('get', url, **kwargs)\r\n File \"/usr/lib/python2.6/site-packages/requests/api.py\", line 44, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/usr/lib/python2.6/site-packages/requests/sessions.py\", line 279, in request\r\n resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)\r\n File \"/usr/lib/python2.6/site-packages/requests/sessions.py\", line 374, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/lib/python2.6/site-packages/requests/adapters.py\", line 213, in send\r\n raise SSLError(e)\r\nSSLError: [Errno 185090050] _ssl.c:330: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib\r\n\r\n\r\n",
"Assuming this error is still happening on Requests 1.1, I'm afraid we cannot really dive into that. Historically there has been problems around managing cert bundles: you'd have to upgrade before we can help.",
"ok,i think it has something to do with httplib2.\r\nthe above error appears with httplib2 but disappears with httplib."
] |
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 other docstrings.",
"`__bool__` and `__nonzero__`, immediately above.",
"I'll happily fix those too. In my opinion, misleading docs are worse than no docs. Those methods have been subject to criticism for years at this point and are targetted for correction in 3.0. May as well correct their documentation until 3.0 is out.",
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3877?src=pr&el=h1) Report\n> Merging [#3877](https://codecov.io/gh/kennethreitz/requests/pull/3877?src=pr&el=desc) into [master](https://codecov.io/gh/kennethreitz/requests/commit/e674aa1c8c21f0583f19fea6c78a6ccdc9ba9286?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3877 +/- ##\n=======================================\n Coverage 89.08% 89.08% \n=======================================\n Files 15 15 \n Lines 1896 1896 \n=======================================\n Hits 1689 1689 \n Misses 207 207\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3877?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/compare/e674aa1c8c21f0583f19fea6c78a6ccdc9ba9286...8e049bd9eb49485dc98efd6f14ab7f76c084cf8b?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.42% <ø> (ø)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3877?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3877?src=pr&el=footer). Last update [e674aa1...8e049bd](https://codecov.io/gh/kennethreitz/requests/compare/e674aa1c8c21f0583f19fea6c78a6ccdc9ba9286...8e049bd9eb49485dc98efd6f14ab7f76c084cf8b?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"Updated `__bool__` and `__nonzero__`."
] |
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** coverage.\n> The diff coverage is `n/a`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3876 +/- ##\n=======================================\n Coverage 89.08% 89.08% \n=======================================\n Files 15 15 \n Lines 1896 1896 \n=======================================\n Hits 1689 1689 \n Misses 207 207\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3876?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/compare/655f0edbb43dad16ea5fe6ec0f31fdc1de396610...3664682539fe911a3e19712a0ddec21a515bc16f?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.42% <ø> (ø)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3876?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3876?src=pr&el=footer). Last update [655f0ed...3664682](https://codecov.io/gh/kennethreitz/requests/compare/655f0edbb43dad16ea5fe6ec0f31fdc1de396610...3664682539fe911a3e19712a0ddec21a515bc16f?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"LGTM, thanks! :sparkles: :cake: :sparkles:"
] |
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') as f:\r\n f.write(u'\\u24B6\\u24B7\\u24B8\\u24B9')\r\n```\r\n\r\nAs for why it's failing on the second, that exception is raised when you try to encode the utf-8 encoded string a second time. It looks like AWS4Auth is doing that for you [here](https://github.com/sam-washington/requests-aws4auth/blob/master/requests_aws4auth/aws4auth.py#L494).\r\n\r\nAll of this points to a misuse of unicode in Python 2 and possibly a bug with how AWS4Auth interacts with unicode bodies. I don't believe there's much to be done here in requests.\r\n",
"Thanks, @nateprewitt! Turns out AWS4Auth is adding headers as unicode strings, but Python 2.7 httplib.py or `requests` do not expect that and fail when concatenating the (binary?) body string. There's an easy fix to AWS4Auth for it:\r\nhttps://github.com/sam-washington/requests-aws4auth/issues/29"
] |
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 (`proposed/3.0.0@56dd77f`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## proposed/3.0.0 #3874 +/- ##\n=================================================\n Coverage ? 89.22% \n=================================================\n Files ? 15 \n Lines ? 1931 \n Branches ? 0 \n=================================================\n Hits ? 1723 \n Misses ? 208 \n Partials ? 0\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3874?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/compare/56dd77fc52b853fffa256ea6b370e82dba291df3...b8a87e00d74a6873aa2ba439e2e99298612a4420?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `93.11% <100%> (ø)` | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3874?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3874?src=pr&el=footer). Last update [56dd77f...b8a87e0](https://codecov.io/gh/kennethreitz/requests/compare/56dd77fc52b853fffa256ea6b370e82dba291df3...b8a87e00d74a6873aa2ba439e2e99298612a4420?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"Yep @sigmavirus24, `response` and `history` were added to 3.0.0 in commits by Kenneth.\r\n\r\nEdit: 66eedec to be specific.",
"Is there an ETA of this getting merged in? I'd like to refile #3871 against the 3.0 branch, but will need to schedule the time to do that after this is merged.",
"I think it's good to go @jvanasco, we were just waiting for confirmation from @kennethreitz. @Lukasa we can probably just merge though since this isn't actually a change, yeah?",
"+1"
] |
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** coverage by `-0.09%`.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3873 +/- ##\n==========================================\n- Coverage 89.17% 89.08% -0.09% \n==========================================\n Files 15 15 \n Lines 1893 1896 +3 \n==========================================\n+ Hits 1688 1689 +1 \n- Misses 205 207 +2\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3873?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/kennethreitz/requests/compare/90f3842ed60f91ff101189f792ce21f7c762b1a0...f47aff68f1352c3a5030fe70bbdf7c00171e207b?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `84.94% <100%> (+0.12%)` | :white_check_mark: |\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/compare/90f3842ed60f91ff101189f792ce21f7c762b1a0...f47aff68f1352c3a5030fe70bbdf7c00171e207b?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.42% <ø> (-0.46%)` | :x: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3873?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3873?src=pr&el=footer). Last update [90f3842...f47aff6](https://codecov.io/gh/kennethreitz/requests/compare/90f3842ed60f91ff101189f792ce21f7c762b1a0...f47aff68f1352c3a5030fe70bbdf7c00171e207b?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"So, this patch demonstrates the possible advantages of removing the overbroad exception block because this patch actually manages to *regress* coverage despite being completely covered. I still think we should merge it. =)",
"Great! @Lukasa, when you have a free moment, would you mind merging master in proposed/3.0.0 so I can rebase my changes for #3338 onto this?",
"I've done so, but we should see if the builds run because the merge was pretty gnarly.",
"😬 yep, looking a little rough. I can tidy things up if you don't want to deal with it.",
"heh, I'd definitely accept a PR if you're feeling in the mood. Otherwise I'll tackle it after this meeting."
] |
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 of these things have got real challenges. For the HSTS preload list, there are two issues. First, the preload list is a nearly 2-megabyte JSON text file that needs to be deserialized. We could attempt to process that, but it's not going to be the fastest thing to do and it'll expand to many more megabytes of memory. This is all stuff I'd not want to ship in Requests by default. Second, the preload list is regularly updated, but Requests often isn't. That means we'd have to take an approach like certifi, which is not the end of the world, but definitely troublesome.\r\n\r\nAnyway, all of this is to say: yeah, we can do this. But it isn't a high priority right now. Anyone who wants to work on it should feel free to pick up and run with the urllib3 work, but we have other priorities that we'd like to address before this.\r\n\r\nThanks for the suggestion though!",
"@Lukasa thanks for the feedback!\r\n\r\nI understand the concerns for performance (I care more about being able to do one less request than the security aspects to be frank). I think we could use a disk-based format that makes the lookups fast and memory-efficient?",
"@sylvinus So, the most appropriate way to do it would be to use a sqlite DB, but ultimately that's putting the cart before the horse. If we can get support for HSTS *without* preload that persists to disk, then essentially the preload list becomes nothing more than a priming of the HSTS DB.\n\nAgain, I recommend you look at the direction that was taken in shazow/urllib3#608 to get an idea of what we were looking at. If you're interested, I'm sure you can pick the code up and try to bring it back up to date.",
"Okay, thanks! I'll have a look.",
"Hi, I'd say HSTS primarily concerns returning to website using HTTPS. I think that could easily be implemented in requests, just as a cache of websites that have redirected to HTTPS and set Strict-Transport-Security header. HSTS preload is completely different story. Right now I'd have to resort to manually flagging a domain name in my application so subsequent requests would use HTTPS by default.",
"@laurivosandi Maybe I'm not understanding you, but I don't think any of what I said above is materially different to what you're saying here. I said above that HSTS preload is a complex problem but that HSTS without preload could be done, but it is not currently a high priority for any of the maintainers. As always, I've linked to the initial prototyping work in urllib3: if you want to resurrect that work, you're more than welcome."
] |
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** coverage by `-0.1%`.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3871 +/- ##\n=========================================\n- Coverage 89.17% 89.07% -0.1% \n=========================================\n Files 15 15 \n Lines 1893 1894 +1 \n=========================================\n- Hits 1688 1687 -1 \n- Misses 205 207 +2\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3871?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/compare/90f3842ed60f91ff101189f792ce21f7c762b1a0...d49e839c000789feac6b8b9df7e00b7aaccecaff?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `92.88% <100%> (-0.06%)` | :x: |\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/compare/90f3842ed60f91ff101189f792ce21f7c762b1a0...d49e839c000789feac6b8b9df7e00b7aaccecaff?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.42% <ø> (-0.46%)` | :x: |\n| [requests/utils.py](https://codecov.io/gh/kennethreitz/requests/compare/90f3842ed60f91ff101189f792ce21f7c762b1a0...d49e839c000789feac6b8b9df7e00b7aaccecaff?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `84.94% <ø> (+0.12%)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3871?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3871?src=pr&el=footer). Last update [90f3842...d49e839](https://codecov.io/gh/kennethreitz/requests/compare/90f3842ed60f91ff101189f792ce21f7c762b1a0...d49e839c000789feac6b8b9df7e00b7aaccecaff?src=pr&el=footer&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"3.0 sounds good to me. I can remove the trailing comma. flake8 yells at me when i leave it out ;)",
"> flake8 yells at me when i leave it out ;)\r\n\r\nWhat flake8 plugins are you using? That is *not* default behaviour. (Also, side note, Kenneth hates Flake8 with a passion ;))",
"updated, however I should probably do a different pr against the 3.0 branch instead -- right?\r\n\r\n> What flake8 plugins are you using? That is not default behaviour.\r\n\r\n`flake8-commas`, but installed after years of enforcing it as a style guide, after years of having it enforced on me as a style guide. I have a love-hate relationship with flake8, my exceptions list is long, and there are a lot of situations that pyflakes doesn't cover... but it's become really useful as a sanity-check before running unit tests. ",
"Yeah, you'd have to do a different PR against the 3.0 branch.",
"closed in favor of #3886 for the 3.0 branch"
] |
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 `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## proposed/3.0.0 #3869 +/- ##\n=================================================\n Coverage ? 89.18% \n=================================================\n Files ? 15 \n Lines ? 1904 \n Branches ? 0 \n=================================================\n Hits ? 1698 \n Misses ? 206 \n Partials ? 0\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3869?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/compare/85a29f1da0d0ccd79e865a7172ea39a2a7667312...16bbc7478fb9115ed6f52cf5832fd191f13addef?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `92.91% <100%> (ø)` | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3869?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3869?src=pr&el=footer). Last update [85a29f1...16bbc74](https://codecov.io/gh/kennethreitz/requests/compare/85a29f1da0d0ccd79e865a7172ea39a2a7667312...16bbc7478fb9115ed6f52cf5832fd191f13addef?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"This is an annoyance, but looks right. Thanks @nateprewitt!"
] |
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 meantime we'll let this sit, if that's ok?",
"@Lukasa of course. No rush. Thanks a lot!",
"Ok, this branch should be fixed. ",
"@Lukasa will rebase and push again.",
"# [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3868?src=pr&el=h1) Report\n> Merging [#3868](https://codecov.io/gh/kennethreitz/requests/pull/3868?src=pr&el=desc) into [proposed/3.0.0](https://codecov.io/gh/kennethreitz/requests/commit/b26f4c7f58180ee2d7c52687a9caafc7cc626418?src=pr&el=desc) will **increase** coverage by `<.01%`.\n> The diff coverage is `100%`.\n\n\n```diff\n@@ Coverage Diff @@\n## proposed/3.0.0 #3868 +/- ##\n==================================================\n+ Coverage 89.18% 89.18% +<.01% \n==================================================\n Files 15 15 \n Lines 1904 1905 +1 \n==================================================\n+ Hits 1698 1699 +1 \n Misses 206 206\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3868?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/kennethreitz/requests/compare/b26f4c7f58180ee2d7c52687a9caafc7cc626418...efcbe93075c8674657e45005c5d59af1d94fc600?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.77% <100%> (+0.01%)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3868?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3868?src=pr&el=footer). Last update [b26f4c7...efcbe93](https://codecov.io/gh/kennethreitz/requests/compare/b26f4c7f58180ee2d7c52687a9caafc7cc626418...efcbe93075c8674657e45005c5d59af1d94fc600?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments)."
] |
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": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
] | null | 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** coverage by `-0.01%`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3866 +/- ##\n==========================================\n- Coverage 89.05% 89.04% -0.01% \n==========================================\n Files 15 15 \n Lines 1873 1872 -1 \n==========================================\n- Hits 1668 1667 -1 \n Misses 205 205\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3866?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/compare/ad65b0cb19124b5ae4dd01bf19d82c16ffb2485d...5e9371854176164db9ce5fee5ceb39b58f4035b2?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `92.77% <100%> (-0.03%)` | :x: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3866?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3866?src=pr&el=footer). Last update [ad65b0c...5e93718](https://codecov.io/gh/kennethreitz/requests/compare/ad65b0cb19124b5ae4dd01bf19d82c16ffb2485d...5e9371854176164db9ce5fee5ceb39b58f4035b2?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"closing in favor of other PR #3846 ",
"Thanks!\r\n\r\nIt is worth resubmitting the clarified loop as a new PR for discussion? \r\n\r\nRebased against the current master, it looks like this: https://github.com/jvanasco/requests/commit/f1cbdfbc7a18e1ac41f8cdcec107a634674ae5ae\r\n\r\nand gets rid of some of the janky looping code.",
"Certainly I'd be happy to see it. =) Can't speak for Kenneth, of course.",
"@jvanasco yes but please make that commit message easier on the eyes :)"
] |
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/requests/commit/ad65b0cb19124b5ae4dd01bf19d82c16ffb2485d?src=pr&el=desc) will **increase** coverage by `0.1%`.\n\n\n```diff\n@@ Coverage Diff @@\n## master #3865 +/- ##\n=========================================\n+ Coverage 89.05% 89.16% +0.1% \n=========================================\n Files 15 15 \n Lines 1873 1892 +19 \n=========================================\n+ Hits 1668 1687 +19 \n Misses 205 205\n```\n\n\n| [Impacted Files](https://codecov.io/gh/kennethreitz/requests/pull/3865?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/kennethreitz/requests/compare/ad65b0cb19124b5ae4dd01bf19d82c16ffb2485d...85400d8d6751071ef78f042d1efa72bdcf76cc0e?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `92.91% <100%> (+0.1%)` | :white_check_mark: |\n| [requests/utils.py](https://codecov.io/gh/kennethreitz/requests/compare/ad65b0cb19124b5ae4dd01bf19d82c16ffb2485d...85400d8d6751071ef78f042d1efa72bdcf76cc0e?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `84.82% <91.3%> (+0.64%)` | :white_check_mark: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3865?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/kennethreitz/requests/pull/3865?src=pr&el=footer). Last update [ad65b0c...85400d8](https://codecov.io/gh/kennethreitz/requests/compare/ad65b0cb19124b5ae4dd01bf19d82c16ffb2485d...85400d8d6751071ef78f042d1efa72bdcf76cc0e?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).",
"✨🍰✨"
] |
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": 44501256,
"name": "Breaking API Change",
"node_id": "MDU6TGFiZWw0NDUwMTI1Ng==",
"url": "https://api.github.com/repos/psf/requests/labels/Breaking%20API%20Change"
},
{
"color": "e11d21",
"default": false,
"description": null,
"id": 44501305,
"name": "Not Ready To Merge",
"node_id": "MDU6TGFiZWw0NDUwMTMwNQ==",
"url": "https://api.github.com/repos/psf/requests/labels/Not%20Ready%20To%20Merge"
},
{
"color": "d4c5f9",
"default": false,
"description": null,
"id": 536793543,
"name": "needs rebase",
"node_id": "MDU6TGFiZWw1MzY3OTM1NDM=",
"url": "https://api.github.com/repos/psf/requests/labels/needs%20rebase"
}
] |
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).\n> The diff coverage is `90.17%`.\n\n[](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #3864 +/- ##\n=========================================\n Coverage ? 88.32% \n=========================================\n Files ? 15 \n Lines ? 1987 \n Branches ? 0 \n=========================================\n Hits ? 1755 \n Misses ? 232 \n Partials ? 0\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/cookies.py](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=tree#diff-cmVxdWVzdHMvY29va2llcy5weQ==) | `77.11% <100%> (ø)` | |\n| [requests/auth.py](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=tree#diff-cmVxdWVzdHMvYXV0aC5weQ==) | `87.09% <100%> (ø)` | |\n| [requests/api.py](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=tree#diff-cmVxdWVzdHMvYXBpLnB5) | `82.6% <100%> (ø)` | |\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `93.3% <100%> (ø)` | |\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `90.3% <78.57%> (ø)` | |\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `86.39% <85.71%> (ø)` | |\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `92.15% <90.47%> (ø)` | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=footer). Last update [5697148...f3cdbcb](https://codecov.io/gh/requests/requests/pull/3864?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"ok, so can someone help me with solving an issue with aiohttp that requests.post can work with so that way I can close the issue with my PR for it? The issue is with the files param and well my PR semi adds it in however I am confused on the implementation for it into aiohttp. So, can someone here help me with that PR?\r\n\r\nIssue: https://github.com/KeepSafe/aiohttp/issues/1651\r\nPR: https://github.com/KeepSafe/aiohttp/pull/1653\r\nthanks in advance.",
"@AraHaan The relevant code is [here](https://github.com/kennethreitz/requests/blob/master/requests/models.py#L109): this is the code path that Requests uses if `files` has been provided. You'll find it's not remarkably helpful to you because it uses a lot of custom code in both Requests and urllib3, but essentially it encodes both the `files` and `data` arguments as multipart form data.\r\n",
">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.\r\n\r\nWhat's the use case for this? Is there a scenario where passing a session as an argument is comfortable, but calling a method on the session isn't? Is it perhaps to alleviate boilerplate for user-defined functions that take an optional session argument (e.g. `def cool_function(thing, another_thing, session=None):`)?\r\n\r\n>URLs are now automatically stripped of leading/trailing whitespace.\r\n\r\nI'm also wondering about this one... Is this really desirable? I suppose I can't really come up with a case where you'd want to turn away URLs with leading/trailing whitespace, hahah, but still wondering about the real rationale behind it.",
"> What's the use case for this?\r\n\r\nIt's quite common to have APIs that wrap Requests that pass `**kwargs` to the library. This allows the use of a custom `Session` transparently by those APIs.",
"Additionally to providing a session parameter (or maybe instead of it), wouldn't it make sense, to create a default session in the `api` module, and keep using this session throughout all porcelain functions? Right now a session gets created on the fly for every request, also throwing away stored cookies etc. This might be quite unintuitive when doing requests consequently in a browser-like fashion in simple scripts.",
"@ml31415 I don't think that's reasonable. If you want to save state, you should explicitly use a session. Making the top-level functions share a session would make \"stateless\" requests really cumbersome - you'd have to manually create a new session between each request.",
"@ml31415 \r\n\r\n> Right now a session gets created on the fly for every request, also throwing away stored cookies etc. \r\n\r\nWe found that there was actually significantly more confusion about why cookies were saved across porcelain request calls. @obskyr is exactly correct.",
"Agreed. Though, this stateful behavior might be more what someone expects, when he's looking for a simple library, automating what he's used from using his browser every day. Another option would be to simply initialize a default session, so that the stateful behavior would be more readily accessible:\r\n```\r\n# without state\r\nimport requests\r\nrequests.get()\r\n# vs with state\r\nfrom requests import session\r\nsession.get()\r\n```\r\nWould save a `session = Session()` line for each simple script out there in system administration and so on. This might be more helpful than having `session()` defined in `sessions` as a kind of synonym for `Session()`, except ignoring all the arguments. The gain in convenience is of course not huge, just saving this one line, but then again, this is what gets discussed in terms of usability e.g. here: https://gist.github.com/kennethreitz/973705\r\n\r\nOr if this API change might be too intrusive, how about this instead:\r\n\r\n```\r\nfrom requests import stateful\r\nstateful.get()\r\n```\r\n",
"@ml31415 Please don't try to conflate not having to copy and paste around several lines to get a minimum viable HTTP request to having to include 1 line to have consistent state. Besides the fact that having a module with a global session that can keep state and cause confusion. There's also the problem where having that Session has caused memory leaks in the past. So we're just not going to do it."
] |
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,
"description": null,
"id": 136616769,
"name": "Documentation",
"node_id": "MDU6TGFiZWwxMzY2MTY3Njk=",
"url": "https://api.github.com/repos/psf/requests/labels/Documentation"
}
] |
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 especially dangerous for people relying on SOCKS for anonymity - by implementing it you potentially put those people at risk as any Requests-based tool would now silently leak DNS requests.\r\n\r\nI'd recommend reverting to the previous behaviour and creating a different proxy scheme for the new behaviour - `socks5nodns`?",
"@Rjevski we follow standards, we don't make things up. cURL established the standard and we're following it.",
"@Lukasa Hi, is there a reason this issue is still open when the PR #4229 was merged?",
"Nope, looks like the documentation concerns have been addressed. Thanks for checking in @e-beach!",
"So I understand that this applies for Socks5 protocol. But what if you use an HTTP/HTTPS proxy. Is the DNS resolved in the proxy side or client side? Thanks."
] |
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 very top of your file before doing anything else?",
"Yeah, ' moving your import and monkeypatch to the very top of your file ' solved my problem! Thank you very much!\r\n\r\nThis suggestion also solves my project's problem.\r\n I hava 3 files called A,B,C, and run sequence is A->B->C. I use gevent in B, so I add monkeypatch in B, but i blocks with requests+socks. Now I add monkeypatch at the very top of A, it works great now! Hope this will help others!\r\n\r\nThank you again!",
"Happy to help!"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.