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/5083
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5083/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5083/comments
|
https://api.github.com/repos/psf/requests/issues/5083/events
|
https://github.com/psf/requests/issues/5083
| 442,545,949 |
MDU6SXNzdWU0NDI1NDU5NDk=
| 5,083 |
请求起点中文网获取的书籍信息不全
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/30544914?v=4",
"events_url": "https://api.github.com/users/xcjson/events{/privacy}",
"followers_url": "https://api.github.com/users/xcjson/followers",
"following_url": "https://api.github.com/users/xcjson/following{/other_user}",
"gists_url": "https://api.github.com/users/xcjson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/xcjson",
"id": 30544914,
"login": "xcjson",
"node_id": "MDQ6VXNlcjMwNTQ0OTE0",
"organizations_url": "https://api.github.com/users/xcjson/orgs",
"received_events_url": "https://api.github.com/users/xcjson/received_events",
"repos_url": "https://api.github.com/users/xcjson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/xcjson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/xcjson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/xcjson",
"user_view_type": "public"
}
|
[
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
}
] |
closed
| true | null |
[] | null | 7 |
2019-05-10T05:36:48Z
|
2021-09-05T00:06:52Z
|
2019-05-10T12:45:08Z
|
NONE
|
resolved
|
例如https://book.qidian.com/info/1115277
直接浏览器Ctrl+U查看源码内容是 </div>
</div>
</div>
<div class="book-content-wrap cf">
<div class="left-wrap fl">
<div class="book-info-detail">
<cite class="icon-pin"></cite>
<div class="book-intro">
<p>
唐门外门弟子唐三,因偷学内门绝学为唐门所不容,跳崖明志时却发现没有死,反而以另外一个身份来到了另一个世界,一个属于武魂的世界,名叫斗罗大陆。这里没有魔法,没有斗气,没有武术,却有神奇的武魂。这里的每个人,在自己六岁的时候,都会在武魂殿中令武魂觉醒。武魂有动物,有植物,有器物,武魂可以辅助人们的日常生活。而其中一些特别出色的武魂却可以用来修炼并进行战斗,这个职业,是斗罗大陆上最为强大也是最荣耀的职业——魂师!<br> 当唐门暗器来到斗罗大陆,当唐三武魂觉醒,他能否在这片武魂的世界再铸唐门的辉煌?他能否成为这个世界的主宰:神?
</p>
</div>
<div class="book-state" data-l1="4">
<ul>
<li>
<b>作者自定义标签</b>
<div class="detail">
<p class="tag-wrap" data-l1="4">
<a class="tags" href="//www.qidian.com/all?tag=热血" target="_blank" data-eid="qd_G70">热血</a>
</p>
</div>
</li>
<li class="honor" id="honor">
<b>荣誉动态</b>
<div class="detail">
<strong>2014-09-19 累积获得五十万个收藏<em class="iconfont"></em></strong>
但是requests的请求返回数据是首发时间:2009-12-12 07:00:00 章节字数 <li data-rid="596"><a href="//vipreader.qidian.com/chapter/1115277/26041662" target="_blank" data-eid="qd_G55" data-cid="//vipreader.qidian.com/chapter/1115277/26041662" title="首发时间:2009-12-13 07:42:37 章节字数 唐门外门弟子唐三,因偷学内门绝学为唐门所不容,跳崖明志时却发现没有死,反而以另外一个身份来到了另一个世界,一个属于武魂的世界,名叫斗罗大陆。这里没有魔法,没有斗气,没有武 术,却有神奇的武魂。这里的每个人,在自己六岁的时候,都会在武魂殿中令武魂觉醒。武魂有动物,有植物,有器物,武魂可以辅助人们的日常生活。而其中一些特别出色的武魂却可以用来修炼并进行战斗,这个 职业,是斗罗大陆上最为强大也是最荣耀的职业——魂师!<br> 当唐门暗器来到斗罗大陆,当 <a class="tags" href="//www.qidian.com/all?tag=热血" target="_blank" data-eid="q <a class="blue collect" href="//book.qidian.com/honor/1115277" target="_blank" d <a class="blue" href="//vipreader.qidian.com/chapter/1115277/26041662" data-eid="qd_G19" data-cid="//vipreader.qidian.com/chapter/1115277/2604
获取的信息是不完全的
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1008252?v=4",
"events_url": "https://api.github.com/users/timofurrer/events{/privacy}",
"followers_url": "https://api.github.com/users/timofurrer/followers",
"following_url": "https://api.github.com/users/timofurrer/following{/other_user}",
"gists_url": "https://api.github.com/users/timofurrer/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/timofurrer",
"id": 1008252,
"login": "timofurrer",
"node_id": "MDQ6VXNlcjEwMDgyNTI=",
"organizations_url": "https://api.github.com/users/timofurrer/orgs",
"received_events_url": "https://api.github.com/users/timofurrer/received_events",
"repos_url": "https://api.github.com/users/timofurrer/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/timofurrer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/timofurrer/subscriptions",
"type": "User",
"url": "https://api.github.com/users/timofurrer",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5083/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5083/timeline
| null |
completed
| null | null | false |
[
"requests cannot perform followed ajax requests for you.\r\nPlease confirm the website you are requesting's loading method.\r\n\r\nfor example\r\n```bash\r\ncurl https://book.qidian.com/info/1115277\r\n\r\n# python repl\r\n>>> import requests\r\n>>> print(requests.get('https://book.qidian.com/info/1115277').text)\r\n```\r\nif these two responses are different, then it might be some issue about requests itself.",
"我试了curl https://book.qidian.com/info/1115277\r\n获取到的也不全,但是view-source:https://book.qidian.com/info/1115277看到的源代码是完整的\r\n这里不支持ajax异步请求啊",
"使用BeautifulSoup获取这个区块的数据\r\nsoup = BeautifulSoup(r.text, \"lxml\")\r\nsoup.find(\"div\",class_=\"book-intro\").p\r\n获取的值是 唐门外门弟子唐三,因偷学内门绝学为唐门所不容,跳崖明志时却发现没有死,反而以另外一个身份来到了另一个世界,一个属于武魂的世界,名叫斗罗大陆。这里没有魔法 ,没有斗气,没有武术,却有神奇的武魂。这里的每个人,在自己六岁的时候,都会在武魂殿中令武魂觉醒。武魂有动物,有植物,有器物,武魂可以辅助人们的日常生活。而其中一些特别出色的武魂却可以用来修 炼并进行战斗,这个职业,是斗罗大陆上最为强大也是最荣耀的职业——魂师!<br/> 当唐门暗器来到斗罗大陆,当 </p>魂的世界再铸唐门的辉煌?他能否成为这个世界的主宰:神?\r\n虽然相比原文\r\n唐门外门弟子唐三,因偷学内门绝学为唐门所不容,跳崖明志时却发现没有死,反而以另外一个身份来到了另一个世界,一个属于武魂的世界,名叫斗罗大陆。这里没有魔法,没有斗气,没有武术,却有神奇的武魂。这里的每个人,在自己六岁的时候,都会在武魂殿中令武魂觉醒。武魂有动物,有植物,有器物,武魂可以辅助人们的日常生活。而其中一些特别出色的武魂却可以用来修炼并进行战斗,这个职业,是斗罗大陆上最为强大也是最荣耀的职业——魂师!<br> 当唐门暗器来到斗罗大陆,当唐三武魂觉醒,他能否在这片武魂的世界再铸唐门的辉煌?他能否成为这个世界的主宰:神?\r\n也缺少了一点但是比requests请求的反而全一些\r\n <li data-rid=\"595\"><a href=\"//vipreader.qidian.com/chapter/1115277/26030979\" target=\"_blank\" data-eid=\"qd_G55\" data-cid=\"//vipreader.qidian.com/chapter/1115277/26030979\" title=\"首发时间:2009-12-12 07:00:00 章节字数 <li data-rid=\"596\"><a href=\"//vipreader.qidian.com/chapter/1115277/26041662\" target=\"_blank\" data-eid=\"qd_G55\" data-cid=\"//vipreader.qidian.com/chapter/1115277/26041662\" title=\"首发时间:2009-12-13 07:42:37 章节字数 唐门外门弟子唐三,因偷学内门绝学为唐门所不容,跳崖明志时却发现没有死,反而以另外一个身份来到了另一个世界,一个属于武魂的世界,名叫斗罗大陆。这里没有魔法,没有斗气,没有武 术,却有神奇的武魂。这里的每个人,在自己六岁的时候,都会在武魂殿中令武魂觉醒。武魂有动物,有植物,有器物,武魂可以辅助人们的日常生活。而其中一些特别出色的武魂却可以用来修炼并进行战斗,这个 职业,是斗罗大陆上最为强大也是最荣耀的职业——魂师!<br> 当唐门暗器来到斗罗大陆,当 <a class=\"tags\" href=\"//www.qidian.com/all?tag=热血\" target=\"_blank\" data-eid=\"q <a class=\"blue collect\" href=\"//book.qidian.com/honor/1115277\" target=\"_blank\" d <a class=\"blue\" href=\"//vipreader.qidian.com/chapter/1115277/260416",
" 直接输出很多标签都没有闭合,就算是异步加载,起点也不至于这样把\r\n<em class=\"rec\"></em><a href=\"//me.qidian.com/friendIndex.aspx?id=216765 \r\n\r\n ",
"This should because there are `\\r` in content, and then you use `print` to try to see the content. So it's not a bug in requests. <https://blog.csdn.net/lishenluo/article/details/52642997>\r\nexample:\r\n```python\r\nprint('ppppp\\rooo\\r') # In PyCharm, I got \"ooo\" as result.\r\n```\r\n",
"。。。感谢大佬解答\r\n同样的代码在python自带的IDLE的都正常∑(O_O;)\r\n这是要我以后都用IDLE的节奏啊",
"> 。。。感谢大佬解答\r\n> 同样的代码在python自带的IDLE的都正常∑(O_O;)\r\n> 这是要我以后都用IDLE的节奏啊\r\n\r\n找到问题点就close这个issue吧。\r\nAccording to the reply of @2293310198 , he confirmed that it is not a bug in `requests`. And the reason is https://github.com/kennethreitz/requests/issues/5083#issuecomment-491253735 ."
] |
https://api.github.com/repos/psf/requests/issues/5082
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5082/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5082/comments
|
https://api.github.com/repos/psf/requests/issues/5082/events
|
https://github.com/psf/requests/pull/5082
| 442,376,640 |
MDExOlB1bGxSZXF1ZXN0Mjc3NTAzMTkx
| 5,082 |
Linked contribution information in README
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40577023?v=4",
"events_url": "https://api.github.com/users/zurbrugc/events{/privacy}",
"followers_url": "https://api.github.com/users/zurbrugc/followers",
"following_url": "https://api.github.com/users/zurbrugc/following{/other_user}",
"gists_url": "https://api.github.com/users/zurbrugc/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/zurbrugc",
"id": 40577023,
"login": "zurbrugc",
"node_id": "MDQ6VXNlcjQwNTc3MDIz",
"organizations_url": "https://api.github.com/users/zurbrugc/orgs",
"received_events_url": "https://api.github.com/users/zurbrugc/received_events",
"repos_url": "https://api.github.com/users/zurbrugc/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/zurbrugc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zurbrugc/subscriptions",
"type": "User",
"url": "https://api.github.com/users/zurbrugc",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-05-09T18:40:04Z
|
2021-08-31T00:07:15Z
|
2019-05-09T21:37:33Z
|
CONTRIBUTOR
|
resolved
|
For potential contributors who are new to GitHub and prefer to learn via structured processes, linking the Contributor's Guide and development philosophy documents in the README will make it easier for them to find this information. This will increase the quality of their contributions and make them more comfortable contributing to the project.
|
{
"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/5082/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5082/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5082.diff",
"html_url": "https://github.com/psf/requests/pull/5082",
"merged_at": "2019-05-09T21:37:33Z",
"patch_url": "https://github.com/psf/requests/pull/5082.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5082"
}
| true |
[
":sparkles: :cake: :sparkles:"
] |
https://api.github.com/repos/psf/requests/issues/5081
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5081/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5081/comments
|
https://api.github.com/repos/psf/requests/issues/5081/events
|
https://github.com/psf/requests/issues/5081
| 441,486,130 |
MDU6SXNzdWU0NDE0ODYxMzA=
| 5,081 |
"default_hook" should also have an entry for 'request' (to deal with allow_redirect=True)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/49322122?v=4",
"events_url": "https://api.github.com/users/MarcClown/events{/privacy}",
"followers_url": "https://api.github.com/users/MarcClown/followers",
"following_url": "https://api.github.com/users/MarcClown/following{/other_user}",
"gists_url": "https://api.github.com/users/MarcClown/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MarcClown",
"id": 49322122,
"login": "MarcClown",
"node_id": "MDQ6VXNlcjQ5MzIyMTIy",
"organizations_url": "https://api.github.com/users/MarcClown/orgs",
"received_events_url": "https://api.github.com/users/MarcClown/received_events",
"repos_url": "https://api.github.com/users/MarcClown/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MarcClown/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MarcClown/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MarcClown",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-05-07T23:24:29Z
|
2021-11-26T04:00:31Z
|
2021-08-28T03:49:56Z
|
NONE
|
resolved
|
When using allow_redirect=True, user can set a callback on each 'response' (via the hook parameter) but not on 'request'.
This is a problem when using the redirect capability because user loose the ability to interact with the request before it is being sent.
This would allow a user to do things such as: Log all incoming requests (and all redirect) in real time / modify the header between redirected calls / modify argument or payload between calls / or change http method between redirects / ...
Locally I can fix this by changing:
* hook.py:
- Adding a 'request' to the HOOK list at line 14:
HOOKS = ['response', 'request'])
* Session.py
- move line 637 to 633:
hook = request.hooks
- add a callback line 634:
dispatch_hook('request', hooks, request, **kwargs)
But I don't want to have a frankenversion of "requests.py" on my system. And I'm not familiar enough to have a good "proposed change" from GitHub (without potentially causing unintended side effects).
## Expected Result
The 'response' hook should be triggered just before making the adapter.send (initially and more importantly for all subsequent redirects).
The default_hook (hook.py) should have an entry for 'request' along with 'response'
## Actual Result
When redirect happen, mulitple 'response' callback are triggered but no 'request' callback.
What happened instead.
## Reproduction Steps
```python
import requests
LOG = logging.getLogger(__name__)
# ( in real scenario, there would be something more interesting than logging here - but good enough for repro steps).
def _log_request(self, prepared_request):
LOG.info("HTTP Request")
LOG.info("-> %s %s" % (prepared_request.method.upper(), prepared_request.url))
if prepared_request.body:
LOG.info("-> (Payload) %s" % prepared_request.body)
for key,value in prepared_request.headers.items():
LOG.info("-> %s: %s" % (key,value))
def _log_response(self, resp):
LOG.info("HTTP Response for '%s'" % resp.url)
LOG.info("<- Status Code = %s" % resp.status_code)
for (key,value) in resp.headers.items():
LOG.info("<- %s: %s" % (key,value) )
session = requests.Session()
session.get(url, headers=_headers, hooks={"response":_log_response, "request":_log_request}, allow_redirects=True)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.5"
},
"platform": {
"release": "17.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.19.1"
},
"system_ssl": {
"version": "100020ef"
},
"urllib3": {
"version": "1.23"
},
"using_pyopenssl": false
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"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": 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/5081/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5081/timeline
| null |
completed
| null | null | false |
[
"Resolving this as a duplicate of #5037."
] |
https://api.github.com/repos/psf/requests/issues/5080
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5080/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5080/comments
|
https://api.github.com/repos/psf/requests/issues/5080/events
|
https://github.com/psf/requests/issues/5080
| 440,028,648 |
MDU6SXNzdWU0NDAwMjg2NDg=
| 5,080 |
Importing requests very slow (4 seconds) on Raspberry Pi
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/388198?v=4",
"events_url": "https://api.github.com/users/dagwieers/events{/privacy}",
"followers_url": "https://api.github.com/users/dagwieers/followers",
"following_url": "https://api.github.com/users/dagwieers/following{/other_user}",
"gists_url": "https://api.github.com/users/dagwieers/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dagwieers",
"id": 388198,
"login": "dagwieers",
"node_id": "MDQ6VXNlcjM4ODE5OA==",
"organizations_url": "https://api.github.com/users/dagwieers/orgs",
"received_events_url": "https://api.github.com/users/dagwieers/received_events",
"repos_url": "https://api.github.com/users/dagwieers/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dagwieers/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dagwieers/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dagwieers",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-05-03T12:43:25Z
|
2021-11-05T03:00:31Z
|
2021-08-07T02:13:00Z
|
NONE
|
resolved
|
We found that importing **requests** on Raspberry Pi is very slow.
It takes 4 seconds.
Given that Kodi calls python addons for every menu change, navigating within addons is dreadfully slow (at least 4 seconds in between clicks).
Profiling and system call tracing output at: https://github.com/Freso/script.module.requests/issues/25
Looking for a way to disable specific packages and keep requests more simple in nature.
## Expected Result
Sub-second behaviour as on Windows and Android.
## Actual Result
It appears that compiling the **rfc3986** regular expressions is taking up most of the meat here.
## Reproduction Steps
```python
#!/usr/bin/python
import sys
sys.path.append('/storage/.kodi/addons/script.module.chardet/lib')
sys.path.append('/storage/.kodi/addons/script.module.urllib3/lib')
sys.path.append('/storage/.kodi/addons/script.module.certifi/lib')
sys.path.append('/storage/.kodi/addons/script.module.idna/lib')
sys.path.append('/storage/.kodi/addons/script.module.requests/lib')
import cProfile
pr = cProfile.Profile()
pr.enable()
import requests
requests.get('https://vrtnu-api.vrt.be/suggest?facets[transcodingStatus]=AVAILABLE').json()
pr.disable()
pr.dump_stats('/tmp/profiling_stats')
```
## System Information
$ python -m requests.help
*This also takes 5 seconds ;-)*
```
kodi03:~ # python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "2.7.15"
},
"platform": {
"release": "4.19.23",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1000211f"
},
"urllib3": {
"version": "1.25.2"
},
"using_pyopenssl": false
}
```
|
{
"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/5080/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5080/timeline
| null |
completed
| null | null | false |
[
"As I said in https://github.com/Freso/script.module.requests/issues/25#issuecomment-489087339, this is almost certainly directly due to https://github.com/urllib3/urllib3/issues/1590 (@dagwieers even mentions `rfc3986` compiling regexes himself as well) and may thus not really be a `requests` issue, though there might be something requests could maybe do to mitigate slowness induced by 3rd party dependencies?",
"This should have been resolved through the outcomes of urllib3/urllib3#1590."
] |
https://api.github.com/repos/psf/requests/issues/5079
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5079/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5079/comments
|
https://api.github.com/repos/psf/requests/issues/5079/events
|
https://github.com/psf/requests/issues/5079
| 439,848,875 |
MDU6SXNzdWU0Mzk4NDg4NzU=
| 5,079 |
http://python-requests.org is down
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4710104?v=4",
"events_url": "https://api.github.com/users/0xYasser/events{/privacy}",
"followers_url": "https://api.github.com/users/0xYasser/followers",
"following_url": "https://api.github.com/users/0xYasser/following{/other_user}",
"gists_url": "https://api.github.com/users/0xYasser/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/0xYasser",
"id": 4710104,
"login": "0xYasser",
"node_id": "MDQ6VXNlcjQ3MTAxMDQ=",
"organizations_url": "https://api.github.com/users/0xYasser/orgs",
"received_events_url": "https://api.github.com/users/0xYasser/received_events",
"repos_url": "https://api.github.com/users/0xYasser/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/0xYasser/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/0xYasser/subscriptions",
"type": "User",
"url": "https://api.github.com/users/0xYasser",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-05-03T01:17:04Z
|
2021-09-04T00:06:09Z
|
2019-05-05T19:49:45Z
|
NONE
|
resolved
|
Summary.
http://python-requests.org/ redirects to https://docs.python-requests.org/ instead of http://docs.python-requests.org/.
## Expected Result
docs to be available
## Actual Result
Secure Connection Failed
## Reproduction Steps
```
curl https://docs.python-requests.org/
```
## System Information
```
N/A
```
|
{
"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": 3,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 3,
"url": "https://api.github.com/repos/psf/requests/issues/5079/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5079/timeline
| null |
completed
| null | null | false |
[
"Thanks! This should now be fixed :)",
"Something is broken about this again: `http://docs.python-requests.org/en/master/objects.inv` 301s to `href=\"https://2.python-requests.org//en/master/objects.inv`, but `2.python-requests.org` is returning a TLS error.\r\n\r\n```\r\nhttp: error: SSLError: HTTPSConnectionPool(host='2.python-requests.org', port=443): Max retries exceeded with url: /en/master/objects.inv (Caused by SSLError(SSLError(1, '[SSL: TLSV1_ALERT_INTERNAL_ERROR] tlsv1 alert internal error (_ssl.c:1056)'))) while doing GET request to URL: https://2.python-requests.org/en/master/objects.inv\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/5078
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5078/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5078/comments
|
https://api.github.com/repos/psf/requests/issues/5078/events
|
https://github.com/psf/requests/pull/5078
| 439,547,454 |
MDExOlB1bGxSZXF1ZXN0Mjc1MzI4NTEx
| 5,078 |
fix: CRLF injection in urllib3 - bump its version
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24290431?v=4",
"events_url": "https://api.github.com/users/aviadatsnyk/events{/privacy}",
"followers_url": "https://api.github.com/users/aviadatsnyk/followers",
"following_url": "https://api.github.com/users/aviadatsnyk/following{/other_user}",
"gists_url": "https://api.github.com/users/aviadatsnyk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/aviadatsnyk",
"id": 24290431,
"login": "aviadatsnyk",
"node_id": "MDQ6VXNlcjI0MjkwNDMx",
"organizations_url": "https://api.github.com/users/aviadatsnyk/orgs",
"received_events_url": "https://api.github.com/users/aviadatsnyk/received_events",
"repos_url": "https://api.github.com/users/aviadatsnyk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/aviadatsnyk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aviadatsnyk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/aviadatsnyk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-05-02T11:40:30Z
|
2021-08-31T00:07:16Z
|
2019-05-02T15:45:07Z
|
NONE
|
resolved
|
https://app.snyk.io/vuln/SNYK-PYTHON-URLLIB3-174323 (CVE-2019-11236) is CRLF injection a vulnerability in the urllib3 library.
This PR bumps its version.
This might not be directly related to requests, but would forbid projects using requests from using a fixed version of `urllib3`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24290431?v=4",
"events_url": "https://api.github.com/users/aviadatsnyk/events{/privacy}",
"followers_url": "https://api.github.com/users/aviadatsnyk/followers",
"following_url": "https://api.github.com/users/aviadatsnyk/following{/other_user}",
"gists_url": "https://api.github.com/users/aviadatsnyk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/aviadatsnyk",
"id": 24290431,
"login": "aviadatsnyk",
"node_id": "MDQ6VXNlcjI0MjkwNDMx",
"organizations_url": "https://api.github.com/users/aviadatsnyk/orgs",
"received_events_url": "https://api.github.com/users/aviadatsnyk/received_events",
"repos_url": "https://api.github.com/users/aviadatsnyk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/aviadatsnyk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aviadatsnyk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/aviadatsnyk",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5078/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5078/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5078.diff",
"html_url": "https://github.com/psf/requests/pull/5078",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5078.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5078"
}
| true |
[
"See eg. discussions in kennethreitz/requests#5063, kennethreitz/requests#5065, kennethreitz/requests#5067",
"closing since this is already being discussed. sorry for the noise."
] |
https://api.github.com/repos/psf/requests/issues/5077
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5077/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5077/comments
|
https://api.github.com/repos/psf/requests/issues/5077/events
|
https://github.com/psf/requests/issues/5077
| 439,256,392 |
MDU6SXNzdWU0MzkyNTYzOTI=
| 5,077 |
get url-encodes params twice
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/946674?v=4",
"events_url": "https://api.github.com/users/kyrofa/events{/privacy}",
"followers_url": "https://api.github.com/users/kyrofa/followers",
"following_url": "https://api.github.com/users/kyrofa/following{/other_user}",
"gists_url": "https://api.github.com/users/kyrofa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kyrofa",
"id": 946674,
"login": "kyrofa",
"node_id": "MDQ6VXNlcjk0NjY3NA==",
"organizations_url": "https://api.github.com/users/kyrofa/orgs",
"received_events_url": "https://api.github.com/users/kyrofa/received_events",
"repos_url": "https://api.github.com/users/kyrofa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kyrofa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kyrofa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kyrofa",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2019-05-01T17:56:30Z
|
2021-11-26T04:00:31Z
|
2021-08-28T03:47:50Z
|
NONE
|
resolved
|
Using v2.21.0 with python3. I may be doing something wrong, but it looks like `requests.get` double-encodes parameters.
## Expected Result
```python
>>> params = {"package": "hello", "s": "bionic,bionic-updates", "a": "amd64", "text": "on"}
>>> response = requests.get("http://people.canonical.com/~ubuntu-archive/madison.cgi", params)
>>> response.request.url
'https://people.canonical.com/~ubuntu-archive/madison.cgi?package=hello&s=bionic%2Cbionic-updates&a=amd64&text=on'
```
Note the expected encoding for the comma: `%2C`.
## Actual Result
```python
>>> params = {"package": "hello", "s": "bionic,bionic-updates", "a": "amd64", "text": "on"}
>>> response = requests.get("http://people.canonical.com/~ubuntu-archive/madison.cgi", params)
>>> response.request.url
'https://people.canonical.com/~ubuntu-archive/madison.cgi?package=hello&s=bionic%252Cbionic-updates&a=amd64&text=on'
```
Note the _actual_ encoding for the comma: `%252C`. Looks like it's getting encoded twice.
## Reproduction Steps
```python
import requests
params = {"package": "hello", "s": "bionic,bionic-updates", "a": "amd64", "text": "on"}
response = requests.get("http://people.canonical.com/~ubuntu-archive/madison.cgi", params)
print(response.request.url)
```
## System Information
$ python -m requests.help
```
$ python3 -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.7"
},
"platform": {
"release": "4.15.0-47-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010007f"
},
"urllib3": {
"version": "1.24.2"
},
"using_pyopenssl": false
}
```
|
{
"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/5077/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5077/timeline
| null |
completed
| null | null | false |
[
"Ah, this is interesting. I missed the HTTP->HTTPS redirect. Note that if I use HTTPS directly, it works as expected:\r\n\r\n```python\r\n>>> params = {\"package\": \"hello\", \"s\": \"bionic,bionic-updates\", \"a\": \"amd64\", \"text\": \"on\"}\r\n>>> response = requests.get(\"https://people.canonical.com/~ubuntu-archive/madison.cgi\", params)\r\n>>> response.request.url\r\n'https://people.canonical.com/~ubuntu-archive/madison.cgi?package=hello&s=bionic%2Cbionic-updates&a=amd64&text=on'\r\n```\r\n\r\nIt seems the double encoding only happens when following a redirect.",
"Was this fixed? Any comment at all?",
"Sorry for my action. Closed unintentionally.",
"This seems to be a server-side problem:\r\n\r\n```\r\n$ curl -sI \"http://people.canonical.com/~ubuntu-archive/madison.cgi?package=hello&s=bionic%2Cbionic-updates&a=amd64&text=on\" | grep Location \r\nLocation: https://people.canonical.com/~ubuntu-archive/madison.cgi?package=hello&s=bionic%252Cbionic-updates&a=amd64&text=on\r\n```",
"And the server-side problem is now fixed."
] |
https://api.github.com/repos/psf/requests/issues/5076
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5076/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5076/comments
|
https://api.github.com/repos/psf/requests/issues/5076/events
|
https://github.com/psf/requests/pull/5076
| 438,870,916 |
MDExOlB1bGxSZXF1ZXN0Mjc0ODA0NzUx
| 5,076 |
Possible fix for #4945?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45852703?v=4",
"events_url": "https://api.github.com/users/myrheimb/events{/privacy}",
"followers_url": "https://api.github.com/users/myrheimb/followers",
"following_url": "https://api.github.com/users/myrheimb/following{/other_user}",
"gists_url": "https://api.github.com/users/myrheimb/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/myrheimb",
"id": 45852703,
"login": "myrheimb",
"node_id": "MDQ6VXNlcjQ1ODUyNzAz",
"organizations_url": "https://api.github.com/users/myrheimb/orgs",
"received_events_url": "https://api.github.com/users/myrheimb/received_events",
"repos_url": "https://api.github.com/users/myrheimb/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/myrheimb/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/myrheimb/subscriptions",
"type": "User",
"url": "https://api.github.com/users/myrheimb",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-30T16:37:54Z
|
2021-08-30T00:06:48Z
|
2019-08-20T04:38:22Z
|
CONTRIBUTOR
|
resolved
|
Could the missing colon on line 612 in models.py be the reason for the missing reference in the docs as described in issue #4945?
|
{
"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/5076/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5076/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5076.diff",
"html_url": "https://github.com/psf/requests/pull/5076",
"merged_at": "2019-08-20T04:38:22Z",
"patch_url": "https://github.com/psf/requests/pull/5076.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5076"
}
| true |
[
"beautiful."
] |
https://api.github.com/repos/psf/requests/issues/5075
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5075/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5075/comments
|
https://api.github.com/repos/psf/requests/issues/5075/events
|
https://github.com/psf/requests/pull/5075
| 438,691,947 |
MDExOlB1bGxSZXF1ZXN0Mjc0NjY0NDUx
| 5,075 |
Remove unneeded setdefault calls
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1055747?v=4",
"events_url": "https://api.github.com/users/5j9/events{/privacy}",
"followers_url": "https://api.github.com/users/5j9/followers",
"following_url": "https://api.github.com/users/5j9/following{/other_user}",
"gists_url": "https://api.github.com/users/5j9/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/5j9",
"id": 1055747,
"login": "5j9",
"node_id": "MDQ6VXNlcjEwNTU3NDc=",
"organizations_url": "https://api.github.com/users/5j9/orgs",
"received_events_url": "https://api.github.com/users/5j9/received_events",
"repos_url": "https://api.github.com/users/5j9/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/5j9/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/5j9/subscriptions",
"type": "User",
"url": "https://api.github.com/users/5j9",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-04-30T09:50:38Z
|
2021-08-31T00:07:04Z
|
2019-08-20T04:16:59Z
|
NONE
|
resolved
|
Remove unneeded `kwargs.setdefault('allow_redirects', True)` calls from
`Session.get` and `Session.options`. The `allow_redirects` argument of
`Session.request`already has a default value of `True`.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5075/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5075/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5075.diff",
"html_url": "https://github.com/psf/requests/pull/5075",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5075.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5075"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/5074
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5074/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5074/comments
|
https://api.github.com/repos/psf/requests/issues/5074/events
|
https://github.com/psf/requests/issues/5074
| 438,248,273 |
MDU6SXNzdWU0MzgyNDgyNzM=
| 5,074 |
Posting a zip file to HTTP server in C
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/50102071?v=4",
"events_url": "https://api.github.com/users/priyadarsini17/events{/privacy}",
"followers_url": "https://api.github.com/users/priyadarsini17/followers",
"following_url": "https://api.github.com/users/priyadarsini17/following{/other_user}",
"gists_url": "https://api.github.com/users/priyadarsini17/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/priyadarsini17",
"id": 50102071,
"login": "priyadarsini17",
"node_id": "MDQ6VXNlcjUwMTAyMDcx",
"organizations_url": "https://api.github.com/users/priyadarsini17/orgs",
"received_events_url": "https://api.github.com/users/priyadarsini17/received_events",
"repos_url": "https://api.github.com/users/priyadarsini17/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/priyadarsini17/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/priyadarsini17/subscriptions",
"type": "User",
"url": "https://api.github.com/users/priyadarsini17",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-04-29T10:28:51Z
|
2021-11-05T03:00:31Z
|
2021-08-07T02:13:19Z
|
NONE
|
resolved
|
How to upload a file to HTTP server with SIM7600I module? I have used the AT commands as shown in the datasheet which I have attached, but I am getting error for HTTPPOSTFILE command.
Can you suggest me any other method in C, Keil project?
[SIM7500_SIM7600_SIM7800 Series_HTTP_AT Command Manual_V1.00.pdf](https://github.com/kennethreitz/requests/files/3126980/SIM7500_SIM7600_SIM7800.Series_HTTP_AT.Command.Manual_V1.00.pdf)
|
{
"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": 1,
"confused": 0,
"eyes": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/5074/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5074/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/5073
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5073/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5073/comments
|
https://api.github.com/repos/psf/requests/issues/5073/events
|
https://github.com/psf/requests/issues/5073
| 438,062,009 |
MDU6SXNzdWU0MzgwNjIwMDk=
| 5,073 |
Failed to establish a new connection: [Errno 11003] getaddrinfo failed
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/50078144?v=4",
"events_url": "https://api.github.com/users/Abysssssss/events{/privacy}",
"followers_url": "https://api.github.com/users/Abysssssss/followers",
"following_url": "https://api.github.com/users/Abysssssss/following{/other_user}",
"gists_url": "https://api.github.com/users/Abysssssss/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Abysssssss",
"id": 50078144,
"login": "Abysssssss",
"node_id": "MDQ6VXNlcjUwMDc4MTQ0",
"organizations_url": "https://api.github.com/users/Abysssssss/orgs",
"received_events_url": "https://api.github.com/users/Abysssssss/received_events",
"repos_url": "https://api.github.com/users/Abysssssss/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Abysssssss/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Abysssssss/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Abysssssss",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-28T14:24:32Z
|
2021-09-05T00:06:53Z
|
2019-04-29T11:02:12Z
|
NONE
|
resolved
|
If you try to install a module through pip, it generates this error. What just did not try. I could install packages by downloading from official sites, but I can’t do it, so this method is needed, and it’s also much more convenient. There was an option to use --proxy=user:pass@host:port, but I do not know what to enter in user, pass, host and port. I use the development environment Sublime Text, version of python 3.7.3. Very urgently, I rummaged through a bunch of sites - I did not find anything. I would be extremely grateful to the decision.

When using easy_install:

|
{
"avatar_url": "https://avatars.githubusercontent.com/u/50078144?v=4",
"events_url": "https://api.github.com/users/Abysssssss/events{/privacy}",
"followers_url": "https://api.github.com/users/Abysssssss/followers",
"following_url": "https://api.github.com/users/Abysssssss/following{/other_user}",
"gists_url": "https://api.github.com/users/Abysssssss/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Abysssssss",
"id": 50078144,
"login": "Abysssssss",
"node_id": "MDQ6VXNlcjUwMDc4MTQ0",
"organizations_url": "https://api.github.com/users/Abysssssss/orgs",
"received_events_url": "https://api.github.com/users/Abysssssss/received_events",
"repos_url": "https://api.github.com/users/Abysssssss/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Abysssssss/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Abysssssss/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Abysssssss",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5073/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5073/timeline
| null |
completed
| null | null | false |
[
"\r\n\r\n \r\n\r\n\r\n\r\n font{\r\n line-height: 1.6;\r\n }\r\n ul,ol{\r\n padding-left: 20px;\r\n list-style-position: inside;\r\n }\r\n\r\n\r\n \n I can install the numpy module through pip successful ,it not generate error. My environment:Python3.7.2;pip19.0.3;win10 professional Edition I don't have python2 in my operating system.\n \n \n \n \n \n \n \n \n \n \n \n \n \n dahlinsky\n \n \n \n \n [email protected]\n \n \n \n \n \n \n \n \n 签名由\n 网易邮箱大师\n 定制\n \n \n\n On 4/28/2019 22:25,Abysssssss<[email protected]> wrote: \n\n\nIf you try to install a module through pip, it generates this error. That just did not try. I could install packages by downloading from official sites, but I can’t do it, so this method is needed, and it’s also much more convenient. There was an option to use --proxy=user:pass@host:port, but I do not know what to enter in user, pass, host and port. I use the development environment Sublime Text. Very urgently, I rummaged through a bunch of sites - I did not find anything. I would be extremely grateful to the decision.\n\n\n\n\n\n—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread."
] |
https://api.github.com/repos/psf/requests/issues/5072
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5072/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5072/comments
|
https://api.github.com/repos/psf/requests/issues/5072/events
|
https://github.com/psf/requests/pull/5072
| 438,004,211 |
MDExOlB1bGxSZXF1ZXN0Mjc0MTQ1OTk5
| 5,072 |
Fix some issues to improve adherence to best practices
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/881122?v=4",
"events_url": "https://api.github.com/users/sanketsaurav/events{/privacy}",
"followers_url": "https://api.github.com/users/sanketsaurav/followers",
"following_url": "https://api.github.com/users/sanketsaurav/following{/other_user}",
"gists_url": "https://api.github.com/users/sanketsaurav/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sanketsaurav",
"id": 881122,
"login": "sanketsaurav",
"node_id": "MDQ6VXNlcjg4MTEyMg==",
"organizations_url": "https://api.github.com/users/sanketsaurav/orgs",
"received_events_url": "https://api.github.com/users/sanketsaurav/received_events",
"repos_url": "https://api.github.com/users/sanketsaurav/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sanketsaurav/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sanketsaurav/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sanketsaurav",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-04-28T02:30:52Z
|
2021-08-29T00:07:06Z
|
2020-02-18T07:01:53Z
|
NONE
|
resolved
|
Hi @kenneth-reitz,
I've fixed some style issues in the codebase to improve adherence to general best practices. 🚀
These issues were highlighted when I ran a DeepSource analysis on my fork of requests. I've added the DeepSource config file as well, which can be used to connect requests to DeepSource -- so this analysis runs on every pull-request, which will make it easier to maintain quality on contributions. DeepSource is used by some popular open-source projects, like [uber/ludwig](https://deepsource.io/gh/uber/ludwig/). The product is, and will forever remain, free for open-source.
To connect requests and run analysis on every PR, there are three simple steps:
1. **Merge this PR.** I've added a customised `.deepsource.toml` for requests.
2. **Sign up on DeepSource** and grant access to this repository [here](https://deepsource.io/signup/).
3. **Activate analysis** on requests [here](https://deepsource.io/gh/kennethreitz/requests/).
*Disclaimer: I'm a co-founder of DeepSource. We use requests for our code of course, and would love to give back!*
|
{
"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/5072/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5072/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5072.diff",
"html_url": "https://github.com/psf/requests/pull/5072",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5072.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5072"
}
| true |
[
"can you make these contributions to https://github.com/kennethreitz/requests3?",
"@kenneth-reitz Done! Please take a look at kennethreitz/requests3#15.",
"Thanks @sanketsaurav. We typically won't take stylistic or layout change PRs. It looks like Kenneth merged kennethreitz/requests3#15 though, so I'll resolve this in favor of that one."
] |
https://api.github.com/repos/psf/requests/issues/5071
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5071/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5071/comments
|
https://api.github.com/repos/psf/requests/issues/5071/events
|
https://github.com/psf/requests/issues/5071
| 436,944,957 |
MDU6SXNzdWU0MzY5NDQ5NTc=
| 5,071 |
Client certificate authentication: Support certificates as string input
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21178759?v=4",
"events_url": "https://api.github.com/users/arvindsree/events{/privacy}",
"followers_url": "https://api.github.com/users/arvindsree/followers",
"following_url": "https://api.github.com/users/arvindsree/following{/other_user}",
"gists_url": "https://api.github.com/users/arvindsree/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/arvindsree",
"id": 21178759,
"login": "arvindsree",
"node_id": "MDQ6VXNlcjIxMTc4NzU5",
"organizations_url": "https://api.github.com/users/arvindsree/orgs",
"received_events_url": "https://api.github.com/users/arvindsree/received_events",
"repos_url": "https://api.github.com/users/arvindsree/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/arvindsree/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arvindsree/subscriptions",
"type": "User",
"url": "https://api.github.com/users/arvindsree",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-24T23:12:39Z
|
2022-02-26T04:00:33Z
|
2021-11-28T03:34:00Z
|
NONE
|
resolved
|
Hi,
I am using requests for an HTTPS query with client certificate authentication. Requests currently only supports passing my key pair as a filename argument. I need to be able to pass my client auth key pair as a string
The python code is compiled and needs to be distributed to end users. I think passing the certificate as file name input in this use case is highly insecure.
Requests Version: 2.20.1
|
{
"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/5071/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5071/timeline
| null |
completed
| null | null | false |
[
"This would require implementation in urllib3 first before Requests could use it. The only work-around is using an `SSLContext` object yourself. Closing this for now."
] |
https://api.github.com/repos/psf/requests/issues/5070
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5070/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5070/comments
|
https://api.github.com/repos/psf/requests/issues/5070/events
|
https://github.com/psf/requests/pull/5070
| 436,722,375 |
MDExOlB1bGxSZXF1ZXN0MjczMTUxMjUy
| 5,070 |
Added requirements file for the project
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13381361?v=4",
"events_url": "https://api.github.com/users/bharatr21/events{/privacy}",
"followers_url": "https://api.github.com/users/bharatr21/followers",
"following_url": "https://api.github.com/users/bharatr21/following{/other_user}",
"gists_url": "https://api.github.com/users/bharatr21/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bharatr21",
"id": 13381361,
"login": "bharatr21",
"node_id": "MDQ6VXNlcjEzMzgxMzYx",
"organizations_url": "https://api.github.com/users/bharatr21/orgs",
"received_events_url": "https://api.github.com/users/bharatr21/received_events",
"repos_url": "https://api.github.com/users/bharatr21/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bharatr21/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bharatr21/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bharatr21",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-24T14:12:39Z
|
2021-08-31T00:07:18Z
|
2019-04-27T13:11:37Z
|
CONTRIBUTOR
|
resolved
|
Added a requirements.txt file for the project in case someone would want to install dependencies manually, or build from source etc.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5070/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5070/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5070.diff",
"html_url": "https://github.com/psf/requests/pull/5070",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5070.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5070"
}
| true |
[
"we already have a `Pipfile` for that :)"
] |
https://api.github.com/repos/psf/requests/issues/5069
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5069/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5069/comments
|
https://api.github.com/repos/psf/requests/issues/5069/events
|
https://github.com/psf/requests/issues/5069
| 436,298,480 |
MDU6SXNzdWU0MzYyOTg0ODA=
| 5,069 |
Provide a method ``Response.get_text(self, errors="strict")`` to allow user to custom decoding error handlering
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6800411?v=4",
"events_url": "https://api.github.com/users/MacHu-GWU/events{/privacy}",
"followers_url": "https://api.github.com/users/MacHu-GWU/followers",
"following_url": "https://api.github.com/users/MacHu-GWU/following{/other_user}",
"gists_url": "https://api.github.com/users/MacHu-GWU/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MacHu-GWU",
"id": 6800411,
"login": "MacHu-GWU",
"node_id": "MDQ6VXNlcjY4MDA0MTE=",
"organizations_url": "https://api.github.com/users/MacHu-GWU/orgs",
"received_events_url": "https://api.github.com/users/MacHu-GWU/received_events",
"repos_url": "https://api.github.com/users/MacHu-GWU/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MacHu-GWU/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MacHu-GWU/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MacHu-GWU",
"user_view_type": "public"
}
|
[
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
}
] |
closed
| true | null |
[] | null | 0 |
2019-04-23T17:12:51Z
|
2021-11-05T03:00:31Z
|
2021-08-07T02:14:48Z
|
NONE
|
resolved
|
based on the API doc, the property ``Response().text`` returns the html text. But it might fail due to encoding error. Because ``requests`` use ``.decode(errors="replace")`` by default.
Is there a method to specify the error handling options? Thank you
|
{
"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/5069/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5069/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/5068
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5068/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5068/comments
|
https://api.github.com/repos/psf/requests/issues/5068/events
|
https://github.com/psf/requests/issues/5068
| 436,124,031 |
MDU6SXNzdWU0MzYxMjQwMzE=
| 5,068 |
Question: Digest choose hash algorithm (HTTPDigestAuth)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6671030?v=4",
"events_url": "https://api.github.com/users/damanuel/events{/privacy}",
"followers_url": "https://api.github.com/users/damanuel/followers",
"following_url": "https://api.github.com/users/damanuel/following{/other_user}",
"gists_url": "https://api.github.com/users/damanuel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/damanuel",
"id": 6671030,
"login": "damanuel",
"node_id": "MDQ6VXNlcjY2NzEwMzA=",
"organizations_url": "https://api.github.com/users/damanuel/orgs",
"received_events_url": "https://api.github.com/users/damanuel/received_events",
"repos_url": "https://api.github.com/users/damanuel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/damanuel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/damanuel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/damanuel",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-04-23T10:54:03Z
|
2022-03-29T19:00:33Z
|
2021-12-29T18:15:34Z
|
NONE
|
resolved
|
I try to authenticate a post request using Digest authentication. The server returns a list of two authentication challenges with the hash algorithms MD5 & SHA-256.
To authenticate I use a HTTPDigestAuth object. It creates the digest using the second hash in the list (in this case SHA-256).
My question: is there a way to force the library to use MD5? Due to reasons, I don't want to use SHA-256, even though it is part of the authentication challenge.
|
{
"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/5068/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5068/timeline
| null |
completed
| null | null | false |
[
"I used my own authentication method as a workaround. But still, I am wondering if there is a more straight forward way to prioritize which algorithm to choose.",
"Hi @damanuel, it's not entirely clear what the challenge you're receiving looks like. There isn't formal way to specify which algorithm is used, so your current workaround is probably the best approach for now."
] |
https://api.github.com/repos/psf/requests/issues/5067
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5067/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5067/comments
|
https://api.github.com/repos/psf/requests/issues/5067/events
|
https://github.com/psf/requests/issues/5067
| 436,100,892 |
MDU6SXNzdWU0MzYxMDA4OTI=
| 5,067 |
urllib3 v1.25 support
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25142085?v=4",
"events_url": "https://api.github.com/users/EpicWink/events{/privacy}",
"followers_url": "https://api.github.com/users/EpicWink/followers",
"following_url": "https://api.github.com/users/EpicWink/following{/other_user}",
"gists_url": "https://api.github.com/users/EpicWink/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/EpicWink",
"id": 25142085,
"login": "EpicWink",
"node_id": "MDQ6VXNlcjI1MTQyMDg1",
"organizations_url": "https://api.github.com/users/EpicWink/orgs",
"received_events_url": "https://api.github.com/users/EpicWink/received_events",
"repos_url": "https://api.github.com/users/EpicWink/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/EpicWink/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/EpicWink/subscriptions",
"type": "User",
"url": "https://api.github.com/users/EpicWink",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 15 |
2019-04-23T09:57:21Z
|
2021-09-05T00:06:51Z
|
2019-05-16T15:08:29Z
|
NONE
|
resolved
|
Support for `urllib3` [v1.25](https://github.com/urllib3/urllib3/releases/tag/1.25) (released today/yesterday). The usual yada-yada "my CI is broken".
Multiple packages that we depend on (eg `google.cloud.storage`, `azure.storage`) have strict version-check on `requests` using `pkg_resources.require('requests >= 2.18.0')`. Any unmet dependencies in the chain below and including `requests` will cause the check to fail and raise an exception. `urllib3<1.25` is currently one such dependency.
## Expected Result
No exception raised on import
## Actual Result
```
pkg_resources.ContextualVersionConflict: (urllib3 1.25 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('urllib3<1.25,>=1.21.1'), {'requests'})
The above exception was the direct cause of the following exception:
ImportError: ``requests >= 2.18.0`` is required by the ``google.resumable_media.requests`` subpackage.
It can be installed via
pip install google-resumable-media[requests].
```
## Reproduction Steps
```bash
pip3 install sentry-sdk google-cloud-storage
```
```python
>>> from google.cloud import storage
```
## System Information
```
/home/laurie/env-tmp/lib/python3.6/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.6.7"
},
"platform": {
"release": "4.18.0-17-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010100f"
},
"urllib3": {
"version": "1.25"
},
"using_pyopenssl": false
}
```
|
{
"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": 20,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 20,
"url": "https://api.github.com/repos/psf/requests/issues/5067/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5067/timeline
| null |
completed
| null | null | false |
[
"Note that a pull-request fixing this should close #5065 and #4961 ",
"Also note that a solution to the above reproduction example is:\r\n```bash\r\npip3 install sentry-sdk google-cloud-storage 'urllib3<1.25'\r\n```",
"There’s already a PR in the works: https://github.com/kennethreitz/requests/pull/5063",
"To those watching, as [mentioned](https://github.com/kennethreitz/requests/pull/5063#issuecomment-487436504), we're [blocked](https://github.com/kennethreitz/requests/issues/5065#issuecomment-487423564) on `urllib3` v1.25.2",
"@nateprewitt FYI 1.25.2 will be released very soon, I would recommend in addition to disallowing 1.25.0 also disallow 1.25.1?",
"Our CI pipeline starts to get an error `[integration_py3_docker_metric] 19-04-29:10:26:57 ERROR [clipper_metric_docker.py:127] Failed to parse: http://localhost:44328/api/v1/series?match[]=clipper_mc_parse_time_ms_sum` from April 22nd, from when `urllib3` version 1.25 was released. Do you think this is related to this issue? ",
"@rkooo567, have you tried running the CI with the additional requirement `urllib3<1.25`?",
"@EpicWink Yes. And it seems like it resolves an issue. I also found out `urllib3==1.25.2` also resolves the problem. ",
"urllib3 1.24.3 has been released which fixes only the CRLF injection issue for 1.24.X users.",
"Here's a possibly dumb question: why does requests restrict urllib3 to be < 1.25? Since many other pip dependencies are going to continue to increase their minimum allowed urllib3 version, it seems like this is going to guarantee two things:\r\n1. Every minor version bump in urllib3 will break many projects which depend on requests (e.g. anyone who is using the major Google or Microsoft Azure packages, among many others).\r\n2. Every minor version bump in urllib3 will then require a new release of requests to allow the new version of urllib3.\r\n\r\nDoes urllib3 make breaking changes that often that we're worried about just trusting their versioning? Or is there another concern?",
"@plowman https://github.com/kennethreitz/requests/issues/5080 Looks like [the update to version 1.25 would make requests start up much slower](https://github.com/urllib3/urllib3/issues/1590#issue-438508993). ",
"Based on the number of references to this issue in other projects’ trackers, I’m sure there are a lot of other project maintainers that would appreciate a resolution to this sooner rather than later… :) (Pointing it out since issue references don’t trigger e‐mail notifications.)",
"+1 because it aggravates problems caused by [Pip's lack of a dependency resolver](https://github.com/pypa/pip/issues/988) in some cases: https://github.com/pradyunsg/zazo/issues/14\r\n",
"If you think that's fun, look at all the things that use requests and can't update urllib3. (we do some manual checking)\r\n\r\nhttp://logs.openstack.org/36/658636/3/check/requirements-tox-py27-check-uc/48d2334/job-output.txt.gz#_2019-05-14_06_33_55_887702",
"Resolved with #5092, release is up on pypi now. Thanks again @EpicWink"
] |
https://api.github.com/repos/psf/requests/issues/5066
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5066/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5066/comments
|
https://api.github.com/repos/psf/requests/issues/5066/events
|
https://github.com/psf/requests/pull/5066
| 436,010,295 |
MDExOlB1bGxSZXF1ZXN0MjcyNTkxNjcw
| 5,066 |
[doc website] Add a nice search experience
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/32097720?v=4",
"events_url": "https://api.github.com/users/s-pace/events{/privacy}",
"followers_url": "https://api.github.com/users/s-pace/followers",
"following_url": "https://api.github.com/users/s-pace/following{/other_user}",
"gists_url": "https://api.github.com/users/s-pace/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/s-pace",
"id": 32097720,
"login": "s-pace",
"node_id": "MDQ6VXNlcjMyMDk3NzIw",
"organizations_url": "https://api.github.com/users/s-pace/orgs",
"received_events_url": "https://api.github.com/users/s-pace/received_events",
"repos_url": "https://api.github.com/users/s-pace/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/s-pace/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/s-pace/subscriptions",
"type": "User",
"url": "https://api.github.com/users/s-pace",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-23T05:52:33Z
|
2021-08-31T00:07:19Z
|
2019-04-23T12:23:58Z
|
NONE
|
resolved
|
👋 team,
TL;DR: Add same search experience as https://pipenv.readthedocs.io/en/latest/
I'm working at Algolia on the a project called [DocSearch](https://community.algolia.com/docsearch/) which goal is to enhance documentation websites with exhaustive, fast and relevant search. You might have seen DocSearch live already on websites like [pipenv](https://pipenv.readthedocs.io/en/latest/), [Bootstrap](https://getbootstrap.com/), [Brew](https://brew.sh/) or [jQuery](https://jquery.com/).
I have created [a preview of this PR](https://docsearch-requests.netlify.com/) and what DocSearch on the requests website could will look like here. Feel free to try it and let us know what you think. Please not the learn-as-you-type experience and the typo tolerance:
[](https://docsearch-requests.netlify.com/)
The way DocSearch works is by crawling your content, pushing the results into an Algolia index, and then requesting this index directly from the website front-end through JavaScript.
We'll take care of crawling your website and populating the Algolia index with the latest changes every 24h for you. You don't need to change anything to your deployment process. The only thing you need to add are the following CSS and JS snippets that will bind the dropdown to your searchbox.
We built DocSearch with the idea of giving back to the Open-Source community. This is why your [crawling configuration](https://github.com/algolia/docsearch-configs/blob/master/configs/python-requests.json) is available on GitHub if you want to change it. We also have our own [documentation](https://community.algolia.com/docsearch/documentation/) to help you tweak the dropdown to your needs. You'll also have access to *analytics on the most searched terms* or those with *no results*. All of this is of course *entirely free*.
Follow realpython/python-guide#932, pypa/pipenv#3703, kennethreitz/requests-html#292, kennethreitz/requests3#14, kennethreitz/responder#347
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/5066/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5066/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5066.diff",
"html_url": "https://github.com/psf/requests/pull/5066",
"merged_at": "2019-04-23T12:23:58Z",
"patch_url": "https://github.com/psf/requests/pull/5066.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5066"
}
| true |
[
"Let me know if you need anything, we can grant you access to some analytics @kenneth-reitz "
] |
https://api.github.com/repos/psf/requests/issues/5065
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5065/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5065/comments
|
https://api.github.com/repos/psf/requests/issues/5065/events
|
https://github.com/psf/requests/issues/5065
| 435,893,413 |
MDU6SXNzdWU0MzU4OTM0MTM=
| 5,065 |
URLlib 1.24.1 vulnerable to CVE-2019-11324 (rated CVSS 7.5 High)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/27660797?v=4",
"events_url": "https://api.github.com/users/Heretyc/events{/privacy}",
"followers_url": "https://api.github.com/users/Heretyc/followers",
"following_url": "https://api.github.com/users/Heretyc/following{/other_user}",
"gists_url": "https://api.github.com/users/Heretyc/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Heretyc",
"id": 27660797,
"login": "Heretyc",
"node_id": "MDQ6VXNlcjI3NjYwNzk3",
"organizations_url": "https://api.github.com/users/Heretyc/orgs",
"received_events_url": "https://api.github.com/users/Heretyc/received_events",
"repos_url": "https://api.github.com/users/Heretyc/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Heretyc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Heretyc/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Heretyc",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2019-04-22T21:08:46Z
|
2021-09-05T00:06:52Z
|
2019-05-16T15:07:34Z
|
NONE
|
resolved
|
Requests currently lists urllib3 1.24.1 as an acceptable dependency. Understanding that urllib3 1.25 support is in the pipeline, **CVE-2019-11324 (Published just 4 days ago as of this submission)** already has remediation in the incremental urllib3 version 1.24.2. This incremental change is likely to require minimal refactoring to support and would provide immediate remediation to a vulnerability listed as CVSS 7.5 (High).
https://nvd.nist.gov/vuln/detail/CVE-2019-11324
An incremental version update to urllib3 1.24.2 should be regression tested and implemented, rather than waiting for 1.25.0 support. This 1.24.2 fix has minimal code changes and should be expected to work with minimal labor.
There is (of course) a non-zero chance that a regression could occur by forcing urllib3 >= 1.24.2 , but the ease of implementation vs the potential impact of not supporting this change feels like a clear choice for editing these two sections. (Listed below)
## Specific issues
### Pipfile.lock
```JSON
"urllib3": {
"hashes": [
"sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b",
"sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f"
],
"version": "==1.22"
```
### setup.py
``` python
requires = [
'chardet>=3.0.2,<3.1.0',
'idna>=2.5,<2.9',
'urllib3>=1.21.1,<1.25',
'certifi>=2017.4.17'
]
```
|
{
"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": 8,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 8,
"url": "https://api.github.com/repos/psf/requests/issues/5065/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5065/timeline
| null |
completed
| null | null | false |
[
"Hi Brandon, thanks for the ticket. We’re aware of the change and working to get Requests tested and upgraded. I’ll leave this open for now in case anyone else comes along with a similar inquiry.",
"Excellent, glad to hear 1.25 support is so close! Keep up the good work.",
"May I ask, how close is `requests` to supporting 1.25? Imminently, days, or weeks?\r\n\r\n(Asking only so we can get an idea of the timeframe involved.)\r\n\r\nEdit: Specifically 1.25",
"@MartinFalatic, I can’t commit to a timeline yet but I would say end of week is a reasonable high level estimate. I’ll get things out sooner if resources allow.",
"Sounds good - thank you for the info!",
"Just FYI, I've had the patch up with testing infra fixes and the 1.22 release on the urllib31.25 branch for a few days but we're blocked on urllib3/urllib3#1583 and urllib3/urllib3#1586. Once 1.25.2 is released, we'll update the pin to only support 1.25.2+ and should be ready for a release.\r\n\r\nAnd just to clarify impact, the way Requests uses urllib3 means it shouldn't be vulnerable* to this issue out of the box.\r\n\r\n*We can't speak to the security of any hooks or modifications people have made on top of Requests.",
"FYI, a resolution has also been merged into the 1.24 series and released as 1.24.3:\r\n\r\nhttps://github.com/urllib3/urllib3/pull/1593\r\nhttps://github.com/urllib3/urllib3/releases/tag/1.24.3",
"@nateprewitt it looks like both of those PRs have been merged. Any ETA on a new version?\r\nEDIT: \r\n> And just to clarify impact, the way Requests uses urllib3 means it shouldn't be vulnerable* to this issue out of the box.\r\n\r\nAlso, some clarity here would be nice. What about the use of `urllib` prevents this from impacting `requests`?",
"Resolved with #5092."
] |
https://api.github.com/repos/psf/requests/issues/5064
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5064/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5064/comments
|
https://api.github.com/repos/psf/requests/issues/5064/events
|
https://github.com/psf/requests/issues/5064
| 435,478,660 |
MDU6SXNzdWU0MzU0Nzg2NjA=
| 5,064 |
Great library, gonna be owesome if it can work on micropython
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9161733?v=4",
"events_url": "https://api.github.com/users/nedoskiv/events{/privacy}",
"followers_url": "https://api.github.com/users/nedoskiv/followers",
"following_url": "https://api.github.com/users/nedoskiv/following{/other_user}",
"gists_url": "https://api.github.com/users/nedoskiv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nedoskiv",
"id": 9161733,
"login": "nedoskiv",
"node_id": "MDQ6VXNlcjkxNjE3MzM=",
"organizations_url": "https://api.github.com/users/nedoskiv/orgs",
"received_events_url": "https://api.github.com/users/nedoskiv/received_events",
"repos_url": "https://api.github.com/users/nedoskiv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nedoskiv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nedoskiv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nedoskiv",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-21T05:59:26Z
|
2021-09-05T00:06:49Z
|
2019-06-01T08:45:19Z
|
NONE
|
resolved
|
Hello,
micropython need library like this one
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9161733?v=4",
"events_url": "https://api.github.com/users/nedoskiv/events{/privacy}",
"followers_url": "https://api.github.com/users/nedoskiv/followers",
"following_url": "https://api.github.com/users/nedoskiv/following{/other_user}",
"gists_url": "https://api.github.com/users/nedoskiv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nedoskiv",
"id": 9161733,
"login": "nedoskiv",
"node_id": "MDQ6VXNlcjkxNjE3MzM=",
"organizations_url": "https://api.github.com/users/nedoskiv/orgs",
"received_events_url": "https://api.github.com/users/nedoskiv/received_events",
"repos_url": "https://api.github.com/users/nedoskiv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nedoskiv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nedoskiv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nedoskiv",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5064/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5064/timeline
| null |
completed
| null | null | false |
[
"huh I did not recall posting that issue, perhaps someone messed with my computer, sorry about that"
] |
https://api.github.com/repos/psf/requests/issues/5063
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5063/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5063/comments
|
https://api.github.com/repos/psf/requests/issues/5063/events
|
https://github.com/psf/requests/pull/5063
| 435,454,125 |
MDExOlB1bGxSZXF1ZXN0MjcyMTgzMjUx
| 5,063 |
Allow urllib3 1.25.x
|
{
"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 | 13 |
2019-04-20T23:30:58Z
|
2021-08-31T00:07:15Z
|
2019-04-29T02:15:04Z
|
CONTRIBUTOR
|
resolved
|
1.25.x will include a fix for `CVE-2019-11236`
https://github.com/urllib3/urllib3/issues/1553#issuecomment-484213670
|
{
"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": 27,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 3,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 30,
"url": "https://api.github.com/repos/psf/requests/issues/5063/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5063/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5063.diff",
"html_url": "https://github.com/psf/requests/pull/5063",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5063.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5063"
}
| true |
[
"Just here to say that urllib3 1.25 will be released soon.",
"@kenneth-reitz It's out https://pypi.org/project/urllib3/1.25/\r\n\r\nThe CI failures here are unrelated btw 🙂 ",
"our tests failing, waiting for this PR to be merged.",
"Hi @ofek, thanks for putting this together. Per our usual release practice, we’ll do all the versioning and release doc updates in one PR before release. We’re working on getting the test issue resolved and 1.25 tested, then will aim to get a release out.",
"@nateprewitt Thanks! So upgrading a dep in a one-off PR like https://github.com/kennethreitz/requests/pull/4889 is uncommon then?",
"@ofek, yes that PR would be considered abnormal and only accepted because it was pushed out by a member of the Requests team.",
"@nateprewitt Any progress?",
"FYI there will probably be a urllib3==1.25.1 release in the next day or so. ",
"@nateprewitt urllib3==1.25.1 has been released. I would recommend disallowing urllib3==1.25 in the `install_requires`. :)",
"@sethmlarson Done! Just in case this gets merged",
"Tests are failing due to the requirement `pytest<4.1,>=2.7,>=2.8.0,>=3.6,>=4.4.0` which will never work. I'm guessing that multiple dependencies have their own requirement on `pytest`.\r\n\r\nAlso, does `urllib3!=1.25` expand out to `urllib3!=1.25.0`? Should that be made explicit? I assume this is put in to install `urllib3` v1.25.1 or later",
"Hi @EpicWink, we already have both of those issue resolved on a separate branch (urllib31.25) but are blocked on a couple fixes in urllib3 1.25.2. We’ll work on getting a patch out when that’s pushed.\r\n\r\nI’m going to resolve this in favor of the other issues to reduce noise on the mailing list. Thanks!",
"urllib3 1.24.3 has been released which fixes only the CRLF injection issue for 1.24.X users."
] |
https://api.github.com/repos/psf/requests/issues/5062
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5062/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5062/comments
|
https://api.github.com/repos/psf/requests/issues/5062/events
|
https://github.com/psf/requests/pull/5062
| 435,435,182 |
MDExOlB1bGxSZXF1ZXN0MjcyMTc0MjY5
| 5,062 |
docs: Correct the spelling of "maintenance"
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/301220?v=4",
"events_url": "https://api.github.com/users/alexwlchan/events{/privacy}",
"followers_url": "https://api.github.com/users/alexwlchan/followers",
"following_url": "https://api.github.com/users/alexwlchan/following{/other_user}",
"gists_url": "https://api.github.com/users/alexwlchan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alexwlchan",
"id": 301220,
"login": "alexwlchan",
"node_id": "MDQ6VXNlcjMwMTIyMA==",
"organizations_url": "https://api.github.com/users/alexwlchan/orgs",
"received_events_url": "https://api.github.com/users/alexwlchan/received_events",
"repos_url": "https://api.github.com/users/alexwlchan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alexwlchan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alexwlchan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alexwlchan",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-04-20T20:07:40Z
|
2021-08-31T00:07:18Z
|
2019-04-27T13:12:10Z
|
CONTRIBUTOR
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5062/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5062/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5062.diff",
"html_url": "https://github.com/psf/requests/pull/5062",
"merged_at": "2019-04-27T13:12:10Z",
"patch_url": "https://github.com/psf/requests/pull/5062.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5062"
}
| true |
[] |
|
https://api.github.com/repos/psf/requests/issues/5061
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5061/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5061/comments
|
https://api.github.com/repos/psf/requests/issues/5061/events
|
https://github.com/psf/requests/issues/5061
| 434,604,763 |
MDU6SXNzdWU0MzQ2MDQ3NjM=
| 5,061 |
should be closed when post a file
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/36180428?v=4",
"events_url": "https://api.github.com/users/chibuchifan/events{/privacy}",
"followers_url": "https://api.github.com/users/chibuchifan/followers",
"following_url": "https://api.github.com/users/chibuchifan/following{/other_user}",
"gists_url": "https://api.github.com/users/chibuchifan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chibuchifan",
"id": 36180428,
"login": "chibuchifan",
"node_id": "MDQ6VXNlcjM2MTgwNDI4",
"organizations_url": "https://api.github.com/users/chibuchifan/orgs",
"received_events_url": "https://api.github.com/users/chibuchifan/received_events",
"repos_url": "https://api.github.com/users/chibuchifan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chibuchifan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chibuchifan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chibuchifan",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-04-18T06:07:25Z
|
2021-11-05T03:00:30Z
|
2021-08-07T02:16:24Z
|
NONE
|
resolved
|
the [post-a-multipart-encoded-file](http://www.python-requests.org/en/master/user/quickstart/#post-a-multipart-encoded-file) demo show:
```python
>>> url = 'https://httpbin.org/post'
>>> files = {'file': ('report.xls', open('report.xls', 'rb'), 'application/vnd.ms-excel', {'Expires': '0'})}
>>> r = requests.post(url, files=files)
>>> r.text
{
...
"files": {
"file": "<censored...binary...data>"
},
...
}
```
here open a file `report.xls`, and in [`requests.module.RequestEncodingMixin`](https://github.com/kennethreitz/requests/blob/9742da7f91f595796a412a8150aacc00191be039/requests/models.py#L158) it read the opened file:
```python
if isinstance(fp, (str, bytes, bytearray)):
fdata = fp
elif hasattr(fp, 'read'):
# todo **here**
fdata = fp.read()
elif fp is None:
continue
else:
fdata = fp
```
so i'm not sure if it should be close
|
{
"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/5061/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5061/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/5060
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5060/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5060/comments
|
https://api.github.com/repos/psf/requests/issues/5060/events
|
https://github.com/psf/requests/issues/5060
| 434,279,436 |
MDU6SXNzdWU0MzQyNzk0MzY=
| 5,060 |
How can I use other protocol?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22983012?v=4",
"events_url": "https://api.github.com/users/ka1n4t/events{/privacy}",
"followers_url": "https://api.github.com/users/ka1n4t/followers",
"following_url": "https://api.github.com/users/ka1n4t/following{/other_user}",
"gists_url": "https://api.github.com/users/ka1n4t/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ka1n4t",
"id": 22983012,
"login": "ka1n4t",
"node_id": "MDQ6VXNlcjIyOTgzMDEy",
"organizations_url": "https://api.github.com/users/ka1n4t/orgs",
"received_events_url": "https://api.github.com/users/ka1n4t/received_events",
"repos_url": "https://api.github.com/users/ka1n4t/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ka1n4t/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ka1n4t/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ka1n4t",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-04-17T13:19:56Z
|
2021-09-05T00:06:54Z
|
2019-04-20T09:48:49Z
|
NONE
|
resolved
|
How can I use other protocol, such as gopher, dict, file....
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22983012?v=4",
"events_url": "https://api.github.com/users/ka1n4t/events{/privacy}",
"followers_url": "https://api.github.com/users/ka1n4t/followers",
"following_url": "https://api.github.com/users/ka1n4t/following{/other_user}",
"gists_url": "https://api.github.com/users/ka1n4t/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ka1n4t",
"id": 22983012,
"login": "ka1n4t",
"node_id": "MDQ6VXNlcjIyOTgzMDEy",
"organizations_url": "https://api.github.com/users/ka1n4t/orgs",
"received_events_url": "https://api.github.com/users/ka1n4t/received_events",
"repos_url": "https://api.github.com/users/ka1n4t/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ka1n4t/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ka1n4t/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ka1n4t",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5060/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5060/timeline
| null |
completed
| null | null | false |
[
"Since requests is an HTTP library, I don't believe it would be possible to use it with gopher. You might have better luck with [Pituophis](https://github.com/dotcomboom/Pituophis)",
"> \r\n> \r\n> Since requests is an HTTP library, I don't believe it would be possible to use it with gopher. You might have better luck with [Pituophis](https://github.com/dotcomboom/Pituophis)\r\n\r\nthanks, I'll try"
] |
https://api.github.com/repos/psf/requests/issues/5059
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5059/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5059/comments
|
https://api.github.com/repos/psf/requests/issues/5059/events
|
https://github.com/psf/requests/issues/5059
| 434,068,931 |
MDU6SXNzdWU0MzQwNjg5MzE=
| 5,059 |
some issues about proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/37021435?v=4",
"events_url": "https://api.github.com/users/wz343450860/events{/privacy}",
"followers_url": "https://api.github.com/users/wz343450860/followers",
"following_url": "https://api.github.com/users/wz343450860/following{/other_user}",
"gists_url": "https://api.github.com/users/wz343450860/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wz343450860",
"id": 37021435,
"login": "wz343450860",
"node_id": "MDQ6VXNlcjM3MDIxNDM1",
"organizations_url": "https://api.github.com/users/wz343450860/orgs",
"received_events_url": "https://api.github.com/users/wz343450860/received_events",
"repos_url": "https://api.github.com/users/wz343450860/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wz343450860/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wz343450860/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wz343450860",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-04-17T02:54:49Z
|
2021-09-02T00:07:18Z
|
2020-02-18T07:25:48Z
|
NONE
|
resolved
|
Dear Supporter
I used a proxy when I request some website, I found that my ip agent is not in effect. In order to verify this , I used a fake ip proxy such as http://123.123.123.123:123, but when I used this ip to
request this url "https://mobile.yangkeduo.com/goods2.html?goods_id=473261", it seems not connect porxy first, but the response is returned and it is the real content from this url. I can't understand why ip doesn't take effect. Because the ip is fake I thought it will raise a proxyError。
Could you tell me why?
Zhao
|
{
"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": 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/5059/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5059/timeline
| null |
completed
| null | null | false |
[
"Hi Supporter\r\n I debugged this request when I add the proxy in requests.session().proxies, in the adapters.py the method \"conn = self.get_connection(request.url, proxies)\" the proxies turn to None, ",
"Dear @wz343450860 \r\n\r\nIf you request an https url, you should configure an http**s** proxy, configuring an http (not https) proxy wouldn't affect an https request.\r\n\r\nCan you please confirm that you've configured an https proxy and requested an https url - or vice versa - configured an http proxy and requested an http url?\r\n\r\nIf you can confirm it, can you please paste an example code which demonstrate the issue, the requests library version and python version?\r\n\r\nThanks!"
] |
https://api.github.com/repos/psf/requests/issues/5058
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5058/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5058/comments
|
https://api.github.com/repos/psf/requests/issues/5058/events
|
https://github.com/psf/requests/issues/5058
| 434,029,127 |
MDU6SXNzdWU0MzQwMjkxMjc=
| 5,058 |
Nested dict data get silently ignored in POST request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6430786?v=4",
"events_url": "https://api.github.com/users/martimlobao/events{/privacy}",
"followers_url": "https://api.github.com/users/martimlobao/followers",
"following_url": "https://api.github.com/users/martimlobao/following{/other_user}",
"gists_url": "https://api.github.com/users/martimlobao/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/martimlobao",
"id": 6430786,
"login": "martimlobao",
"node_id": "MDQ6VXNlcjY0MzA3ODY=",
"organizations_url": "https://api.github.com/users/martimlobao/orgs",
"received_events_url": "https://api.github.com/users/martimlobao/received_events",
"repos_url": "https://api.github.com/users/martimlobao/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/martimlobao/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/martimlobao/subscriptions",
"type": "User",
"url": "https://api.github.com/users/martimlobao",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 11 |
2019-04-16T23:35:42Z
|
2020-12-26T19:21:04Z
| null |
NONE
| null |
I just spent the last several hours trying to figure out why I was able to successfully send an API POST request through `curl` but not through requests.
After much searching on SO, I finally figured out the solution, but I'm still confused why this should be a problem at all. Furthermore, it's very strange that requests does such a good job of simplifying HTTP requests but then reveals intricacies that an end user likely won't know how to deal with.
It turns out that `requests.post()` already has a `json` argument which handles non-trivial data dictionaries, but I don't understand why a user should need to know when to use `json` instead of `data`. To a simple user like me (and others: #2885), `data` simply takes a dictionary and parses it into a request. Using `json` in some cases but not others adds confusion and is not obvious at all. I also don't understand why I wouldn't want to *always* use `json` instead of `data`.
At the very least, if there's a strong reason why it makes sense to have both `data` and `json` arguments, a warning should be raised in these cases telling the user that they might not be sending what they think they're sending.
## Expected Result
Here's an example request of what I was sending through `curl`:
```bash
$ curl -X POST 'https://httpbin.org/post' -H 'Content-Type: application/json' -d '{"first": [{"second": {"third": "data"}}]}'
{
"args": {},
"data": "{\"first\": [{\"second\": {\"third\": \"data\"}}]}",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Content-Length": "42",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "curl/7.54.0"
},
"json": {
"first": [
{
"second": {
"third": "data"
}
}
]
},
"origin": "123.56.7.890, 123.56.7.890",
"url": "https://httpbin.org/post"
}
```
Sending (what I thought was) an equivalent request through requests always returned an invalid json error:
```python
import requests
headers = {"Content-Type": "application/json"}
data = {
"first": [
{
"second": {
"third": "data"
}
}
]
}
r = requests.post("https://httpbin.org/post", headers=headers, data=data)
print(r.json())
```
I expected the entire `data` dictionary to be sent in the request. However, when looking at the response from httpbin, it becomes clear that all the data from the second level is missing.
## Actual Result
This is the response from httpbin, with almost all of the sent data missing:
```bash
{'args': {},
'data': 'first=second',
'files': {},
'form': {},
'headers': {'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate',
'Content-Length': '12',
'Content-Type': 'application/json',
'Host': 'httpbin.org',
'User-Agent': 'python-requests/2.19.1'},
'json': None,
'origin': '123.56.7.890, 123.56.7.890',
'url': 'https://httpbin.org/post'}
```
## Reproduction Steps
```python
import requests
headers = {"Content-Type": "application/json"}
data = {
"first": [
{
"second": {
"third": "data"
}
}
]
}
r = requests.post("https://httpbin.org/post", headers=headers, data=data)
print(r.json())
```
Changing the request fixes the issue, but the solution is (to me) non-obvious:
```python
r = requests.post("https://httpbin.org/post", headers=headers, json=data)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.6.6"
},
"platform": {
"release": "18.5.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.19.1"
},
"system_ssl": {
"version": "1000212f"
},
"urllib3": {
"version": "1.23"
},
"using_pyopenssl": false
}
```
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 3,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 3,
"url": "https://api.github.com/repos/psf/requests/issues/5058/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5058/timeline
| null | null | null | null | false |
[
"Is there a recommendation for working around this?",
"I ran into the same (or closely related) problem today. My nested json got turned into a list, using the keys as entries in the list and dropping the actual values.",
"I had some issues doing it like this:\r\nr = requests.post(endpoint, data=params, headers=headers)\r\n\r\n@martimlobao had the answer, just change data to json\r\nr = requests.post(endpoint, json=params, headers=headers)\r\n\r\nThanks @martimlobao ",
"It does seem ridiculous that using the standard `data` parameter as described in the docs should choose to silently discard data, just because some nesting was involved! So users are left having to browse Github to find issues like this one to learn about a workaround. At the very least, the limitation should be highlighted in the docs.\r\n\r\nI realise that similar issues have been closed in the past with the suggestion that users use [Requests Toolbelt](https://toolbelt.readthedocs.io/en/latest/formdata.html), but as nested form data is such a common part of web applications and APIs it really does feel like Requests should support this type of encoding directly.",
"are there any other workaround then to change the req from **data** to **json**?\r\n\r\nI can'r change the request type and need some way to handle it and send the response back. I have tried most of the solutions but Nested dict data still gets ignored. ",
"@sahilnyati9 Another workaround is to use `json.dumps`. So, e.g. this should work as intended:\r\n\r\n```python\r\nr = requests.post(\"https://httpbin.org/post\", headers=headers, data=json.dumps(data))\r\n```\r\n\r\nOne thing to note is that using `json` instead of `data` has the side-effect of automatically setting `'Content-Type'` to `'application/json'` in the headers; using `data` you have to set the content type manually.\r\n\r\nI think the issue here is not so much that you have to use one or the other in a given situation, but that an exception (or at least a warning) should be raised when misusing the `data` argument.",
"@martimlobao Thanks for the suggestion. The issue here I don't have control over the request that I receive. \r\nThe request that I receive is in this format - **auth.session.post(self.__path + self._url, data=data)**\r\n\r\nIn that case, all I could do is something on the receiving end to handle the request data in a way that I could formulate it correctly and send the response back. But, I have been unsuccessful as whatever I do to read it, it still skips the nested values.\r\n\r\nI have tried things like below to read it properly but no success so far:\r\n#print(request.__dict__)\r\n#print(request.headers)\r\n#data = request.get_data()\r\n#data = request['data']\r\n#print(data)\r\n#print(request.data)\r\n#print(\"BODY\", request.body)\r\n#json.dumps(parse_qs(request.get_data()))\r\n#payload_dict = parse_qs(request.get_data())\r\n#print(payload_dict, type(payload_dict))\r\n#payload_dict_value_arr = payload_dict[b'creditTransferTransactionInformation']\r\n#print(payload_dict_value_arr, type(payload_dict_value_arr))\r\n# Get data from the index[0] of the array payload_dict_value_arr\r\n#data = payload_dict_value_arr[0]\r\n#print(data, type(data))\r\n#payload = request.form\r\n#print(payload['paymentTypeInformation'], type(payload['paymentTypeInformation']))\r\n#print(payload['serviceLevelCode'], type(payload['serviceLevelCode']))",
"@sahilnyati9 I don't understand what you mean. If you want to send a nested dict `payload` in a request, you either have to use `json=payload` or `data=json.dumps(payload)`.",
"@martimlobao So basically, this is a request that I don't send. I receive it. We get this request from our banking partner and we send response body back to it based on the request body. Since, I was not able to send the correct response back because of missing data, I asked them how they are sending me the request and was told by the support team that they send it as data=data. \r\nI hope I could explain better but the issue here is I don't have any control over the request sending format and based on your comment it seems like, they need to send it properly. There is nothing that could be done on response side to handle it better.",
"@sahilnyati9 Ah, I see. With the way it is now, then there's no way for you to get the data since they're not actually sending it when doing `data=data`. You'll have to tell them to use `json=data` or `data=json.dumps(data)`, otherwise there's literally nothing you can do.",
"I think the user should be at least warned when the original dictionary gets modified.\r\nIdeally, this should raise an exception, but such a change will break a lot of existing projects."
] |
https://api.github.com/repos/psf/requests/issues/5057
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5057/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5057/comments
|
https://api.github.com/repos/psf/requests/issues/5057/events
|
https://github.com/psf/requests/issues/5057
| 433,829,858 |
MDU6SXNzdWU0MzM4Mjk4NTg=
| 5,057 |
why isn't Requests included natively with python?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/830306?v=4",
"events_url": "https://api.github.com/users/4evermaat/events{/privacy}",
"followers_url": "https://api.github.com/users/4evermaat/followers",
"following_url": "https://api.github.com/users/4evermaat/following{/other_user}",
"gists_url": "https://api.github.com/users/4evermaat/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/4evermaat",
"id": 830306,
"login": "4evermaat",
"node_id": "MDQ6VXNlcjgzMDMwNg==",
"organizations_url": "https://api.github.com/users/4evermaat/orgs",
"received_events_url": "https://api.github.com/users/4evermaat/received_events",
"repos_url": "https://api.github.com/users/4evermaat/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/4evermaat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/4evermaat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/4evermaat",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-04-16T15:00:09Z
|
2021-09-05T00:06:54Z
|
2019-04-19T22:49:53Z
|
NONE
|
resolved
|
I was curious with all of the heavy usage of `Requests` module, why isn't it just included as a standard python module? Why does the user have to install it?
What does python expect the user to use instead?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/830306?v=4",
"events_url": "https://api.github.com/users/4evermaat/events{/privacy}",
"followers_url": "https://api.github.com/users/4evermaat/followers",
"following_url": "https://api.github.com/users/4evermaat/following{/other_user}",
"gists_url": "https://api.github.com/users/4evermaat/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/4evermaat",
"id": 830306,
"login": "4evermaat",
"node_id": "MDQ6VXNlcjgzMDMwNg==",
"organizations_url": "https://api.github.com/users/4evermaat/orgs",
"received_events_url": "https://api.github.com/users/4evermaat/received_events",
"repos_url": "https://api.github.com/users/4evermaat/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/4evermaat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/4evermaat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/4evermaat",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5057/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5057/timeline
| null |
completed
| null | null | false |
[
"[urllib.request](https://docs.python.org/3/library/urllib.request.html#module-urllib.request) is in the stdlib. \r\n\r\nWhile you *can* use that instead of `requests`, many prefer `requests` interfaces to `urllib`.",
"Kenneth's original reasoning for this is \"The stdlib is where things go to die\". However, he did propose adding it to the stdlib [here](https://github.com/kennethreitz/requests/issues/2424)",
"\r\n\r\n\r\n> [urllib.request](https://docs.python.org/3/library/urllib.request.html#module-urllib.request) is in the stdlib.\r\n> \r\n> While you _can_ use that instead of `requests`, many prefer `requests` interfaces to `urllib`.\r\n\r\n> Kenneth's original reasoning for this is \"The stdlib is where things go to die\". However, he did propose adding it to the stdlib [here](https://github.com/kennethreitz/requests/issues/2424)\r\n\r\nOk. I understand more completely now. And it does make sense now. I didn't realize there was so much politics in getting a module included in the `stdlib` and the potential loss of control over updates/features.\r\n\r\n"
] |
https://api.github.com/repos/psf/requests/issues/5056
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5056/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5056/comments
|
https://api.github.com/repos/psf/requests/issues/5056/events
|
https://github.com/psf/requests/issues/5056
| 433,551,158 |
MDU6SXNzdWU0MzM1NTExNTg=
| 5,056 |
socks4 proxies break after use
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/30770221?v=4",
"events_url": "https://api.github.com/users/kelvinwop/events{/privacy}",
"followers_url": "https://api.github.com/users/kelvinwop/followers",
"following_url": "https://api.github.com/users/kelvinwop/following{/other_user}",
"gists_url": "https://api.github.com/users/kelvinwop/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kelvinwop",
"id": 30770221,
"login": "kelvinwop",
"node_id": "MDQ6VXNlcjMwNzcwMjIx",
"organizations_url": "https://api.github.com/users/kelvinwop/orgs",
"received_events_url": "https://api.github.com/users/kelvinwop/received_events",
"repos_url": "https://api.github.com/users/kelvinwop/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kelvinwop/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kelvinwop/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kelvinwop",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-16T02:09:16Z
|
2022-02-26T04:00:35Z
|
2021-11-28T03:22:54Z
|
NONE
|
resolved
|
Summary.
## Expected Result
Socks4 proxies work
## Actual Result

The ips through the proxy and public ip are the same
Also, this code:
```python
sess.proxies.update({"https": "socks9000://0.0.0.0"})
sess.get("https://icanhazip.com")
```
Usually throws an exception because socks9000 doesn't exist. But when this bug appears, this line no longer throws an exception.
## Reproduction Steps
The problem only appears when charles proxy is on so there's probably some interference there
```python
import requests
def test_proxy(proxy, throw_exc=False):
sess = requests.session()
proxy_dict = {"https": "socks4://{}".format(proxy)}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0'
}
sess.proxies.update(proxy_dict)
if config.get_config()["charles"]:
sess.verify = "cert.pem"
try:
r = sess.get('https://icanhazip.com/', headers=headers, timeout=15)
# read response.text to release worker back to pool
return r.text.strip()
except requests.exceptions.ConnectionError as ex:
if throw_exc:
raise ex
return False
except requests.exceptions.InvalidSchema:
print("ERROR! INSTALL PYSOCKS <pip install pysocks>!")
sys.exit(501)
except ProxyError as pe:
raise pe
except Exception as ex:
if throw_exc:
raise ex
return False
```
I'm not too sure what causes this either, but this code here eventually starts returning non-proxy ip address which is super weird and mysterious
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.6.1"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.2"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "1010102f",
"version": "19.0.0"
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "101000af"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": true
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"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/5056/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5056/timeline
| null |
completed
| null | null | false |
[
"Unfortunately we can't help debug your proxy, you'll have to try debugging this yourself or using Stackoverflow. Good luck."
] |
https://api.github.com/repos/psf/requests/issues/5055
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5055/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5055/comments
|
https://api.github.com/repos/psf/requests/issues/5055/events
|
https://github.com/psf/requests/issues/5055
| 432,362,669 |
MDU6SXNzdWU0MzIzNjI2Njk=
| 5,055 |
requests geting status_code is error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/27274462?v=4",
"events_url": "https://api.github.com/users/NeoZion/events{/privacy}",
"followers_url": "https://api.github.com/users/NeoZion/followers",
"following_url": "https://api.github.com/users/NeoZion/following{/other_user}",
"gists_url": "https://api.github.com/users/NeoZion/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/NeoZion",
"id": 27274462,
"login": "NeoZion",
"node_id": "MDQ6VXNlcjI3Mjc0NDYy",
"organizations_url": "https://api.github.com/users/NeoZion/orgs",
"received_events_url": "https://api.github.com/users/NeoZion/received_events",
"repos_url": "https://api.github.com/users/NeoZion/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/NeoZion/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/NeoZion/subscriptions",
"type": "User",
"url": "https://api.github.com/users/NeoZion",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-04-12T02:46:13Z
|
2021-09-02T00:07:18Z
|
2020-02-18T07:26:09Z
|
NONE
|
resolved
|
use requests.get('https://test.xiubi.com').status_code report web status_code '200'.
use 'wget' and 'curl' report web status_code '302'.
why requests report error status_code?
|
{
"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/5055/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5055/timeline
| null |
completed
| null | null | false |
[
"The site has a redirect header and \"requests\" will redirect automatically by default. If you use curl, you need to use the -L flag, then you'll get a 200 status code.\r\nE.g. curl -L https://test.xiubi.com",
"Can this be closed?"
] |
https://api.github.com/repos/psf/requests/issues/5054
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5054/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5054/comments
|
https://api.github.com/repos/psf/requests/issues/5054/events
|
https://github.com/psf/requests/pull/5054
| 431,962,019 |
MDExOlB1bGxSZXF1ZXN0MjY5NTI0MTc2
| 5,054 |
Add import statement to README example
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/155487?v=4",
"events_url": "https://api.github.com/users/imikay/events{/privacy}",
"followers_url": "https://api.github.com/users/imikay/followers",
"following_url": "https://api.github.com/users/imikay/following{/other_user}",
"gists_url": "https://api.github.com/users/imikay/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/imikay",
"id": 155487,
"login": "imikay",
"node_id": "MDQ6VXNlcjE1NTQ4Nw==",
"organizations_url": "https://api.github.com/users/imikay/orgs",
"received_events_url": "https://api.github.com/users/imikay/received_events",
"repos_url": "https://api.github.com/users/imikay/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/imikay/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/imikay/subscriptions",
"type": "User",
"url": "https://api.github.com/users/imikay",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-04-11T11:03:53Z
|
2021-08-31T00:07:10Z
|
2019-05-09T21:38:20Z
|
CONTRIBUTOR
|
resolved
|
Should add this import statement to make it more user friendly, especially for the beginners in Python.
|
{
"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": 1,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/5054/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5054/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5054.diff",
"html_url": "https://github.com/psf/requests/pull/5054",
"merged_at": "2019-05-09T21:38:20Z",
"patch_url": "https://github.com/psf/requests/pull/5054.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5054"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/5053
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5053/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5053/comments
|
https://api.github.com/repos/psf/requests/issues/5053/events
|
https://github.com/psf/requests/issues/5053
| 431,520,908 |
MDU6SXNzdWU0MzE1MjA5MDg=
| 5,053 |
Result from DuckDuckGo API becomes empty when only the letter case are changed
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2573537?v=4",
"events_url": "https://api.github.com/users/roniemartinez/events{/privacy}",
"followers_url": "https://api.github.com/users/roniemartinez/followers",
"following_url": "https://api.github.com/users/roniemartinez/following{/other_user}",
"gists_url": "https://api.github.com/users/roniemartinez/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/roniemartinez",
"id": 2573537,
"login": "roniemartinez",
"node_id": "MDQ6VXNlcjI1NzM1Mzc=",
"organizations_url": "https://api.github.com/users/roniemartinez/orgs",
"received_events_url": "https://api.github.com/users/roniemartinez/received_events",
"repos_url": "https://api.github.com/users/roniemartinez/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/roniemartinez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/roniemartinez/subscriptions",
"type": "User",
"url": "https://api.github.com/users/roniemartinez",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2019-04-10T14:00:13Z
|
2021-09-05T00:06:54Z
|
2019-04-12T01:33:08Z
|
NONE
|
resolved
|
Summary.
This request is successful and returns a JSON string:
```python
response = requests.get('https://api.duckduckgo.com/?q=My+ip&format=json&no_html=1&skip_disambig=1&no_redirect=1')
```
However, this requests does return only an empty response:
```python
response = requests.get('https://api.duckduckgo.com/?q=My+IP&format=json&no_html=1&skip_disambig=1&no_redirect=1')
```
The only difference is "My+ip" vs "My+IP". Both requests works on a browser (chrome and firefox). This could not be an issue with DDG since it's working thru other means.
## Expected Result
Response should not be empty.
## Actual Result
Empty response.
## Reproduction Steps
```python
import requests
response = requests.get('https://api.duckduckgo.com/?q=My+IP&format=json&no_html=1&skip_disambig=1&no_redirect=1')
response.json()
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.3"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "101000af"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2573537?v=4",
"events_url": "https://api.github.com/users/roniemartinez/events{/privacy}",
"followers_url": "https://api.github.com/users/roniemartinez/followers",
"following_url": "https://api.github.com/users/roniemartinez/following{/other_user}",
"gists_url": "https://api.github.com/users/roniemartinez/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/roniemartinez",
"id": 2573537,
"login": "roniemartinez",
"node_id": "MDQ6VXNlcjI1NzM1Mzc=",
"organizations_url": "https://api.github.com/users/roniemartinez/orgs",
"received_events_url": "https://api.github.com/users/roniemartinez/received_events",
"repos_url": "https://api.github.com/users/roniemartinez/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/roniemartinez/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/roniemartinez/subscriptions",
"type": "User",
"url": "https://api.github.com/users/roniemartinez",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5053/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5053/timeline
| null |
completed
| null | null | false |
[
"I don't think it is a problem with the requests library itself. I've tested this q=My+IP on several different http clients, including different languages, and I get an empty response body in all of them unless I do q=My+ip with the lowercase \"ip\". The only way I do not get an empty response body is if I try the url in a browser or with Postman. Not sure why that is, maybe it needs a certain header?",
"@bolivierjr \r\n\r\nIf it works with other tools like browsers (chrome, firefox, etc), Postman and cURL, it should also work with requests. But it doesn't! Possibly a bug in the requests library.\r\n\r\nWhen I used cURL with `-iv` option, there are no additional headers attached, so it could not be an issue with the headers.",
"@roniemartinez \r\n\r\nAh, I see that duckduckgo is using HTTP/2 and requests doesn't support HTTP/2. Not sure why the first url still works though, maybe someone can chime in. You can use an adapter from \"hyper\" module and requests sessions as a suggestion to make it work.\r\n\r\nHere is an example:\r\n\r\n### Installation:\r\n```\r\npip install hyper\r\n```\r\n\r\n### Usage:\r\n\r\n```python\r\nimport requests\r\nfrom hyper.contrib import HTTP20Adapter\r\n\r\nsession = requests.Session()\r\nsession.mount('https://', HTTP20Adapter())\r\nresponse = session.get('https://api.duckduckgo.com/?q=My+IP&format=json&no_html=1&skip_disambig=1&no_redirect=1')\r\nprint(response.json())\r\n```",
"Thanks @bolivierjr \r\n\r\nI was trying to verify too if HTTP/2 was the cause. I'm checking with cURL.\r\n\r\nSo far cURL chooses HTTP/2 in the backend and works. Response becomes empty when I add `--http1.1` parameter. Could really be a bug in duckduckgo API since both protocols are offered:\r\n\r\n```\r\n* ALPN, offering h2\r\n* ALPN, offering http/1.1\r\n```\r\n\r\nPS: HTTP20Adapter worked. Thanks a lot!"
] |
https://api.github.com/repos/psf/requests/issues/5052
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5052/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5052/comments
|
https://api.github.com/repos/psf/requests/issues/5052/events
|
https://github.com/psf/requests/issues/5052
| 431,334,183 |
MDU6SXNzdWU0MzEzMzQxODM=
| 5,052 |
Requests fails to get a particular resource in python2, but not urllib
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2804645?v=4",
"events_url": "https://api.github.com/users/hydrargyrum/events{/privacy}",
"followers_url": "https://api.github.com/users/hydrargyrum/followers",
"following_url": "https://api.github.com/users/hydrargyrum/following{/other_user}",
"gists_url": "https://api.github.com/users/hydrargyrum/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hydrargyrum",
"id": 2804645,
"login": "hydrargyrum",
"node_id": "MDQ6VXNlcjI4MDQ2NDU=",
"organizations_url": "https://api.github.com/users/hydrargyrum/orgs",
"received_events_url": "https://api.github.com/users/hydrargyrum/received_events",
"repos_url": "https://api.github.com/users/hydrargyrum/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hydrargyrum/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hydrargyrum/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hydrargyrum",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2019-04-10T06:56:22Z
|
2021-08-29T00:06:48Z
|
2020-10-01T19:55:23Z
|
NONE
|
resolved
|
I am trying to obtain a resource with requests, it timeouts in python2, but succeeds in python3. Using urllib2/urllib, it works fine.
## Expected Result
No particular problem in python2, it's just a GET.
## Actual Result
It never finishes in python2.
## Reproduction Steps
```python
import re
import sys
import requests
import six
USE_REQUESTS = False
def do_get(url):
if USE_REQUESTS:
headers = {
'User-Agent': 'Mozilla',
}
return requests.get(url, headers=headers).content
if six.PY2:
import urllib2 as urlmodule
else:
import urllib.request as urlmodule
req = urlmodule.Request(url)
req.add_header('User-Agent', 'Mozilla')
return urlmodule.urlopen(req).read()
def run():
path = re.search(
r'"(dciweb.png[^"]+)"',
do_get('https://reunion.bnpparibas.net/part/fr/dciweb.htm?p0=idesai.tht&t=p').decode('iso8859-1')
).group(1)
path = path.replace('amp;', '')
do_get('https://reunion.bnpparibas.net/part/fr/' + path)
if sys.argv[1:2] == ['-r']:
USE_REQUESTS = True
run()
print('OK')
```
(Pass `-r` to use `requests`, else `urllib2/urllib`)
* Run these 4 different ways
```
python3 req.py # prints OK
python2 req.py # prints OK
python3 req.py -r # prints OK
python2 req.py -r # does not work!
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.6.1"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.16"
},
"platform": {
"release": "4.18.0-2-amd64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010102f",
"version": "19.0.0"
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010102f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5052/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5052/timeline
| null |
completed
| null | null | false |
[
"This should probably be closed since Python 2.x is now end-of-life.",
"@tommorris Requests still supports Python 2. That said, there are extra circumstances here including \"which request is failing or where is this stuck?\" I could easily see that `str.replace` and a greedy regular expression could prevent something from terminating here. There's no evidence in the report that this is strictly requests.\r\n\r\nOver a year later, and I expect this person figured their problem out. Probably with the help of StackOverflow which was the right place to post this in the first place.",
"@sigmavirus24 @tommorris \r\n\r\n> Over a year later, and I expect this person figured their problem out. Probably with the help of StackOverflow which was the right place to post this in the first place.\r\n\r\nNo, the problem is still here. requests still has a bug, and requests' code didn't fix itself magically.\r\n\r\nHowever, I moved on, that's right. Given the lack of responsiveness here, I gave up waiting for a hypothetical fix that would never come, I ended up using urllib2 for accessing that site rather than requests, since requests is just buggy here, as demonstrated.",
"> However, I moved on, that's right. Given the lack of responsiveness here, I gave up waiting for a hypothetical fix that would never come, I ended up using urllib2 for accessing that site rather than requests, since requests is just buggy here, as demonstrated.\r\n\r\nYou haven't actually proven this is a bug in Requests. Also, mature projects don't need to be immediately responsive. And on top of that, I just became involved again in this project, so taking your anger out here is inappropriate",
"> You haven't actually proven this is a bug in Requests.\r\n\r\nHow can I know if it comes from requests or the lower layers? I observe a consistent behavior so it doesn't come from elsewhere than the requests stack. I can't investigate deeper, that's why I'm reporting the bug. If I already knew where the bug came from, I wouldn't report something waiting forever, I would just patch it myself.\r\n\r\nYou're the requests developer, not me. It makes no sense to ask me to find out if it's requests or lower that fails. Users are expected to report bugs to the layer they can. Users are not expected to investigate all the code until the OS, else they wouldn't be users.\r\n\r\n> And on top of that, I just became involved again in this project, so taking your anger out here is inappropriate\r\n\r\nIt's not my first awful experience with the requests developers. Every single bug I've reported to this project has been welcomed with the same level of inappropriateness as this one, something like \"meh, we don't want to look at it\" or \"meh, it's too hard to fix, so we'll just keep the bug\" or \"meh, we don't need to respect RFCs\".\r\nSo I guess there's some sort of culture of doing the least possible in the whole project.",
"> You're the requests developer, not me. It makes no sense to ask me to find out if it's requests or lower that fails. Users are expected to report bugs to the layer they can. Users are not expected to investigate all the code until the OS, else they wouldn't be users.\r\n\r\nServers respond differently to urllib2 and requests meaning that the response in Python 2 for the first request could lead your greedy and inefficient Regular expression to \"never\" complete. Cancelling this and showing a stack trace within requests is a step towards saying this is happening, or changing your code to include more debugging. There's plenty you can do to show \"this stops in requests\".\r\n\r\n> Every single bug I've reported to this project has been welcomed with the same level of inappropriateness as this one\r\n\r\nIf you feel I've been inappropriate, please report me to the PSF for a Code of Conduct violation. I'll look for your other [issues](https://github.com/psf/requests/issues?q=is%3Aissue+author%3Ahydrargyrum+), but somehow, I doubt you were given those responses. Regardless, this thread isn't productive, so I'm walking away"
] |
https://api.github.com/repos/psf/requests/issues/5051
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5051/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5051/comments
|
https://api.github.com/repos/psf/requests/issues/5051/events
|
https://github.com/psf/requests/issues/5051
| 431,076,162 |
MDU6SXNzdWU0MzEwNzYxNjI=
| 5,051 |
Connection broken IncompletedRead
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/35482019?v=4",
"events_url": "https://api.github.com/users/pyliangbo/events{/privacy}",
"followers_url": "https://api.github.com/users/pyliangbo/followers",
"following_url": "https://api.github.com/users/pyliangbo/following{/other_user}",
"gists_url": "https://api.github.com/users/pyliangbo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pyliangbo",
"id": 35482019,
"login": "pyliangbo",
"node_id": "MDQ6VXNlcjM1NDgyMDE5",
"organizations_url": "https://api.github.com/users/pyliangbo/orgs",
"received_events_url": "https://api.github.com/users/pyliangbo/received_events",
"repos_url": "https://api.github.com/users/pyliangbo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pyliangbo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pyliangbo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pyliangbo",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2019-04-09T16:57:51Z
|
2021-11-05T03:00:30Z
|
2021-08-07T02:18:20Z
|
NONE
|
resolved
|
I'm crawling some websites. But I met a problem that makes me very depressed.
The error:
('Connection broken: IncompleteRead(2048 bytes read)', IncompleteRead(2048 bytes read))
The code: html=requests.post(url,data=json.dumps(payload),headers=headers,verify=False)
I have never met this problem before. Just one day, it came out.
I'm looking forward to your help.
|
{
"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/5051/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5051/timeline
| null |
completed
| null | null | false |
[
"It will be better if you can provide more info about this error.\r\nWhat websites you are crawling?\r\nDoes it appear every time?\r\nthe Version of requests & python?\r\n\r\nOr straightforwardly, could you provide a script that would recur this error?",
"> It will be better if you can provide more info about this error.\r\n> What websites you are crawling?\r\n> Does it appear every time?\r\n> the Version of requests & python?\r\n> Or straightforwardly, could you provide a script that would recur this error?\r\n\r\nThanks for your response!\r\nI'm use the multiprocessing module and the proxies to crawler the websites.\r\nHere is the code.\r\n`html=requests.post(url,data=json.dumps(payload),headers=headers,verify=False,proxies=proxies)`\r\nHere is the snapshot of the error. Unluckily, this error happens frequently, but not always.\r\n<img width=\"770\" alt=\"微信图片_20190412215135\" src=\"https://user-images.githubusercontent.com/35482019/56042228-2c720880-5d6d-11e9-92a6-4ced472f5524.png\">\r\n\r\nIn the processes, some works well, but some reports this error. \r\n\r\n\r\n\r\n\r\n\r\n",
"The version of python : 3.7.1\r\nThe version of requests: 2.21.0",
"The issue you're hitting here @pyliangbo is that the server is failing to send the full payload before closing the connection. You'll need to handle this excption case if crawling arbitrary websites."
] |
https://api.github.com/repos/psf/requests/issues/5050
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5050/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5050/comments
|
https://api.github.com/repos/psf/requests/issues/5050/events
|
https://github.com/psf/requests/issues/5050
| 430,893,945 |
MDU6SXNzdWU0MzA4OTM5NDU=
| 5,050 |
Error: Content is not allowed in prolog.. ParseError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40767571?v=4",
"events_url": "https://api.github.com/users/dafegit/events{/privacy}",
"followers_url": "https://api.github.com/users/dafegit/followers",
"following_url": "https://api.github.com/users/dafegit/following{/other_user}",
"gists_url": "https://api.github.com/users/dafegit/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dafegit",
"id": 40767571,
"login": "dafegit",
"node_id": "MDQ6VXNlcjQwNzY3NTcx",
"organizations_url": "https://api.github.com/users/dafegit/orgs",
"received_events_url": "https://api.github.com/users/dafegit/received_events",
"repos_url": "https://api.github.com/users/dafegit/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dafegit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dafegit/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dafegit",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-04-09T10:35:43Z
|
2021-09-05T00:06:55Z
|
2019-04-10T13:34:10Z
|
NONE
|
resolved
|
Hi,
Basically if I run a command curl:
`curl -k -u user:pass --header 'Content-Type: application/xml' --request POST --data '<LocalIDs><LocalID ID="9128615"/></LocalIDs>' --url https://rhtpcapc001:8182/pc/center/webservice/datasources/dataSourceConsoleName/Data%20Aggregator%40RHTPCADA201/itemids`
I have the following answer:
`<?xml version="1.0" encoding="UTF-8"?><ItemIDResults><ItemIDResult LocalID="9528017" ItemID="828570"/></ItemIDResults>`
I made a script in python to run this command:
#!/usr/bin/python
import requests
import urllib3
urllib3.disable_warnings()
headers = {
'Content-Type': 'application/xml',
}
data = {
'<LocalIDs><LocalID ID': '"9528017"/></LocalIDs>'
}
response = requests.post('https://rhtpcapc001:8182/pc/center/webservice/datasources/dataSourceConsoleName/Data%20Aggregator%40RHTPCADA201/itemids', headers=headers, data=data, verify=False, auth=('user', 'pass'))
print (response.encoding)
print (response.headers['Content-Type'])
print (response.headers)
print (response.text)
print (response.content)
print (response.reason)
and gives me the following error:
ISO-8859-1
text/plain
{'Set-Cookie': 'JSESSIONID=md1waumsuoe81jceaxacbqgid;Path=/pc;Secure', 'Expires': 'Thu, 01 Jan 1970 00:00:00 GMT', 'Content-Type': 'text/plain', 'Date': 'Tue, 09 Apr 2019 10:28:54 GMT', 'Content-Length': '173', 'Server': 'Jetty(9.3.5.v20151012)'}
JAXBException occurred : ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.. ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog..
b'JAXBException occurred : ParseError at [row,col]:[1,1]\nMessage: Content is not allowed in prolog.. ParseError at [row,col]:[1,1]\nMessage: Content is not allowed in prolog.. '
Bad Request
I think the problem is the encoding. When I run only the command curl:
COMMAND:
`curl -k -u user:pass --header 'Content-Type: application/xml' --request POST --data '<LocalIDs><LocalID ID="9128615"/></LocalIDs>' --url https://rhtpcapc001:8182/pc/center/webservice/datasources/dataSourceConsoleName/Data%20Aggregator%40RHTPCADA201/itemids`
OUTPUT:
`<?xml version="1.0" encoding="UTF-8"?><ItemIDResults><ItemIDResult LocalID="9528017" ItemID="828570"/></ItemIDResults>`
in the answer we see encoding ="UTF-8"
in the python script with the response.encoding I see the encoding ISO-8859-1
thank you in advance for all the help.
BR
David
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40767571?v=4",
"events_url": "https://api.github.com/users/dafegit/events{/privacy}",
"followers_url": "https://api.github.com/users/dafegit/followers",
"following_url": "https://api.github.com/users/dafegit/following{/other_user}",
"gists_url": "https://api.github.com/users/dafegit/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dafegit",
"id": 40767571,
"login": "dafegit",
"node_id": "MDQ6VXNlcjQwNzY3NTcx",
"organizations_url": "https://api.github.com/users/dafegit/orgs",
"received_events_url": "https://api.github.com/users/dafegit/received_events",
"repos_url": "https://api.github.com/users/dafegit/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dafegit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dafegit/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dafegit",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5050/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5050/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/5049
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5049/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5049/comments
|
https://api.github.com/repos/psf/requests/issues/5049/events
|
https://github.com/psf/requests/pull/5049
| 430,538,287 |
MDExOlB1bGxSZXF1ZXN0MjY4NDA0MjQz
| 5,049 |
Support pytest 4
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2401856?v=4",
"events_url": "https://api.github.com/users/hroncok/events{/privacy}",
"followers_url": "https://api.github.com/users/hroncok/followers",
"following_url": "https://api.github.com/users/hroncok/following{/other_user}",
"gists_url": "https://api.github.com/users/hroncok/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hroncok",
"id": 2401856,
"login": "hroncok",
"node_id": "MDQ6VXNlcjI0MDE4NTY=",
"organizations_url": "https://api.github.com/users/hroncok/orgs",
"received_events_url": "https://api.github.com/users/hroncok/received_events",
"repos_url": "https://api.github.com/users/hroncok/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hroncok/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hroncok/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hroncok",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-04-08T16:12:59Z
|
2021-08-31T00:07:06Z
|
2019-08-20T04:12:59Z
|
CONTRIBUTOR
|
resolved
|
Fixes https://github.com/kennethreitz/requests/issues/5048
See https://docs.pytest.org/en/latest/deprecations.html#marks-in-pytest-mark-parametrize
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/5049/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5049/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5049.diff",
"html_url": "https://github.com/psf/requests/pull/5049",
"merged_at": "2019-08-20T04:12:59Z",
"patch_url": "https://github.com/psf/requests/pull/5049.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5049"
}
| true |
[
"Not sure about the CI here, it seems to be failing on master as well.\r\nI've also tried to update the Pipfile.lock, but I have no idea how to do it properly without regenerating the entire Pipfile.lock. Tried some magic.",
"> Fix some issues to improve adherence to best practices\r\n\r\nFacepalm, not the and not there wrote. Sorry.\r\n",
"I've dropped the pipfile changes, they conflicted."
] |
https://api.github.com/repos/psf/requests/issues/5048
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5048/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5048/comments
|
https://api.github.com/repos/psf/requests/issues/5048/events
|
https://github.com/psf/requests/issues/5048
| 430,500,258 |
MDU6SXNzdWU0MzA1MDAyNTg=
| 5,048 |
Test failures with pytest 4
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2401856?v=4",
"events_url": "https://api.github.com/users/hroncok/events{/privacy}",
"followers_url": "https://api.github.com/users/hroncok/followers",
"following_url": "https://api.github.com/users/hroncok/following{/other_user}",
"gists_url": "https://api.github.com/users/hroncok/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hroncok",
"id": 2401856,
"login": "hroncok",
"node_id": "MDQ6VXNlcjI0MDE4NTY=",
"organizations_url": "https://api.github.com/users/hroncok/orgs",
"received_events_url": "https://api.github.com/users/hroncok/received_events",
"repos_url": "https://api.github.com/users/hroncok/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hroncok/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hroncok/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hroncok",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-08T14:59:03Z
|
2021-09-04T00:06:20Z
|
2019-08-20T04:12:59Z
|
CONTRIBUTOR
|
resolved
|
The tests are failing with pytest 4. The reason is https://docs.pytest.org/en/latest/deprecations.html#marks-in-pytest-mark-parametrize
Run `tox -re py37` to reproduce.
## Expected Result
Tests collect and pass.
## Actual Result
Tests fail to collect:
```
platform linux -- Python 3.7.3, pytest-4.4.0, py-1.8.0, pluggy-0.9.0
...
ERROR collecting tests/test_utils.py
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/hooks.py:289: in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/manager.py:68: in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/manager.py:62: in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
.eggs/pytest-4.4.0-py3.7.egg/_pytest/python.py:238: in pytest_pycollect_makeitem
res = list(collector._genfunctions(name, obj))
.eggs/pytest-4.4.0-py3.7.egg/_pytest/python.py:414: in _genfunctions
self.ihook.pytest_generate_tests(metafunc=metafunc)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/hooks.py:289: in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/manager.py:68: in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
.eggs/pluggy-0.9.0-py3.7.egg/pluggy/manager.py:62: in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
.eggs/pytest-4.4.0-py3.7.egg/_pytest/python.py:141: in pytest_generate_tests
metafunc.parametrize(*marker.args, **marker.kwargs)
.eggs/pytest-4.4.0-py3.7.egg/_pytest/python.py:1006: in parametrize
function_definition=self.definition,
.eggs/pytest-4.4.0-py3.7.egg/_pytest/mark/structures.py:113: in _for_parametrize
if len(param.values) != len(argnames):
E TypeError: object of type 'MarkDecorator' has no len()
```
## Reproduction Steps
```console
$ tox -re py37
```
## System Information
```console
$ .tox/py37/bin/python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.3"
},
"platform": {
"release": "5.0.5-300.fc30.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010102f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5048/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5048/timeline
| null |
completed
| null | null | false |
[
"I suppose https://github.com/kennethreitz/requests/blob/9742da7f91f595796a412a8150aacc00191be039/tests/test_utils.py#L36\r\n\r\nWill try to craft a PR."
] |
https://api.github.com/repos/psf/requests/issues/5047
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5047/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5047/comments
|
https://api.github.com/repos/psf/requests/issues/5047/events
|
https://github.com/psf/requests/pull/5047
| 430,336,675 |
MDExOlB1bGxSZXF1ZXN0MjY4MjQ1NDAz
| 5,047 |
fix dependency resolution conflict and CI/CD
|
{
"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 | 2 |
2019-04-08T09:06:58Z
|
2021-08-31T00:07:11Z
|
2019-06-27T05:53:27Z
|
CONTRIBUTOR
|
resolved
|
Removes the call to <4.1 pytest. Pytest 4.4 was released this week breaking CI/CD
Rebuild graph and Pipfile.lock.
Also removed `detox` as it's now built into tox :-)
|
{
"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"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5047/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5047/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5047.diff",
"html_url": "https://github.com/psf/requests/pull/5047",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5047.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5047"
}
| true |
[
"I underestimated this fix! Python 2 failing because of a dependency on pathlib2 from Pytest.. \r\nPython3 failing because 1 of the tests depends on an old API",
"oh man :("
] |
https://api.github.com/repos/psf/requests/issues/5045
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5045/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5045/comments
|
https://api.github.com/repos/psf/requests/issues/5045/events
|
https://github.com/psf/requests/pull/5045
| 430,109,021 |
MDExOlB1bGxSZXF1ZXN0MjY4MDgzODQ0
| 5,045 |
Updated copyright year and description
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/29166153?v=4",
"events_url": "https://api.github.com/users/cquark7/events{/privacy}",
"followers_url": "https://api.github.com/users/cquark7/followers",
"following_url": "https://api.github.com/users/cquark7/following{/other_user}",
"gists_url": "https://api.github.com/users/cquark7/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cquark7",
"id": 29166153,
"login": "cquark7",
"node_id": "MDQ6VXNlcjI5MTY2MTUz",
"organizations_url": "https://api.github.com/users/cquark7/orgs",
"received_events_url": "https://api.github.com/users/cquark7/received_events",
"repos_url": "https://api.github.com/users/cquark7/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cquark7/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cquark7/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cquark7",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-04-07T06:03:32Z
|
2021-08-31T00:07:17Z
|
2019-04-27T13:13:17Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5045/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5045/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5045.diff",
"html_url": "https://github.com/psf/requests/pull/5045",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5045.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5045"
}
| true |
[] |
|
https://api.github.com/repos/psf/requests/issues/5044
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5044/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5044/comments
|
https://api.github.com/repos/psf/requests/issues/5044/events
|
https://github.com/psf/requests/pull/5044
| 430,036,425 |
MDExOlB1bGxSZXF1ZXN0MjY4MDM3MzUx
| 5,044 |
Add request hook
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1834516?v=4",
"events_url": "https://api.github.com/users/Holzhaus/events{/privacy}",
"followers_url": "https://api.github.com/users/Holzhaus/followers",
"following_url": "https://api.github.com/users/Holzhaus/following{/other_user}",
"gists_url": "https://api.github.com/users/Holzhaus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Holzhaus",
"id": 1834516,
"login": "Holzhaus",
"node_id": "MDQ6VXNlcjE4MzQ1MTY=",
"organizations_url": "https://api.github.com/users/Holzhaus/orgs",
"received_events_url": "https://api.github.com/users/Holzhaus/received_events",
"repos_url": "https://api.github.com/users/Holzhaus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Holzhaus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Holzhaus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Holzhaus",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-04-06T13:59:18Z
|
2021-08-30T00:06:51Z
|
2019-08-20T04:17:31Z
|
NONE
|
resolved
|
Add a request hook that fires when a request is sent. This resolves kennethreitz/requests#5037.
|
{
"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/5044/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5044/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5044.diff",
"html_url": "https://github.com/psf/requests/pull/5044",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5044.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5044"
}
| true |
[
"@Holzhaus I remember the hooks were removed in some old commit https://github.com/kennethreitz/requests/commit/ee6c638e9cfdbdf39b9e499d95c353460365f42c#diff-ab3246c102b4e3c7381cf4d1ea4b2bea for a reason, I don't know why though.",
"Seems like there was a conflict and the fix did not make it into the branch.\r\nA similar issue ( #5037 ) states that it is fixed by this merge - but unfortunately does not seem to be in because of that conflict.\r\nWould be great if this could be fixed. Any ETA ?",
"the current hook we have is the only necessary one, i determined. hence, the other ones were removed during the big refactor."
] |
https://api.github.com/repos/psf/requests/issues/5043
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5043/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5043/comments
|
https://api.github.com/repos/psf/requests/issues/5043/events
|
https://github.com/psf/requests/pull/5043
| 430,032,715 |
MDExOlB1bGxSZXF1ZXN0MjY4MDM1MDQx
| 5,043 |
Incorporating a `__main__.py` file into request ?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/322018?v=4",
"events_url": "https://api.github.com/users/Carelvd/events{/privacy}",
"followers_url": "https://api.github.com/users/Carelvd/followers",
"following_url": "https://api.github.com/users/Carelvd/following{/other_user}",
"gists_url": "https://api.github.com/users/Carelvd/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Carelvd",
"id": 322018,
"login": "Carelvd",
"node_id": "MDQ6VXNlcjMyMjAxOA==",
"organizations_url": "https://api.github.com/users/Carelvd/orgs",
"received_events_url": "https://api.github.com/users/Carelvd/received_events",
"repos_url": "https://api.github.com/users/Carelvd/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Carelvd/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Carelvd/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Carelvd",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-06T13:14:53Z
|
2021-08-30T00:06:51Z
|
2019-08-20T04:18:27Z
|
NONE
|
resolved
|
Python supports the inclusion of a `__main__.py` file withing ones packages. I though it might be nice to include such a file within requests to handle the more common tasks from the command line e.g. `GET`, `HEAD`, `PUT` and `POST`. I have included an example for both `HEAD` and `GET` though I'm not certain of their utility.
More often then not it is necessary to download a file from a given url and I have added a `download` option to assist with that as well.
|
{
"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/5043/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5043/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5043.diff",
"html_url": "https://github.com/psf/requests/pull/5043",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5043.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5043"
}
| true |
[
"send this to the kennethreitz/requests3 repo!"
] |
https://api.github.com/repos/psf/requests/issues/5042
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5042/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5042/comments
|
https://api.github.com/repos/psf/requests/issues/5042/events
|
https://github.com/psf/requests/issues/5042
| 429,981,872 |
MDU6SXNzdWU0Mjk5ODE4NzI=
| 5,042 |
Requests returns an error on Google App Engine when upgrading from requests==2.10.0 to the latest versions
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/934795?v=4",
"events_url": "https://api.github.com/users/interpegasus/events{/privacy}",
"followers_url": "https://api.github.com/users/interpegasus/followers",
"following_url": "https://api.github.com/users/interpegasus/following{/other_user}",
"gists_url": "https://api.github.com/users/interpegasus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/interpegasus",
"id": 934795,
"login": "interpegasus",
"node_id": "MDQ6VXNlcjkzNDc5NQ==",
"organizations_url": "https://api.github.com/users/interpegasus/orgs",
"received_events_url": "https://api.github.com/users/interpegasus/received_events",
"repos_url": "https://api.github.com/users/interpegasus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/interpegasus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/interpegasus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/interpegasus",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-04-06T01:14:00Z
|
2022-02-26T06:00:25Z
|
2021-11-28T05:24:50Z
|
NONE
|
resolved
|
Hi, My app works fine with version 2.10.0, when connecting to flickr API, however, when upgrading to the latest version of requests, google app engine returns the error below. Any help will be appreciated on how to use the latest version of this library on Google app engine. Thanks.
`ConnectionError: HTTPSConnectionPool(host='api.flickr.com', port=443): Max retries exceeded with url: /services/rest/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x2a63f8ef7d50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))`
## Expected Result
The process should complete succesfully as in version 2.10.0
## Actual Result
```
Internal Server Error: /api/queuetask/flickr (/base/data/home/apps/s~pegasus7/20190405t190338.417285350479019321/sitepackages/prod/django/core/handlers/exception.py:135)
Traceback (most recent call last):
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/backend/views.py", line 206, in task_sync_flickr
SyncData.flickr()
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/backend/utils/sync_data.py", line 756, in flickr
user = flickr_api.test.login()
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/flickr_api/reflection.py", line 294, in static_call
r = method_call.call_api(method=flickr_method, **method_args)
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/flickr_api/method_call.py", line 124, in call_api
resp = requests.post(request_url, args)
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/base/data/home/apps/s~arturopegasus7/20190405t190338.417285350479019321/sitepackages/prod/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='api.flickr.com', port=443): Max retries exceeded with url: /services/rest/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x2a90be9751d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
```
## Reproduction Steps
```python
import flickr_api
import requests
import requests_toolbelt.adapters.appengine
flickr_api.set_keys(api_key=FLICKR_KEY, api_secret=FLICKR_SEC)
flickr_api.set_auth_handler('./backend/utils/flickr_verifier')
time.sleep(1)
user = flickr_api.test.login()
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "2.7.15"
},
"platform": {
"release": "18.5.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1000210f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
|
{
"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/5042/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5042/timeline
| null |
completed
| null | null | false |
[
"what's the underlying requests call that you are making ? Exact code would help",
"From the error message I don't think there's anything urllib3 or Requests can do here. DNS is failing, we're not in control of that sort of issue. Closing this as not a defect in Requests."
] |
https://api.github.com/repos/psf/requests/issues/5040
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5040/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5040/comments
|
https://api.github.com/repos/psf/requests/issues/5040/events
|
https://github.com/psf/requests/issues/5040
| 428,518,544 |
MDU6SXNzdWU0Mjg1MTg1NDQ=
| 5,040 |
unclosed socket
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/49217246?v=4",
"events_url": "https://api.github.com/users/jemdad/events{/privacy}",
"followers_url": "https://api.github.com/users/jemdad/followers",
"following_url": "https://api.github.com/users/jemdad/following{/other_user}",
"gists_url": "https://api.github.com/users/jemdad/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jemdad",
"id": 49217246,
"login": "jemdad",
"node_id": "MDQ6VXNlcjQ5MjE3MjQ2",
"organizations_url": "https://api.github.com/users/jemdad/orgs",
"received_events_url": "https://api.github.com/users/jemdad/received_events",
"repos_url": "https://api.github.com/users/jemdad/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jemdad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jemdad/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jemdad",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-04-03T01:26:52Z
|
2021-09-02T00:07:18Z
|
2020-02-18T07:28:09Z
|
NONE
|
resolved
|
I am noticing this “warning” which making soap calls at high speed.
zeep/xsd/visitor.py:883: ResourceWarning: unclosed <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=(‘x.x.x.x’, 39092), raddr=('y.y.y.y', 9001)>
zeep/xsd/types/complex.py:159: ResourceWarning: unclosed <socket.socket
There is an explanation on requests library thread at: https://github.com/kennethreitz/requests/issues/3912
Is it something that can be handled at zeep?
Thanks
|
{
"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/5040/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5040/timeline
| null |
completed
| null | null | false |
[
"The stacktrace provided doesn't appear to be related to Requests. You may need to follow up with zeep."
] |
https://api.github.com/repos/psf/requests/issues/5039
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5039/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5039/comments
|
https://api.github.com/repos/psf/requests/issues/5039/events
|
https://github.com/psf/requests/issues/5039
| 427,972,884 |
MDU6SXNzdWU0Mjc5NzI4ODQ=
| 5,039 |
Handling pound sign (#) within custom URL
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/38818775?v=4",
"events_url": "https://api.github.com/users/chisox721/events{/privacy}",
"followers_url": "https://api.github.com/users/chisox721/followers",
"following_url": "https://api.github.com/users/chisox721/following{/other_user}",
"gists_url": "https://api.github.com/users/chisox721/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chisox721",
"id": 38818775,
"login": "chisox721",
"node_id": "MDQ6VXNlcjM4ODE4Nzc1",
"organizations_url": "https://api.github.com/users/chisox721/orgs",
"received_events_url": "https://api.github.com/users/chisox721/received_events",
"repos_url": "https://api.github.com/users/chisox721/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chisox721/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chisox721/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chisox721",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-04-02T00:48:35Z
|
2021-09-05T00:06:55Z
|
2019-04-02T23:43:13Z
|
NONE
|
resolved
|
I'm using requests to compile a custom URL and one parameter includes a pound sign. Can anyone explain how to pass the parameter without the pound sign changing to "%23"?
download URL: www.example.com/type=#results
currently returns: www.example.com/type=%23results
FWIW, this process works without using params within requests. I know it's weird having a pound sign in a URL but after multiple tests I've concluded that the only way of downoading the file I need is to include the pound sign.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/38818775?v=4",
"events_url": "https://api.github.com/users/chisox721/events{/privacy}",
"followers_url": "https://api.github.com/users/chisox721/followers",
"following_url": "https://api.github.com/users/chisox721/following{/other_user}",
"gists_url": "https://api.github.com/users/chisox721/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chisox721",
"id": 38818775,
"login": "chisox721",
"node_id": "MDQ6VXNlcjM4ODE4Nzc1",
"organizations_url": "https://api.github.com/users/chisox721/orgs",
"received_events_url": "https://api.github.com/users/chisox721/received_events",
"repos_url": "https://api.github.com/users/chisox721/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chisox721/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chisox721/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chisox721",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5039/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5039/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/5038
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5038/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5038/comments
|
https://api.github.com/repos/psf/requests/issues/5038/events
|
https://github.com/psf/requests/pull/5038
| 426,930,851 |
MDExOlB1bGxSZXF1ZXN0MjY1NjcxMTYx
| 5,038 |
Support the new QUESADILLA request of HTTP/3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240616?v=4",
"events_url": "https://api.github.com/users/makimat/events{/privacy}",
"followers_url": "https://api.github.com/users/makimat/followers",
"following_url": "https://api.github.com/users/makimat/following{/other_user}",
"gists_url": "https://api.github.com/users/makimat/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/makimat",
"id": 240616,
"login": "makimat",
"node_id": "MDQ6VXNlcjI0MDYxNg==",
"organizations_url": "https://api.github.com/users/makimat/orgs",
"received_events_url": "https://api.github.com/users/makimat/received_events",
"repos_url": "https://api.github.com/users/makimat/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/makimat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/makimat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/makimat",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-03-29T10:58:21Z
|
2021-08-31T00:07:22Z
|
2019-03-29T10:58:28Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240616?v=4",
"events_url": "https://api.github.com/users/makimat/events{/privacy}",
"followers_url": "https://api.github.com/users/makimat/followers",
"following_url": "https://api.github.com/users/makimat/following{/other_user}",
"gists_url": "https://api.github.com/users/makimat/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/makimat",
"id": 240616,
"login": "makimat",
"node_id": "MDQ6VXNlcjI0MDYxNg==",
"organizations_url": "https://api.github.com/users/makimat/orgs",
"received_events_url": "https://api.github.com/users/makimat/received_events",
"repos_url": "https://api.github.com/users/makimat/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/makimat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/makimat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/makimat",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5038/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5038/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5038.diff",
"html_url": "https://github.com/psf/requests/pull/5038",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5038.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5038"
}
| true |
[
"Sorry about this, meant to open it for my own fork for testing purposes 🙈\r\n\r\nLet me know though if you'd support me in getting this new method to the next HTTP spec 😐 "
] |
|
https://api.github.com/repos/psf/requests/issues/5037
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5037/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5037/comments
|
https://api.github.com/repos/psf/requests/issues/5037/events
|
https://github.com/psf/requests/issues/5037
| 426,347,341 |
MDU6SXNzdWU0MjYzNDczNDE=
| 5,037 |
Add request event hook
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1172317?v=4",
"events_url": "https://api.github.com/users/navyad/events{/privacy}",
"followers_url": "https://api.github.com/users/navyad/followers",
"following_url": "https://api.github.com/users/navyad/following{/other_user}",
"gists_url": "https://api.github.com/users/navyad/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/navyad",
"id": 1172317,
"login": "navyad",
"node_id": "MDQ6VXNlcjExNzIzMTc=",
"organizations_url": "https://api.github.com/users/navyad/orgs",
"received_events_url": "https://api.github.com/users/navyad/received_events",
"repos_url": "https://api.github.com/users/navyad/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/navyad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/navyad/subscriptions",
"type": "User",
"url": "https://api.github.com/users/navyad",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 7 |
2019-03-28T07:53:56Z
|
2021-08-28T11:50:35Z
| null |
NONE
| null |
There was a scenario where I need to intercept the request and was searching for if there is some way can that be done, then I found the event hook but only `response` event hook is supported.
I hope adding `request` hook can be useful, if yes I would like to implement that.
Any pointers or suggestion appreciated.
Thanks
| null |
{
"+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/5037/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5037/timeline
| null | null | null | null | false |
[
"Can you tell what exactly you mean by request hook ? What does intercepting a request mean ? It sounds like you want to do something after request has been made - for which you can use response hook",
"I need the same thing. A hook that retrieves the `Request` or `PreparedRequest` object in the moment when it is sent (without waiting for the response).",
"I implemented the hook in PR #5044.",
"What a bummer that PR #5044 was closed.. I'd love to have the request hook as well.\r\nMy scenario is that for some tests I need to manipulate the headers right before the request (after business logic is done in the REST client).",
"@joaonc is there a reason you can’t use the PreparedRequests workflow for this use case?",
"I guess there are several ways to skin this cat. I have a business layer where the REST clients to our web services are defined (ex `AccountService` has a `get_account(account_id)` method) and those clients handle urls for different environments, logging, headers (we have some headers that require business logic), etc.\r\n\r\nIn some of my tests, I wanted to alter these headers.\r\nOne easy way to do it would be to add `request` to the list of hooks.\r\nAnother is to have these REST clients accept `headers` as a parameter.\r\n\r\nI have a base REST client from which all others derive and ended up adding a check for `hooks.get('request')` and go from there, basically adding the functionality myself. If it gets added to the `requests` library later, should be easy to switch.",
"So there seem to be a couple use-cases here that I wanted to summarize and directly address:\r\n\r\n1. A REST client library that needs to conditionally perform some logic\r\n2. Someone wanting to handle redirects in a bespoke and unexplained way\r\n\r\nAs someone who has written multiple REST client libraries, there are many ways to skin this cat and it all depends on how well designed the client library is. For anything that's going to be remotely complex or long-lived, I personally like a layered approach. By which I mean:\r\n\r\n- The bottom layer is a class that wraps/extends a `requests.Session` (ideally, it doesn't subclass so that you could swap it out for something similar in the future if you wanted and the rest of your library wouldn't have to know)\r\n- The next layer is what understands URL building and other business logic that might need to happen. This could be used by power users who want to just see response data directly\r\n- The final layer parses the prior layer into friendly objects.\r\n\r\nThis layering is not different from how you might think about a database library (bottom layer is roughly equivalent to a database specific driver, then the abstraction that parses and returns tuples from the driver, then the ORM). It's quite nice for testing purposes and it allows you to split up business logic into appropriate places. At the bottom layer, you can use the prepared request workflow that Nate mentioned above to prepare a request with your session and then apply your overrides.\r\n\r\nFor handling redirects in a bespoke way, there's already a hook for that. In fact, this very library itself uses [that hook for that purpose](https://github.com/psf/requests/blob/aae78010e987a414c176bddbf474cd554505219c/requests/auth.py#L278-L296). Unfortunately, the hooks in that code are relying on undocumented features that aren't something I want others to do. As an alternative to that, we have much of the redirect logic in a separate class that gets mixed into the Session. Following the APIs in that class, one could sub-class and extend that mixin and then create their own redirect-handling session: `class Session(requests.Session, MyRedirectMixin)`. It's not ideal, but it works and the APIs there are possible to understand.\r\n\r\nI'd like to get a breaking release out that gives more flexibility around the latter case specifically, but I think I'd also like a different way for hooks to work - namely I feel like hooks should have a way to return a new `PreparedRequest` that is used as a next request. I don't want hooks to be making additional requests that then hide themselves from the user (the way HTTPDigestAuth works currently) but that's a big breaking change "
] |
https://api.github.com/repos/psf/requests/issues/5036
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5036/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5036/comments
|
https://api.github.com/repos/psf/requests/issues/5036/events
|
https://github.com/psf/requests/issues/5036
| 426,080,505 |
MDU6SXNzdWU0MjYwODA1MDU=
| 5,036 |
change contentType from application/x-www-form-urlencoded to multipart/form-data
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48998939?v=4",
"events_url": "https://api.github.com/users/Peerke1/events{/privacy}",
"followers_url": "https://api.github.com/users/Peerke1/followers",
"following_url": "https://api.github.com/users/Peerke1/following{/other_user}",
"gists_url": "https://api.github.com/users/Peerke1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Peerke1",
"id": 48998939,
"login": "Peerke1",
"node_id": "MDQ6VXNlcjQ4OTk4OTM5",
"organizations_url": "https://api.github.com/users/Peerke1/orgs",
"received_events_url": "https://api.github.com/users/Peerke1/received_events",
"repos_url": "https://api.github.com/users/Peerke1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Peerke1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Peerke1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Peerke1",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-03-27T17:04:21Z
|
2021-11-05T03:00:30Z
|
2021-08-07T02:19:25Z
|
NONE
|
resolved
|
I am sending data to a webserver that does not understand application/x-www-form-urlencoded.
postman uses multipart/form-data to send the request and that works like a charm.
is there anyway to change the contentType so it will generate the needed boundary?
(if i just set the header myself it will not generate the boundary)
|
{
"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/5036/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5036/timeline
| null |
completed
| null | null | false |
[
"Hi,\r\nDid you try:\r\n`request.headers.update({'ContentType': multipart/form-data})`\r\nIf you use Session() simply substitute request to session.\r\nNormally all the headers are kept.",
"Hi,\r\nThanks for the reply. somehow the updated header gets re-updated by the post itself. I found this article: \r\nhttps://franklingu.github.io/programming/2017/10/30/post-multipart-form-data-using-requests/\r\nthat pointed me to the solution. got it working now, all form fields are send in multipart/form-data (without any {dummy)files)\r\n\r\nposted the link for others as there are quite a few with the same issue"
] |
https://api.github.com/repos/psf/requests/issues/5035
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5035/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5035/comments
|
https://api.github.com/repos/psf/requests/issues/5035/events
|
https://github.com/psf/requests/issues/5035
| 426,079,642 |
MDU6SXNzdWU0MjYwNzk2NDI=
| 5,035 |
{'error': "object of type 'filter' has no len()"} after a get request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2532099?v=4",
"events_url": "https://api.github.com/users/StrangeTcy/events{/privacy}",
"followers_url": "https://api.github.com/users/StrangeTcy/followers",
"following_url": "https://api.github.com/users/StrangeTcy/following{/other_user}",
"gists_url": "https://api.github.com/users/StrangeTcy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/StrangeTcy",
"id": 2532099,
"login": "StrangeTcy",
"node_id": "MDQ6VXNlcjI1MzIwOTk=",
"organizations_url": "https://api.github.com/users/StrangeTcy/orgs",
"received_events_url": "https://api.github.com/users/StrangeTcy/received_events",
"repos_url": "https://api.github.com/users/StrangeTcy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/StrangeTcy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/StrangeTcy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/StrangeTcy",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-03-27T17:02:38Z
|
2021-09-02T00:07:19Z
|
2020-02-18T07:04:14Z
|
NONE
|
resolved
|
Summary.
An error occurs when trying to run https://github.com/opencog/opencog/blob/master/examples/restapi/exampleclient.py
## Expected Result
A parseable JSON:
```
GET /api/v1.1/atoms/57:
{
"outgoing": [],
"incoming": [],
"name": "giant_frog",
"truthvalue": {
"type": "simple",
"details": {
"count": "0.20000000298023224",
"confidence": "0.0002499375259503722",
"strength": "0.07999999821186066"
}
},
"attentionvalue": {
"lti": 0,
"sti": 0,
"vlti": false
},
"handle": 57,
"type": "ConceptNode"
}
```
## Actual Result
An error occured:
>{'error': "object of type 'filter' has no len()"}
## Reproduction Steps
Follow the instructions in https://github.com/opencog/opencog/tree/master/examples/restapi/README.md (admittedly, you'd have to compile cogutil and atomspace, but I doubt they're the cause of the problem)
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.1.4"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.6.7"
},
"platform": {
"release": "4.15.0-46-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010007f",
"version": "17.5.0"
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010007f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": true
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"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/5035/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5035/timeline
| null |
completed
| null | null | false |
[
"your error info for me, please.",
"Sorry, I've quoted the error message in my post. What would the error info look like?",
"This doesn't appear to be an issue with Requests, I'd recommend following up with opencog or opening a question on StackOverflow."
] |
https://api.github.com/repos/psf/requests/issues/5034
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5034/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5034/comments
|
https://api.github.com/repos/psf/requests/issues/5034/events
|
https://github.com/psf/requests/pull/5034
| 425,868,380 |
MDExOlB1bGxSZXF1ZXN0MjY0ODU2MzI0
| 5,034 |
Add `requests-async` link to "non-blocking" docs.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/647359?v=4",
"events_url": "https://api.github.com/users/tomchristie/events{/privacy}",
"followers_url": "https://api.github.com/users/tomchristie/followers",
"following_url": "https://api.github.com/users/tomchristie/following{/other_user}",
"gists_url": "https://api.github.com/users/tomchristie/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tomchristie",
"id": 647359,
"login": "tomchristie",
"node_id": "MDQ6VXNlcjY0NzM1OQ==",
"organizations_url": "https://api.github.com/users/tomchristie/orgs",
"received_events_url": "https://api.github.com/users/tomchristie/received_events",
"repos_url": "https://api.github.com/users/tomchristie/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tomchristie/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tomchristie/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tomchristie",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-03-27T10:09:40Z
|
2021-08-31T00:07:17Z
|
2019-04-27T13:13:43Z
|
CONTRIBUTOR
|
resolved
|
Links to https://github.com/encode/requests-async for an asyncio non-blocking option.
|
{
"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/5034/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5034/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5034.diff",
"html_url": "https://github.com/psf/requests/pull/5034",
"merged_at": "2019-04-27T13:13:43Z",
"patch_url": "https://github.com/psf/requests/pull/5034.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5034"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/5033
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5033/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5033/comments
|
https://api.github.com/repos/psf/requests/issues/5033/events
|
https://github.com/psf/requests/pull/5033
| 425,800,481 |
MDExOlB1bGxSZXF1ZXN0MjY0ODA1NTgy
| 5,033 |
Add return to raise_for_status.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45011689?v=4",
"events_url": "https://api.github.com/users/heckad/events{/privacy}",
"followers_url": "https://api.github.com/users/heckad/followers",
"following_url": "https://api.github.com/users/heckad/following{/other_user}",
"gists_url": "https://api.github.com/users/heckad/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/heckad",
"id": 45011689,
"login": "heckad",
"node_id": "MDQ6VXNlcjQ1MDExNjg5",
"organizations_url": "https://api.github.com/users/heckad/orgs",
"received_events_url": "https://api.github.com/users/heckad/received_events",
"repos_url": "https://api.github.com/users/heckad/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/heckad/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/heckad/subscriptions",
"type": "User",
"url": "https://api.github.com/users/heckad",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 14 |
2019-03-27T07:19:48Z
|
2021-08-30T00:06:50Z
|
2019-08-20T04:20:05Z
|
NONE
|
resolved
|
Add return to raise_for_status for writing `resp = requests.get('SOME_URL').raise_for_status()` and same code.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 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/5033/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5033/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5033.diff",
"html_url": "https://github.com/psf/requests/pull/5033",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5033.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5033"
}
| true |
[
"Any reason why this didn't make progress? I quite like this.",
"I don`t know why tests failing. I am usied wsl for testing and all good. Now I will try again.",
"How to run tests corectly on windows 10?",
"Do some test command with your changes \r\nalso\r\ntake some auto test package and see what its result \r\nno matter what is your OS\r\nread a python guide to know what your doing.",
"All tests comleat suddenly.",
"@kennethreitz, will be merged?",
"> \r\n> \r\n> @kennethreitz, will be merged?\r\n\r\nReview your work \r\nsomething is not right",
"> something is not right\r\n\r\nPlease tell me what is not right?",
"How long does it take?",
"@sargun please add thumbs up for this pull request. @kenneth-reitz for some reason ignores it.",
"Can you rebase and squash?",
"IMO `raise_for_status` is more like a no-return function. Chaining evaluation is good but it returning the response surprised me.",
"As you propose to call the function?",
"I agree with @frostming."
] |
https://api.github.com/repos/psf/requests/issues/5032
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5032/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5032/comments
|
https://api.github.com/repos/psf/requests/issues/5032/events
|
https://github.com/psf/requests/issues/5032
| 425,647,843 |
MDU6SXNzdWU0MjU2NDc4NDM=
| 5,032 |
data: URLs won't fetch with requests, work in regular Python urllib
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/140257?v=4",
"events_url": "https://api.github.com/users/mvasilkov/events{/privacy}",
"followers_url": "https://api.github.com/users/mvasilkov/followers",
"following_url": "https://api.github.com/users/mvasilkov/following{/other_user}",
"gists_url": "https://api.github.com/users/mvasilkov/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mvasilkov",
"id": 140257,
"login": "mvasilkov",
"node_id": "MDQ6VXNlcjE0MDI1Nw==",
"organizations_url": "https://api.github.com/users/mvasilkov/orgs",
"received_events_url": "https://api.github.com/users/mvasilkov/received_events",
"repos_url": "https://api.github.com/users/mvasilkov/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mvasilkov/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mvasilkov/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mvasilkov",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-03-26T21:03:09Z
|
2021-09-02T00:07:19Z
|
2020-02-18T07:07:36Z
|
NONE
|
resolved
|
Summary: [`data:` URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) don't work, which is different from the Python 3 standard library.
## Expected Result
I expected the following to just work™:
```python
import requests
r = requests.get('data:text/plain;charset=utf-8,hello')
r.text # 'hello'
```
## Actual Result
```
import requests
r = requests.get('data:text/plain;charset=utf-8,hello')
<the entire traceback omitted for brevity>
~\c\django-balkans\virtual\Lib\site-packages\requests\sessions.py in send(self, request, **kwargs)
638
639 # Get the appropriate adapter to use
--> 640 adapter = self.get_adapter(url=request.url)
InvalidSchema: No connection adapters were found for 'data:text/plain;charset=utf-8,hello'
```
## Reproduction Steps
The following Python 3 code works as intended:
```python
import urllib.request
a = 'data:text/plain;charset=utf-8,Алоха, православныя!'
with urllib.request.urlopen(a) as response:
print(response.read().decode('utf-8'))
```
As well as the following JavaScript code (which might appear unrelated, but is included to demonstrate that the `data:` URLs are widely supported by bog-standard tooling):
```javascript
const test = async () => {
const res = await fetch('data:text/plain;charset=utf-8,Алоха, православныя!');
const data = await res.text();
console.log(data);
}
test()
```
I'm convinced that the requests library would benefit from supporting this also.
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.0"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010008f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
|
{
"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/5032/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5032/timeline
| null |
completed
| null | null | false |
[
"Requests is an HTTP library, the `data` scheme isn't supported by requests or the underlying urllib3 library.",
"Seth is right here. Requests is an http client and not intended to have the full support of a browser. There is likely another library that may be better suited for your case if urllib isn't sufficient."
] |
https://api.github.com/repos/psf/requests/issues/5031
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5031/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5031/comments
|
https://api.github.com/repos/psf/requests/issues/5031/events
|
https://github.com/psf/requests/issues/5031
| 425,199,662 |
MDU6SXNzdWU0MjUxOTk2NjI=
| 5,031 |
rfc6266 for parsing content-disposition header
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jbrockmendel",
"id": 8078968,
"login": "jbrockmendel",
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jbrockmendel",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 0 |
2019-03-26T02:40:09Z
|
2019-03-26T02:40:09Z
| null |
NONE
| null |
There is a package `rfc6266` on PyPi that does this, but it breaks on PY37 because it and its dependency `lepl` are apparently unmaintained. If I figure out how to re-implement it, would a PR be welcomed?
| 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/5031/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5031/timeline
| null | null | null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/5030
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5030/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5030/comments
|
https://api.github.com/repos/psf/requests/issues/5030/events
|
https://github.com/psf/requests/pull/5030
| 424,978,497 |
MDExOlB1bGxSZXF1ZXN0MjY0MTgwMTU4
| 5,030 |
sessions: fix proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/221258?v=4",
"events_url": "https://api.github.com/users/prietopa/events{/privacy}",
"followers_url": "https://api.github.com/users/prietopa/followers",
"following_url": "https://api.github.com/users/prietopa/following{/other_user}",
"gists_url": "https://api.github.com/users/prietopa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/prietopa",
"id": 221258,
"login": "prietopa",
"node_id": "MDQ6VXNlcjIyMTI1OA==",
"organizations_url": "https://api.github.com/users/prietopa/orgs",
"received_events_url": "https://api.github.com/users/prietopa/received_events",
"repos_url": "https://api.github.com/users/prietopa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/prietopa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/prietopa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/prietopa",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 9 |
2019-03-25T15:50:43Z
|
2021-08-30T00:06:45Z
|
2019-08-20T04:19:20Z
|
NONE
|
resolved
|
Take proxy configuration from session if not specify in args of request method
|
{
"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/5030/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5030/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5030.diff",
"html_url": "https://github.com/psf/requests/pull/5030",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5030.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5030"
}
| true |
[
"Working great here\r\nGood job @prietopa ",
"This pull request change order to merge proxy, verify, cert, etc.\r\nIt's an error to modify proxy before merge with session.proxy",
"Hello,\r\n\r\nReally appreciate for the fix.\r\nBut seems the bug fix not merged into master.\r\nWould you please take a look at it?\r\n\r\nThank you,\r\nKen",
"Hi Ken,\r\n\r\nWhen I push merge button, in github web page, it said:\r\n-\"Merging is blocked\", Merging can be performed automatically with 1 approving review\"-\r\nCan you approved?\r\nor\r\nI can do a new pull request in the master branch.\r\n\r\nThank you\r\nprietopa",
"Hello Prietopa,\r\n\r\nReally appreciate for your time and your HOT fix.\r\nI am not the contributor, seems that I don’t have access to approve your request.\r\n\r\n@Gabronog Would you please take time to review Prietopa’s pull request.\r\nReally appreciate for your help in advance.\r\n\r\nThank you,\r\nKen",
"> Hello Prietopa,\r\n> \r\n> Really appreciate for your time and your HOT fix.\r\n> I am not the contributor, seems that I don’t have access to approve your request.\r\n> \r\n> @Gabronog Would you please take time to review Prietopa’s pull request.\r\n> Really appreciate for your help in advance.\r\n> \r\n> Thank you,\r\n> Ken\r\n\r\nSure, it would be a pleasure :)\r\nThanks\r\nGabriel",
"@nateprewitt what are you thoughts on this?",
"let's just not change anything here. any delta in this area is potentially very dangerous for our users (unintended side-effects).",
"@kennethreitz What I wanted to say is that request is not taking the proxy configuration, changing these lines of code fixes it as it was being override."
] |
https://api.github.com/repos/psf/requests/issues/5029
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5029/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5029/comments
|
https://api.github.com/repos/psf/requests/issues/5029/events
|
https://github.com/psf/requests/issues/5029
| 424,925,554 |
MDU6SXNzdWU0MjQ5MjU1NTQ=
| 5,029 |
Post request not sending with big "data" parameter
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7926051?v=4",
"events_url": "https://api.github.com/users/nathan30/events{/privacy}",
"followers_url": "https://api.github.com/users/nathan30/followers",
"following_url": "https://api.github.com/users/nathan30/following{/other_user}",
"gists_url": "https://api.github.com/users/nathan30/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nathan30",
"id": 7926051,
"login": "nathan30",
"node_id": "MDQ6VXNlcjc5MjYwNTE=",
"organizations_url": "https://api.github.com/users/nathan30/orgs",
"received_events_url": "https://api.github.com/users/nathan30/received_events",
"repos_url": "https://api.github.com/users/nathan30/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nathan30/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nathan30/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nathan30",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-03-25T14:15:33Z
|
2021-09-05T00:06:56Z
|
2019-03-25T15:14:12Z
|
NONE
|
resolved
|
Hi,
I'm sending some data formated like this :
```python
data = {
'encodedFile' : base64.b64encode(fileContent),
'priority' : Config.cfg['OCForMaarch']['priority'],
'status' : Config.cfg['OCForMaarch']['status'],
'type_id' : Config.cfg['OCForMaarch']['type_id'],
'format' : Config.cfg['OCForMaarch']['format'],
'category_id' : Config.cfg['OCForMaarch']['category_id'],
'subject' : subject,
'destination' : destination,
'address_id' : contact['id'],
'exp_contact_id': contact['contact_id'],
'doc_date' : date
}
res = requests.post(self.baseUrl + 'resources', auth=self.auth, data=data)`
```
My encoded file is a 12 pages PDF, pretty heavy. The problem is, the data isn't send at all. When I print what the API server receive, nothing of that array appear. If my 'encodedFile' is something like 'dGVzdA==', the API server receive all the informations.
Is there a limitation I had to check ?
Thanks in davance
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7926051?v=4",
"events_url": "https://api.github.com/users/nathan30/events{/privacy}",
"followers_url": "https://api.github.com/users/nathan30/followers",
"following_url": "https://api.github.com/users/nathan30/following{/other_user}",
"gists_url": "https://api.github.com/users/nathan30/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nathan30",
"id": 7926051,
"login": "nathan30",
"node_id": "MDQ6VXNlcjc5MjYwNTE=",
"organizations_url": "https://api.github.com/users/nathan30/orgs",
"received_events_url": "https://api.github.com/users/nathan30/received_events",
"repos_url": "https://api.github.com/users/nathan30/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nathan30/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nathan30/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nathan30",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5029/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5029/timeline
| null |
completed
| null | null | false |
[
"> When I print what the API server receive, nothing of that array appear. If my 'encodedFile' is something like 'dGVzdA==', the API server receive all the informations.\r\n\r\nWhat exactly is received on the API server endpoint when sending the entire file? Just no `body` ? Or no request at all?\r\n\r\n> Is there a limitation I had to check ?\r\n\r\nI'm not aware of any limitation requests has. However, you might want to check your API server: is it running behind nginx with a limit? ",
"> > When I print what the API server receive, nothing of that array appear. If my 'encodedFile' is something like 'dGVzdA==', the API server receive all the informations.\r\n> \r\n> What exactly is received on the API server endpoint when sending the entire file? Just no `body` ? Or no request at all?\r\n> \r\n> > Is there a limitation I had to check ?\r\n> \r\n> I'm not aware of any limitation requests has. However, you might want to check your API server: is it running behind nginx with a limit?\r\n\r\nThe API received all the informations about auth etc.. But all the data were not sent. But finally I found the problem : \r\nThe post_max_size parameters on my Apache2 php.ini. So closed the thread :) Thanks for your reply btw"
] |
https://api.github.com/repos/psf/requests/issues/5028
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5028/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5028/comments
|
https://api.github.com/repos/psf/requests/issues/5028/events
|
https://github.com/psf/requests/issues/5028
| 423,570,987 |
MDU6SXNzdWU0MjM1NzA5ODc=
| 5,028 |
Proxy Issue - 407 Proxy Authentication Required
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/14316290?v=4",
"events_url": "https://api.github.com/users/Kenith/events{/privacy}",
"followers_url": "https://api.github.com/users/Kenith/followers",
"following_url": "https://api.github.com/users/Kenith/following{/other_user}",
"gists_url": "https://api.github.com/users/Kenith/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Kenith",
"id": 14316290,
"login": "Kenith",
"node_id": "MDQ6VXNlcjE0MzE2Mjkw",
"organizations_url": "https://api.github.com/users/Kenith/orgs",
"received_events_url": "https://api.github.com/users/Kenith/received_events",
"repos_url": "https://api.github.com/users/Kenith/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Kenith/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Kenith/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Kenith",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2019-03-21T04:46:37Z
|
2022-02-26T04:00:35Z
|
2021-11-28T03:24:45Z
|
NONE
|
resolved
|
Hello Requests Team,
We found that the proxy setting is not working.
We tried every possible proxy auth, only one success: using cntlm + username + password, like: http://username:[email protected]:3128
**System Info:**
Python 2.7
Requests 2.21.0
**How to reproduce:**
1. Make sure you are behind a proxy
2. Run the following code to reproduce issue
```
import requests
from requests.auth import HTTPProxyAuth
import base64
url = 'https://alexgaynor.net/'
user = 'username'
password = 'password'
proxy1 = 'http://{0}:{1}@proxyserver.com:80'.format(user, password) # not working
proxy2 = 'http://proxyserver.com:80' # not working
proxy3 = 'http://{0}:{1}@127.0.0.1:3128'.format(user, password) # this working by using cntlm + username + password
proxy4 = 'http://127.0.0.1:3128' # not working
# import os
# os.environ["HTTPS_PROXY"] = proxy3
# os.environ["HTTP_PROXY"] = proxy3
proxies = {'http': proxy1, 'https': proxy1}
proxy_auth_1 = 'Basic ' + base64.b64encode("{0}:{1}".format(user, password))
proxy_auth_2 = HTTPProxyAuth(user, password)
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36',
'Proxy-Authorization': proxy_auth_1}
session = requests.Session()
session.headers = headers
session.verify = False
session.proxies = proxies
session.auth = proxy_auth_2
# session.trust_env = False
res = session.get(url, verify=False, headers=headers, proxies=proxies, auth=proxy_auth_2)
status_code = res.status_code
print status_code
```
3. You could get the following error:
```
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/ken/PycharmProjects/Debug/Debug4.py
Traceback (most recent call last):
File "/Users/ken/PycharmProjects/Debug/Debug4.py", line 34, in <module>
res = session.get(url, verify=False, headers=headers, proxies=proxies, auth=proxy_auth_2)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/Library/Python/2.7/site-packages/requests/adapters.py", line 510, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='alexgaynor.net', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',)))
Process finished with exit code 1
```
|
{
"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/5028/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5028/timeline
| null |
completed
| null | null | false |
[
"Found the root cause, for some certain url, our company security mechanism will redirect the url to the following url, that's the reason, 407 error happens.\r\n\r\nWhy the proxy auth does not follow to the redirected url?\r\n\r\nhttps://safe.menlosecurity.com/safeview-auth-server/proxy_auth?url=aHR0cHM6Ly9hbGV4Z2F5bm9yLm5ldC8=&ip=MnwxOjB8MTA6MTU1MzE0NjAwM3wyOmlwfDIwOk1qQXpMakV4TUM0eU16VXVNak09fDU0ODEyNzk0ZDk5NzU4YjA3NWNkYTM4ZGJkYWVlYWNlN2UzMjViMzM4YjBhMTEzOTk3MGU2MzgyYzM4MTZlNWQ=&pnr=2&saml=true\r\n\r\n<img width=\"1105\" alt=\"ProxyIssue\" src=\"https://user-images.githubusercontent.com/14316290/54735367-c1576b00-4be0-11e9-9af4-b1475349fa1f.png\">\r\n",
"Prob fixed with [pr#5030](https://github.com/kennethreitz/requests/pull/5030)",
"how was this fixed, i have the same issue",
"@blresells @gabrielnoguerales it seems #5030 was not merged. I did not understand the patch and I am unsure whether it should have been merged or not.\r\n\r\nI have the same issue - my corporate proxy relies on NTLM, I am running cntlm locally and python requests does not send headers on connect. Firefox works fine.\r\n\r\nI have run wireshark to tell the difference between python requests and firefox and it seems python requests does not send the \"User-Agent\", \"Host\", \"Proxy-Connection: keep-alive\" and \"Connection: keep-alive\" headers upon CONNECTing. I have tried to force python requests to send those headers (especially the \"Host\" one) with no success.\r\n\r\nI have tried the cntlm + username + password method sugested by the OP also with no success.\r\n\r\nI believe this issue concerns the headers that python requests sends with CONNECT.\r\n",
"I am using cntlm and this works (@Kenith, @blresells, this may be a workaround):\r\n```\r\nimport urllib3\r\np = urllib3.ProxyManager(\r\n \"http://127.0.0.1:3128/\",\r\n proxy_headers={'Proxy-Connection': 'Keep-Alive'})\r\nr = p.request('GET', 'https://www.google.com')\r\n```\r\n\r\nThis does not, and reads exactly like the python requests CONNECT in wireshark:\r\n```\r\nimport urllib3\r\np = urllib3.ProxyManager(\r\n \"http://127.0.0.1:3128/\",\r\n proxy_headers={})\r\nr = p.request('GET', 'https://www.google.com')\r\n```\r\nThe output in the second case is:\r\n```\r\nTraceback (most recent call last):\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/connectionpool.py\", line 696, in urlopen\r\n self._prepare_proxy(conn)\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/connectionpool.py\", line 964, in _prepare_proxy\r\n conn.connect()\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/connection.py\", line 366, in connect\r\n self._tunnel()\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/http/client.py\", line 907, in _tunnel\r\n raise OSError(f\"Tunnel connection failed: {code} {message.strip()}\")\r\nOSError: Tunnel connection failed: 407 Proxy Authentication Required\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/home/a/Desktop/git/teste-api-maxar/teste.py\", line 35, in <module>\r\n r = p.request('GET', 'https://www.google.com')\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/request.py\", line 74, in request\r\n return self.request_encode_url(\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/request.py\", line 96, in request_encode_url\r\n return self.urlopen(method, url, **extra_kw)\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/poolmanager.py\", line 532, in urlopen\r\n return super(ProxyManager, self).urlopen(method, url, redirect=redirect, **kw)\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/poolmanager.py\", line 375, in urlopen\r\n response = conn.urlopen(method, u.request_uri, **kw)\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/connectionpool.py\", line 783, in urlopen\r\n return self.urlopen(\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/connectionpool.py\", line 783, in urlopen\r\n return self.urlopen(\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/connectionpool.py\", line 783, in urlopen\r\n return self.urlopen(\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/connectionpool.py\", line 755, in urlopen\r\n retries = retries.increment(\r\n File \"/srv/miniconda/envs/apimaxar/lib/python3.9/site-packages/urllib3/util/retry.py\", line 574, in increment\r\n raise MaxRetryError(_pool, url, error or ResponseError(cause))\r\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))\r\n```\r\n\r\nSo, the real issue is that:\r\n1) Python requests does not send the 'Proxy-Connection': 'keep-alive' header by default, like Firefox and curl do (also does not send the Host and the User-Agent, but for my setup that is not important).\r\n2) As far as I know, there is no way for the user to add a proxy_headers to a python requests session.\r\n\r\nThere is a simple workaround, though, which is to revert to urllib3 which exposes lower level funcionality.",
"> @blresells @gabrielnoguerales it seems #5030 was not merged. I did not understand the patch and I am unsure whether it should have been merged or not.\n> \n> I have the same issue - my corporate proxy relies on NTLM, I am running cntlm locally and python requests does not send headers on connect. Firefox works fine.\n> \n> I have run wireshark to tell the difference between python requests and firefox and it seems python requests does not send the \"User-Agent\", \"Host\", \"Proxy-Connection: keep-alive\" and \"Connection: keep-alive\" headers upon CONNECTing. I have tried to force python requests to send those headers (especially the \"Host\" one) with no success.\n> \n> I have tried the cntlm + username + password method sugested by the OP also with no success.\n> \n> I believe this issue concerns the headers that python requests sends with CONNECT.\n> \n\nHI I'm getting the same problem with my proxy it doesn't give mee the credentials I'm getting 407 Proxy-Authenticate how can I bypass the 407 Proxy-Authenticate? ",
"> Found the root cause, for some certain url, our company security mechanism will redirect the url to the following url, that's the reason, 407 error happens.\n> \n> Why the proxy auth does not follow to the redirected url?\n> \n> https://safe.menlosecurity.com/safeview-auth-server/proxy_auth?url=aHR0cHM6Ly9hbGV4Z2F5bm9yLm5ldC8=&ip=MnwxOjB8MTA6MTU1MzE0NjAwM3wyOmlwfDIwOk1qQXpMakV4TUM0eU16VXVNak09fDU0ODEyNzk0ZDk5NzU4YjA3NWNkYTM4ZGJkYWVlYWNlN2UzMjViMzM4YjBhMTEzOTk3MGU2MzgyYzM4MTZlNWQ=&pnr=2&saml=true\n> \n> <img width=\"1105\" alt=\"ProxyIssue\" src=\"https://user-images.githubusercontent.com/14316290/54735367-c1576b00-4be0-11e9-9af4-b1475349fa1f.png\">\n> \n\nHI what type of a browser you using? I have same proxy with my proxy ",
"We can't help debug your personal proxy for you as they are all different and sometimes very precise with what they want you to provide. If you can show this is a defect in Requests instead of a misconfiguration of your proxy then we can reopen."
] |
https://api.github.com/repos/psf/requests/issues/5027
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5027/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5027/comments
|
https://api.github.com/repos/psf/requests/issues/5027/events
|
https://github.com/psf/requests/issues/5027
| 423,171,497 |
MDU6SXNzdWU0MjMxNzE0OTc=
| 5,027 |
In [21]: import requests /usr/lib/python3/dist-packages/cryptography/x509/base.py:16: RuntimeWarning: coroutine 'wait' was never awaited from cryptography.x509.extensions import Extension, ExtensionType RuntimeWarning: Enable tracemalloc to get the object allocation traceback
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/17522269?v=4",
"events_url": "https://api.github.com/users/Ro0tk1t/events{/privacy}",
"followers_url": "https://api.github.com/users/Ro0tk1t/followers",
"following_url": "https://api.github.com/users/Ro0tk1t/following{/other_user}",
"gists_url": "https://api.github.com/users/Ro0tk1t/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Ro0tk1t",
"id": 17522269,
"login": "Ro0tk1t",
"node_id": "MDQ6VXNlcjE3NTIyMjY5",
"organizations_url": "https://api.github.com/users/Ro0tk1t/orgs",
"received_events_url": "https://api.github.com/users/Ro0tk1t/received_events",
"repos_url": "https://api.github.com/users/Ro0tk1t/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Ro0tk1t/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Ro0tk1t/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Ro0tk1t",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-03-20T10:20:22Z
|
2021-09-02T00:07:19Z
|
2020-02-18T07:09:14Z
|
NONE
|
resolved
|
Summary.
## Expected Result
What you expected.
## Actual Result
What happened instead.
## Reproduction Steps
```python
import requests
```
```
/usr/lib/python3/dist-packages/cryptography/x509/base.py:16: RuntimeWarning: coroutine 'wait' was never awaited
from cryptography.x509.extensions import Extension, ExtensionType
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"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/5027/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5027/timeline
| null |
completed
| null | null | false |
[
"Can you please fill out the template: describe what your expected and actual result was and how to reproduce.\r\nAnd please paste the traceback (if valuable) in to the post body and no the title. Please use a descriptive title instead.\r\n\r\nThank you 🎉 ",
"There isn't enough information here to evaluate what is happening. Given this is an issue in cryptography and not Requests directly, I'm going to resolve. I'd recommend checking the issue tracker with cryptography if you're still able to reproduce the issue."
] |
https://api.github.com/repos/psf/requests/issues/5026
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5026/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5026/comments
|
https://api.github.com/repos/psf/requests/issues/5026/events
|
https://github.com/psf/requests/issues/5026
| 423,086,537 |
MDU6SXNzdWU0MjMwODY1Mzc=
| 5,026 |
certificate's issue for docs.python-requests.org
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8712070?v=4",
"events_url": "https://api.github.com/users/kobayashi/events{/privacy}",
"followers_url": "https://api.github.com/users/kobayashi/followers",
"following_url": "https://api.github.com/users/kobayashi/following{/other_user}",
"gists_url": "https://api.github.com/users/kobayashi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kobayashi",
"id": 8712070,
"login": "kobayashi",
"node_id": "MDQ6VXNlcjg3MTIwNzA=",
"organizations_url": "https://api.github.com/users/kobayashi/orgs",
"received_events_url": "https://api.github.com/users/kobayashi/received_events",
"repos_url": "https://api.github.com/users/kobayashi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kobayashi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kobayashi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kobayashi",
"user_view_type": "public"
}
|
[] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
] | null | 0 |
2019-03-20T06:22:21Z
|
2021-11-10T08:00:28Z
|
2021-08-12T07:17:00Z
|
CONTRIBUTOR
|
resolved
|
Summary.
## Expected Result
Make the docs page secure.
## Actual Result
SSL certification error. This is also pointed out kennethreitz/requests-html#276

## Reproduction Steps
Get 'not secure' message by accessing `https://docs.python-requests.org`.
This is because old CNAME record (requests.readthedocs.org) is configured.
See [READTHEDOCS](https://docs.readthedocs.io/en/stable/custom_domains.html#custom-domain-ssl)
Below shows lookup result.
```shell
$ dig +noall +answer -t CNAME docs.python-requests.org
docs.python-requests.org. 396 IN CNAME requests.readthedocs.org.
```
## Solution
> Point the CNAME to readthedocs.io,
`https://requests.readthedocs.io` is secured right now.
|
{
"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": 4,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 4,
"url": "https://api.github.com/repos/psf/requests/issues/5026/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5026/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/5025
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5025/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5025/comments
|
https://api.github.com/repos/psf/requests/issues/5025/events
|
https://github.com/psf/requests/issues/5025
| 422,312,025 |
MDU6SXNzdWU0MjIzMTIwMjU=
| 5,025 |
Exception send post files open('ff.log', 'rb').tell() > 0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7082670?v=4",
"events_url": "https://api.github.com/users/mrakob/events{/privacy}",
"followers_url": "https://api.github.com/users/mrakob/followers",
"following_url": "https://api.github.com/users/mrakob/following{/other_user}",
"gists_url": "https://api.github.com/users/mrakob/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mrakob",
"id": 7082670,
"login": "mrakob",
"node_id": "MDQ6VXNlcjcwODI2NzA=",
"organizations_url": "https://api.github.com/users/mrakob/orgs",
"received_events_url": "https://api.github.com/users/mrakob/received_events",
"repos_url": "https://api.github.com/users/mrakob/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mrakob/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mrakob/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mrakob",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-03-18T16:23:08Z
|
2021-11-24T07:00:24Z
|
2021-08-26T06:06:34Z
|
NONE
|
resolved
|
request reading from file pointer and silent corrupt fseek.
```
import requests
file = ('filename', open('file.txt', 'rb'))
r1 = requests.post('https://someurl.com', files=[file]) # normal send
r2 = requests.post('https://someurl2.com', files=[file]) # silent send zero length file
```
Because open('file.txt', 'rb') already read in requests(r1), and file seek in end file. Next read file, reading zero bytes.
This problem in practice.
If in first iterate requests is response not 201, and next iterate sending success with zero length file.
```
file = ('filename', open('file.txt', 'rb'))
while True:
r = requests.post('https://someurl.com', files=[file])
if r.status_code == 201:
break
time.sleep(5)
```
I suggest added to
https://github.com/kennethreitz/requests/blob/master/requests/models.py#L159
next code:
```
if fp.hasattr(fp, 'tell') and fp.tell() > 0:
raise Exception('You send file seek not at the beginning file.')
```
I want change not obvious behaviour.
|
{
"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/5025/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5025/timeline
| null |
completed
| null | null | false |
[
"Hi @mrakob, thanks for the proposal. While we understand the pain this might cause, this is the normal behavior for dealing with file descriptors. If you read everything, future calls to read will return an empty byte-string. We cannot know what the user intends to do with the file and will only \"rewind\" it when a request has failed and engaged our internal retry mechanism.\r\n\r\nA hard failure like the one proposed is a non-option because many workflows relying on sending partially read files. Given the lack of engagement on this issue, it doesn't appear to be a common stumbling block. I'd recommend either reading the file into a local variable (size permitting) if you need to resend, or writing a simple function that reopens the file before posting to each endpoint."
] |
https://api.github.com/repos/psf/requests/issues/5024
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5024/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5024/comments
|
https://api.github.com/repos/psf/requests/issues/5024/events
|
https://github.com/psf/requests/issues/5024
| 422,092,368 |
MDU6SXNzdWU0MjIwOTIzNjg=
| 5,024 |
The reason that uploading file larger than 2GB will be truncated.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3275006?v=4",
"events_url": "https://api.github.com/users/kmiku7/events{/privacy}",
"followers_url": "https://api.github.com/users/kmiku7/followers",
"following_url": "https://api.github.com/users/kmiku7/following{/other_user}",
"gists_url": "https://api.github.com/users/kmiku7/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kmiku7",
"id": 3275006,
"login": "kmiku7",
"node_id": "MDQ6VXNlcjMyNzUwMDY=",
"organizations_url": "https://api.github.com/users/kmiku7/orgs",
"received_events_url": "https://api.github.com/users/kmiku7/received_events",
"repos_url": "https://api.github.com/users/kmiku7/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kmiku7/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kmiku7/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kmiku7",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 0 |
2019-03-18T08:31:24Z
|
2019-03-18T08:44:11Z
| null |
NONE
| null |
When I upload multipart-encoded file larger than 2GB in python2 environment, the body will be truncated. Server side can not read data completely. But the content-length value in header is expected. At client side, it do not send all data.
After tracing of function calls, it is caused by python2 socket library bug. Requests will use socket.sendall() to send body, but it use int type to keep bytes need be sent and has sent: [python2-socket-lib](https://github.com/python/cpython/blob/2.7/Modules/socketmodule.c#L2850). I also create a [issue](https://bugs.python.org/issue36337) to report this bug to python team.
Rather than waiting python team fix it, I thought Requests can fix quickly. After search it has also been reported many times.
Requests lib can split encoded string body into many segments each one smaller than 2GB, and send segments one by one. Or wrapping string body as as file-like object is also works, like this:
```python
from cStringIO import StringIO
body=StringIO(request.body)
```
| 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/5024/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5024/timeline
| null | null | null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/5023
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5023/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5023/comments
|
https://api.github.com/repos/psf/requests/issues/5023/events
|
https://github.com/psf/requests/issues/5023
| 422,091,701 |
MDU6SXNzdWU0MjIwOTE3MDE=
| 5,023 |
https requests over proxy got 407
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25705422?v=4",
"events_url": "https://api.github.com/users/ikebo/events{/privacy}",
"followers_url": "https://api.github.com/users/ikebo/followers",
"following_url": "https://api.github.com/users/ikebo/following{/other_user}",
"gists_url": "https://api.github.com/users/ikebo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ikebo",
"id": 25705422,
"login": "ikebo",
"node_id": "MDQ6VXNlcjI1NzA1NDIy",
"organizations_url": "https://api.github.com/users/ikebo/orgs",
"received_events_url": "https://api.github.com/users/ikebo/received_events",
"repos_url": "https://api.github.com/users/ikebo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ikebo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ikebo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ikebo",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-03-18T08:29:26Z
|
2022-02-26T04:00:34Z
|
2021-11-28T03:32:37Z
|
NONE
|
resolved
|
when the page_url use http protocol, it works well
``` python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
page_url = "http://httpbin.org/ip"
proxy = "proxy_ip:proxy_port"
username = "username"
password = "password"
proxy_auth = {"http": "http://%(user)s:%(pwd)s@%(ip)s/" % {'user': username, 'pwd': password, 'ip': proxy},
"https": "https://%(user)s:%(pwd)s@%(ip)s/" % {'user': username, 'pwd': password, 'ip': proxy}}
res = requests.get(url=page_url, proxies=proxy_auth)
print(res.status_code)
print(res.content.decode('utf-8'))
```
if the page_url is `"https://httpbin.org/ip"`, got this:
``` python
requests.exceptions.ProxyError: HTTPSConnectionPool(host='httpbin.org', port=443): Max retries exceeded with url: /ip (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',)))
```
I googled it and saw some similar issues in issues list, it does not seem to support https proxy ?
what would I do, please.
|
{
"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/5023/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5023/timeline
| null |
completed
| null | null | false |
[
"We can't help you debug your personal proxy, you'll need to do your own research or reach out to Stackoverflow for help."
] |
https://api.github.com/repos/psf/requests/issues/5022
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5022/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5022/comments
|
https://api.github.com/repos/psf/requests/issues/5022/events
|
https://github.com/psf/requests/issues/5022
| 421,206,912 |
MDU6SXNzdWU0MjEyMDY5MTI=
| 5,022 |
Using specific SSL version TLSv1.2 in Python (mounting separate adapters not working)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/17484250?v=4",
"events_url": "https://api.github.com/users/ankitpatnaik/events{/privacy}",
"followers_url": "https://api.github.com/users/ankitpatnaik/followers",
"following_url": "https://api.github.com/users/ankitpatnaik/following{/other_user}",
"gists_url": "https://api.github.com/users/ankitpatnaik/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ankitpatnaik",
"id": 17484250,
"login": "ankitpatnaik",
"node_id": "MDQ6VXNlcjE3NDg0MjUw",
"organizations_url": "https://api.github.com/users/ankitpatnaik/orgs",
"received_events_url": "https://api.github.com/users/ankitpatnaik/received_events",
"repos_url": "https://api.github.com/users/ankitpatnaik/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ankitpatnaik/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ankitpatnaik/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ankitpatnaik",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-03-14T19:34:32Z
|
2021-09-05T00:06:57Z
|
2019-03-15T21:15:48Z
|
NONE
|
resolved
|
I ran into the same problem mentioned in #3214
However despite mounting my adapters separately I run into the same issues. I get the same error output in the thread mentioned above.
```
class Myadapter(HTTPAdapter):
def init_poolmanager(self, connections, maxsize, block=False):
"""Create and initialize the urllib3 PoolManager."""
self.poolmanager = PoolManager(
num_pools=connections, maxsize=maxsize,
block=block, ssl_version=ssl.PROTOCOL_TLSv1_2)
def requests_session(session=None):
try:
adapter = Myadapter()
session.mount('http://', adapter)
session.mount('https://', adapter)
return session
except Exception:
('requests_session - Error Api calls')
data = {
'username' :
'password' :
}
headers = {
'Content-Type' : 'application/json'
}
session_id = requests.Session()
requests_r= requests_session(session=session_id)
resp= requests_r.post(url, data=data, headers=headers).json()
```
the Error is:
```
Max retries exceeded with url: some_random_api (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/17484250?v=4",
"events_url": "https://api.github.com/users/ankitpatnaik/events{/privacy}",
"followers_url": "https://api.github.com/users/ankitpatnaik/followers",
"following_url": "https://api.github.com/users/ankitpatnaik/following{/other_user}",
"gists_url": "https://api.github.com/users/ankitpatnaik/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ankitpatnaik",
"id": 17484250,
"login": "ankitpatnaik",
"node_id": "MDQ6VXNlcjE3NDg0MjUw",
"organizations_url": "https://api.github.com/users/ankitpatnaik/orgs",
"received_events_url": "https://api.github.com/users/ankitpatnaik/received_events",
"repos_url": "https://api.github.com/users/ankitpatnaik/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ankitpatnaik/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ankitpatnaik/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ankitpatnaik",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5022/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5022/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/5021
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5021/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5021/comments
|
https://api.github.com/repos/psf/requests/issues/5021/events
|
https://github.com/psf/requests/issues/5021
| 420,973,695 |
MDU6SXNzdWU0MjA5NzM2OTU=
| 5,021 |
raise_for_status leaks HTTP basic auth
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4311079?v=4",
"events_url": "https://api.github.com/users/calve/events{/privacy}",
"followers_url": "https://api.github.com/users/calve/followers",
"following_url": "https://api.github.com/users/calve/following{/other_user}",
"gists_url": "https://api.github.com/users/calve/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/calve",
"id": 4311079,
"login": "calve",
"node_id": "MDQ6VXNlcjQzMTEwNzk=",
"organizations_url": "https://api.github.com/users/calve/orgs",
"received_events_url": "https://api.github.com/users/calve/received_events",
"repos_url": "https://api.github.com/users/calve/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/calve/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/calve/subscriptions",
"type": "User",
"url": "https://api.github.com/users/calve",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 1 |
2019-03-14T11:46:50Z
|
2019-03-15T11:01:03Z
| null |
NONE
| null |
Calling `raise_for_status()` output (leaks) the HTTP basic auth password when raising an exception.
## Expected Result
```
>>> import requests
>>> r = requests.get("http://user:[email protected]/status/401")
>>> r.raise_for_status()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: UNAUTHORIZED for url: http://user:<redacted>@httpbin.org/status/401
```
## Actual Result
Here we can see the HTTP password in the resulting exception (`somepassw` in our case)
```
>>> import requests
>>> r = requests.get("http://user:[email protected]/status/401")
>>> r.raise_for_status()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: UNAUTHORIZED for url: http://user:[email protected]/status/401
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.2"
},
"platform": {
"release": "4.20.8-arch1-1-ARCH",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010101f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 4,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 4,
"url": "https://api.github.com/repos/psf/requests/issues/5021/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5021/timeline
| null | null | null | null | false |
[
"For future reader, one way to fix this behaviour is to pass the basic auth by kwargs;\r\n\r\n```\r\n>>> import requests\r\n>>> r = requests.get(\"http://httpbin.org/status/401\", auth=(\"user\", \"passwd\"))\r\n>>> r.raise_for_status()\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/lib/python3.7/site-packages/requests/models.py\", line 940, in raise_for_status\r\n raise HTTPError(http_error_msg, response=self)\r\nrequests.exceptions.HTTPError: 401 Client Error: UNAUTHORIZED for url: http://httpbin.org/status/401\r\n```\r\n\r\n----\r\n\r\nStill, seeing that python-requests send a `Authorization` header, it looks like we could do something for the original leak, as requests knows which parts of the URL is the authentification\r\n\r\n```\r\n>>> r = requests.get(\"http://user:[email protected]/status/401\")\r\n>>> r.raise_for_status()\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/lib/python3.7/site-packages/requests/models.py\", line 940, in raise_for_status\r\n raise HTTPError(http_error_msg, response=self)\r\nrequests.exceptions.HTTPError: 401 Client Error: UNAUTHORIZED for url: http://user:[email protected]/status/401\r\n>>> r.request.headers\r\n{'User-Agent': 'python-requests/2.21.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Authorization': 'Basic dXNlcjpwYXNzd29yZA=='}\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/5020
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5020/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5020/comments
|
https://api.github.com/repos/psf/requests/issues/5020/events
|
https://github.com/psf/requests/issues/5020
| 419,523,636 |
MDU6SXNzdWU0MTk1MjM2MzY=
| 5,020 |
Always get a CaseInsensitiveDict for headers.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2746227?v=4",
"events_url": "https://api.github.com/users/kootenpv/events{/privacy}",
"followers_url": "https://api.github.com/users/kootenpv/followers",
"following_url": "https://api.github.com/users/kootenpv/following{/other_user}",
"gists_url": "https://api.github.com/users/kootenpv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kootenpv",
"id": 2746227,
"login": "kootenpv",
"node_id": "MDQ6VXNlcjI3NDYyMjc=",
"organizations_url": "https://api.github.com/users/kootenpv/orgs",
"received_events_url": "https://api.github.com/users/kootenpv/received_events",
"repos_url": "https://api.github.com/users/kootenpv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kootenpv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kootenpv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kootenpv",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-03-11T15:13:12Z
|
2023-03-07T00:03:30Z
|
2022-03-06T23:43:45Z
|
NONE
|
resolved
|
If we look at how headers are merged from session and request, only if both are set the result will be a `CaseInsensitiveDict`. I propose to always use a case insensitive dict, even when one of the two is missing.
## Expected Result
Always get a `CaseInsensitiveDict` for headers.
## Actual Result
If only `session.headers` or `request.headers` are set, then headers are not case insensitive.
See also:
https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L55
I am not sure whether we should only do it `isinstance(dict_class, CaseInsensitiveDict)`, or whether it would make sense to always convert to the `dict_class`.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2746227?v=4",
"events_url": "https://api.github.com/users/kootenpv/events{/privacy}",
"followers_url": "https://api.github.com/users/kootenpv/followers",
"following_url": "https://api.github.com/users/kootenpv/following{/other_user}",
"gists_url": "https://api.github.com/users/kootenpv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kootenpv",
"id": 2746227,
"login": "kootenpv",
"node_id": "MDQ6VXNlcjI3NDYyMjc=",
"organizations_url": "https://api.github.com/users/kootenpv/orgs",
"received_events_url": "https://api.github.com/users/kootenpv/received_events",
"repos_url": "https://api.github.com/users/kootenpv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kootenpv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kootenpv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kootenpv",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5020/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5020/timeline
| null |
completed
| null | null | false |
[
"can i take up this issue @kootenpv ",
"Sure",
"Actually don't. We deliberately allow any mapping type to allow for a variety of use-cases. A change here won't be accepted"
] |
https://api.github.com/repos/psf/requests/issues/5018
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5018/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5018/comments
|
https://api.github.com/repos/psf/requests/issues/5018/events
|
https://github.com/psf/requests/pull/5018
| 419,195,999 |
MDExOlB1bGxSZXF1ZXN0MjU5NzY1OTA4
| 5,018 |
Remove duplicate config
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1324225?v=4",
"events_url": "https://api.github.com/users/hugovk/events{/privacy}",
"followers_url": "https://api.github.com/users/hugovk/followers",
"following_url": "https://api.github.com/users/hugovk/following{/other_user}",
"gists_url": "https://api.github.com/users/hugovk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hugovk",
"id": 1324225,
"login": "hugovk",
"node_id": "MDQ6VXNlcjEzMjQyMjU=",
"organizations_url": "https://api.github.com/users/hugovk/orgs",
"received_events_url": "https://api.github.com/users/hugovk/received_events",
"repos_url": "https://api.github.com/users/hugovk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hugovk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hugovk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hugovk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-03-10T15:08:28Z
|
2021-08-30T00:06:47Z
|
2019-08-20T04:17:54Z
|
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/5018/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5018/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5018.diff",
"html_url": "https://github.com/psf/requests/pull/5018",
"merged_at": "2019-08-20T04:17:54Z",
"patch_url": "https://github.com/psf/requests/pull/5018.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5018"
}
| true |
[
"~Master is failing in the same way.~",
"The Python 2.6 check was removed from master in https://github.com/kennethreitz/requests/pull/5092.\r\n\r\nThis PR still removes the duplicate config."
] |
|
https://api.github.com/repos/psf/requests/issues/5017
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5017/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5017/comments
|
https://api.github.com/repos/psf/requests/issues/5017/events
|
https://github.com/psf/requests/pull/5017
| 419,128,249 |
MDExOlB1bGxSZXF1ZXN0MjU5NzI0MTI0
| 5,017 |
improve error message for invalid timeouts
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1731829?v=4",
"events_url": "https://api.github.com/users/bennn/events{/privacy}",
"followers_url": "https://api.github.com/users/bennn/followers",
"following_url": "https://api.github.com/users/bennn/following{/other_user}",
"gists_url": "https://api.github.com/users/bennn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bennn",
"id": 1731829,
"login": "bennn",
"node_id": "MDQ6VXNlcjE3MzE4Mjk=",
"organizations_url": "https://api.github.com/users/bennn/orgs",
"received_events_url": "https://api.github.com/users/bennn/received_events",
"repos_url": "https://api.github.com/users/bennn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bennn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bennn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bennn",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-03-09T23:47:36Z
|
2021-08-30T00:06:44Z
|
2019-08-20T04:24:41Z
|
NONE
|
resolved
|
Rearrange a try/except so that these two programs give similar error
messages.
Program 1:
```
import requests
requests.get("https://random.org, timeout=(True, True))
```
Program 2:
```
import requests
requests.get("https://random.org, timeout=True)
```
Before this commit, _Program 2_ raised an error in `urllib3` asking for
an "int, float or None" timeout.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/5017/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5017/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5017.diff",
"html_url": "https://github.com/psf/requests/pull/5017",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5017.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5017"
}
| true |
[
"Why is this closed & not merged?"
] |
https://api.github.com/repos/psf/requests/issues/5016
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5016/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5016/comments
|
https://api.github.com/repos/psf/requests/issues/5016/events
|
https://github.com/psf/requests/issues/5016
| 418,777,011 |
MDU6SXNzdWU0MTg3NzcwMTE=
| 5,016 |
CBOR support
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3494011?v=4",
"events_url": "https://api.github.com/users/arkocal/events{/privacy}",
"followers_url": "https://api.github.com/users/arkocal/followers",
"following_url": "https://api.github.com/users/arkocal/following{/other_user}",
"gists_url": "https://api.github.com/users/arkocal/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/arkocal",
"id": 3494011,
"login": "arkocal",
"node_id": "MDQ6VXNlcjM0OTQwMTE=",
"organizations_url": "https://api.github.com/users/arkocal/orgs",
"received_events_url": "https://api.github.com/users/arkocal/received_events",
"repos_url": "https://api.github.com/users/arkocal/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/arkocal/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arkocal/subscriptions",
"type": "User",
"url": "https://api.github.com/users/arkocal",
"user_view_type": "public"
}
|
[
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
}
] |
closed
| true | null |
[] | null | 2 |
2019-03-08T12:59:21Z
|
2022-02-26T04:00:35Z
|
2021-11-28T03:25:32Z
|
NONE
|
resolved
|
Requests is not accepting feature requests at this time.
Still, I would like to open the issue to find out whether this use case is relevant for more people and worth consideration.
I would like to have a `cbor` parameter when making requests, similar to `json`, which would prepare the request body and set the `Content-Type` header.
**Cons:**
- `requests` is HTTP for humans, CBOR is not human readable.
- It would add a parameter to the most used and most high-level functions -> extra complexity for the API.
**Pros:**
- In this use case JSON and CBOR are very similar. When interacting with an API that accepts both encodings it results in unidiomatic code to handle both in different ways (using the parameter for JSON and manually doing this with CBOR)
- It is much more beautiful to use a parameter instead of preparing the request manually. The existince of the `json` parameter also speaks for this argument, with the difference JSON being much more popular than CBOR.
|
{
"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": 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/5016/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5016/timeline
| null |
completed
| null | null | false |
[
"+1. I recently needed this and had to code it myself so yes, I do find it relevant.",
"CBOR is already \"supported\" in that you can use a CBOR library to encode and decode raw binary data over the wire. I don't think this is necessarily something Requests should be doing itself. Closing this for now."
] |
https://api.github.com/repos/psf/requests/issues/5015
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5015/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5015/comments
|
https://api.github.com/repos/psf/requests/issues/5015/events
|
https://github.com/psf/requests/issues/5015
| 418,336,222 |
MDU6SXNzdWU0MTgzMzYyMjI=
| 5,015 |
Custom HTTP Non RFC Error Code Handling
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16541000?v=4",
"events_url": "https://api.github.com/users/gnubyte/events{/privacy}",
"followers_url": "https://api.github.com/users/gnubyte/followers",
"following_url": "https://api.github.com/users/gnubyte/following{/other_user}",
"gists_url": "https://api.github.com/users/gnubyte/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gnubyte",
"id": 16541000,
"login": "gnubyte",
"node_id": "MDQ6VXNlcjE2NTQxMDAw",
"organizations_url": "https://api.github.com/users/gnubyte/orgs",
"received_events_url": "https://api.github.com/users/gnubyte/received_events",
"repos_url": "https://api.github.com/users/gnubyte/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gnubyte/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gnubyte/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gnubyte",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-03-07T14:22:55Z
|
2022-02-26T04:00:35Z
|
2021-11-28T03:26:18Z
|
NONE
|
resolved
|
Custom HTTP/Non-RFC error code handling is not supported - feature request to handle custom error codes.
## Expected Result
If an error code like 601 is thrown back instead of a typical RFC 404, 400, etc. then the requests library replies back with an HttpBadStatusLine
status_code response would be 601 or whatever the server sent back
## Actual Result
HttpBadStatusLine from urllib
## System Information
Python v3
```
requests.put(someUrl, data=self.payload)
```
|
{
"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/5015/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5015/timeline
| null |
completed
| null | null | false |
[
"According to the HTTP protocol, I think those are invalid status codes.\r\nJust out of curiosity - why would you want to use such status codes in the first place?",
"Apparently, in NodeJS you can craft custom Error Codes that python supports handling with the urllib.\r\nMy coworker is now presenting custom http codes to indicate different application statuses. Its common in other protocols in my workplace from what I'm seeing of the vendors where I'm at (well known video company).\r\n\r\nI was thinking we extend the exception handling to allow custom error codes to be handled. As it stands if I use requests instead of the urllib I can handle these sorts of things, and I'd just like to see requests be able to do the same, natively, without refactoring.",
"Since this error is raised by the standard library, not Requests, there isn't anything we can do here. Servers should stick with compliant HTTP status codes."
] |
https://api.github.com/repos/psf/requests/issues/5014
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5014/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5014/comments
|
https://api.github.com/repos/psf/requests/issues/5014/events
|
https://github.com/psf/requests/issues/5014
| 417,864,841 |
MDU6SXNzdWU0MTc4NjQ4NDE=
| 5,014 |
Need a requests version number which OrderedDict is working on headers
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48289023?v=4",
"events_url": "https://api.github.com/users/alwaysnotworkingforme/events{/privacy}",
"followers_url": "https://api.github.com/users/alwaysnotworkingforme/followers",
"following_url": "https://api.github.com/users/alwaysnotworkingforme/following{/other_user}",
"gists_url": "https://api.github.com/users/alwaysnotworkingforme/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alwaysnotworkingforme",
"id": 48289023,
"login": "alwaysnotworkingforme",
"node_id": "MDQ6VXNlcjQ4Mjg5MDIz",
"organizations_url": "https://api.github.com/users/alwaysnotworkingforme/orgs",
"received_events_url": "https://api.github.com/users/alwaysnotworkingforme/received_events",
"repos_url": "https://api.github.com/users/alwaysnotworkingforme/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alwaysnotworkingforme/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alwaysnotworkingforme/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alwaysnotworkingforme",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-03-06T15:30:52Z
|
2021-11-10T08:00:28Z
|
2021-08-12T07:23:02Z
|
NONE
|
resolved
|
OrderedDict not working on headers again on version: 2.18.4 and 2.21.0
OrderedDict still works fine on data in this version, but not working on headers again.
I know this won't be fixed for a long time.
So I need help with a version number which OrderedDict is working on headers.
|
{
"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/5014/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5014/timeline
| null |
completed
| null | null | false |
[
"My code:\r\nheaders01 = OrderedDict([(\"Connection\", \"close\"), (\"Upgrade-Insecure-Requests\", \"1\"), (\"User-Agent\", \"SomeAgent\"), (\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8\"), (\"Accept-Encoding\", \"gzip, deflate\"), (\"Accept-Language\", \"Some Language\")])\r\n\r\nresult:\r\nConnection: close\r\nAccept-Encoding: gzip, deflate\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)\r\nAccept-Language: en-US,en;q=0.5\r\nUpgrade-Insecure-Requests: 1",
"There is a test for this in the test suite.\r\n\r\nhttps://github.com/kennethreitz/requests/blob/a345b776fb2cf67d1a1810349e71fd60a83f53eb/tests/test_requests.py#L446\r\n\r\nWhat happens if you run the tests on your machine?"
] |
https://api.github.com/repos/psf/requests/issues/5013
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5013/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5013/comments
|
https://api.github.com/repos/psf/requests/issues/5013/events
|
https://github.com/psf/requests/issues/5013
| 417,860,729 |
MDU6SXNzdWU0MTc4NjA3Mjk=
| 5,013 |
OrderedDict not working on headers again
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48289023?v=4",
"events_url": "https://api.github.com/users/alwaysnotworkingforme/events{/privacy}",
"followers_url": "https://api.github.com/users/alwaysnotworkingforme/followers",
"following_url": "https://api.github.com/users/alwaysnotworkingforme/following{/other_user}",
"gists_url": "https://api.github.com/users/alwaysnotworkingforme/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alwaysnotworkingforme",
"id": 48289023,
"login": "alwaysnotworkingforme",
"node_id": "MDQ6VXNlcjQ4Mjg5MDIz",
"organizations_url": "https://api.github.com/users/alwaysnotworkingforme/orgs",
"received_events_url": "https://api.github.com/users/alwaysnotworkingforme/received_events",
"repos_url": "https://api.github.com/users/alwaysnotworkingforme/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alwaysnotworkingforme/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alwaysnotworkingforme/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alwaysnotworkingforme",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2019-03-06T15:24:51Z
|
2022-02-26T04:00:34Z
|
2021-11-28T03:32:07Z
|
NONE
|
resolved
|
Summary.
OrderedDict not working on headers again.
I have tried both 2.21.0 and 2.18.4
It works fine on data but not working on headers, headers still get reordered.
## Expected Result
headers01 = OrderedDict([("Connection", "close"), ("Upgrade-Insecure-Requests", "1"), ("User-Agent", "SomeAgent"), ("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"), ("Accept-Encoding", "gzip, deflate"), ("Accept-Language", "Some Language")])
## Actual Result
Connection: close
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)
Accept-Language: en-US,en;q=0.5
Upgrade-Insecure-Requests: 1
## Reproduction Steps
```python
import requests
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.15"
},
"platform": {
"release": "7",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020ff"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
BTW
**AND I know there is no way to ask anyone to fix it since it's just a free project, and I do not Expected anyone to fix it.**
I just want someone to help me providing a requests **version number** which do not have this issue.
OrderedDict still works fine on data in this version.
dataxx = OrderedDict([("xxx", "xxx"), ("yyy", ''), ("zzz", ''), ("000", "222")])
|
{
"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/5013/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5013/timeline
| null |
completed
| null | null | false |
[
"Yea I just noticed this myself... only affect py2... i have gone back to 2.10 even and its still doing it... py3 on 2.12.4 is keeping the order",
"Referring back to here .. https://github.com/kennethreitz/requests/issues/2057\r\n\r\n@alwaysnotworkingforme , if you setup a session first\r\n\r\n`session = requests.session()` then do `session.headers=OrderedDict()` before you're get request the headers is defined as an __OrderedDict__ and stays as such..\r\n\r\n@kenneth-reitz \r\n\r\n",
"@VeNoMouS - Thanks! This is exactly the solution I was looking for.\r\n\r\nConfirmed this is working for requests version 2.22.0",
"Closing this issue as fixed."
] |
https://api.github.com/repos/psf/requests/issues/5012
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5012/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5012/comments
|
https://api.github.com/repos/psf/requests/issues/5012/events
|
https://github.com/psf/requests/issues/5012
| 417,835,544 |
MDU6SXNzdWU0MTc4MzU1NDQ=
| 5,012 |
Onion V3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/33716340?v=4",
"events_url": "https://api.github.com/users/leentheone/events{/privacy}",
"followers_url": "https://api.github.com/users/leentheone/followers",
"following_url": "https://api.github.com/users/leentheone/following{/other_user}",
"gists_url": "https://api.github.com/users/leentheone/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/leentheone",
"id": 33716340,
"login": "leentheone",
"node_id": "MDQ6VXNlcjMzNzE2MzQw",
"organizations_url": "https://api.github.com/users/leentheone/orgs",
"received_events_url": "https://api.github.com/users/leentheone/received_events",
"repos_url": "https://api.github.com/users/leentheone/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/leentheone/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/leentheone/subscriptions",
"type": "User",
"url": "https://api.github.com/users/leentheone",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2019-03-06T14:37:32Z
|
2021-12-03T22:00:27Z
|
2021-09-04T21:09:54Z
|
NONE
|
resolved
|
Hello everyone. As I understood requests don't support Onion v3 addresses. This greatly limits the use of the library.
If I am mistaken - please tell me how I can make a request for a similar domain.
|
{
"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/5012/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5012/timeline
| null |
completed
| null | null | false |
[
"I would really love to see this issue handled. Requests throws all sorts of exceptions when you try to go to a v3 address. \r\n\r\nHere's a quick paste of requests in an interpreter trying to go to a v3 address.\r\n\r\n>>> import requests\r\n>>> r = r.get(\"http://nanochancsvnej4vxiidu4fhpchkxffl3mgqypub63xadeetkjttavqd.onion/overboard.html\")\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\nNameError: name 'r' is not defined\r\n>>> r = requests.get(\"http://nanochancsvnej4vxiidu4fhpchkxffl3mgqypub63xadeetkjttavqd.onion/overboard.html\")\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 600, in urlopen\r\n chunked=chunked)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 384, in _make_request\r\n six.raise_from(e, None)\r\n File \"<string>\", line 2, in raise_from\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 380, in _make_request\r\n httplib_response = conn.getresponse()\r\n File \"/usr/lib/python3.5/http/client.py\", line 1197, in getresponse\r\n response.begin()\r\n File \"/usr/lib/python3.5/http/client.py\", line 297, in begin\r\n version, status, reason = self._read_status()\r\n File \"/usr/lib/python3.5/http/client.py\", line 266, in _read_status\r\n raise RemoteDisconnected(\"Remote end closed connection without\"\r\nhttp.client.RemoteDisconnected: Remote end closed connection without response\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/adapters.py\", line 449, in send\r\n timeout=timeout\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 638, in urlopen\r\n _stacktrace=sys.exc_info()[2])\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py\", line 367, in increment\r\n raise six.reraise(type(error), error, _stacktrace)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/packages/six.py\", line 685, in reraise\r\n raise value.with_traceback(tb)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 600, in urlopen\r\n chunked=chunked)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 384, in _make_request\r\n six.raise_from(e, None)\r\n File \"<string>\", line 2, in raise_from\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 380, in _make_request\r\n httplib_response = conn.getresponse()\r\n File \"/usr/lib/python3.5/http/client.py\", line 1197, in getresponse\r\n response.begin()\r\n File \"/usr/lib/python3.5/http/client.py\", line 297, in begin\r\n version, status, reason = self._read_status()\r\n File \"/usr/lib/python3.5/http/client.py\", line 266, in _read_status\r\n raise RemoteDisconnected(\"Remote end closed connection without\"\r\nurllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/api.py\", line 75, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/api.py\", line 60, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 533, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 646, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/adapters.py\", line 498, in send\r\n raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))",
"@JeffBarron, try requests.get(), not r.get()\r\n\r\nI am running into some super weird behavior here. It seems like with requests[socks] installed, it tries to route .onion through the socks proxy automatically.\r\n\r\nWith V3 .onions, I get: `\"Unable to determine SOCKS version from socks5h://127.0.0.1:9050\"`\r\n\r\nWith V2 .onions it seems to work. No code changes other than the endpoint. Non .onion isn't routed through.\r\n\r\nI can't find \"onion\" in any of the requests code. Does anyone know where that's coming from?\r\n\r\nThis works in about half of my infrastructure if I upgrade the right packages, about half of it does not. On working systems, virtualenv installs still work. On non-working systems, virtualenv still fails in there.\r\n\r\nI have no idea what's going on. All of my infrastructure is Debian 9.",
"Edit: This was completely my bad in kind of a hilarious sort of error.",
"We don't intend to support Tor or onion domains in Requests at this time. You're free to look into creating your own Adapter for this use case, but it won't be something added with first-class support to the core library."
] |
https://api.github.com/repos/psf/requests/issues/5011
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5011/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5011/comments
|
https://api.github.com/repos/psf/requests/issues/5011/events
|
https://github.com/psf/requests/issues/5011
| 417,421,164 |
MDU6SXNzdWU0MTc0MjExNjQ=
| 5,011 |
Host header not being set for CONNECT method of HTTPS proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22352286?v=4",
"events_url": "https://api.github.com/users/mctwynne/events{/privacy}",
"followers_url": "https://api.github.com/users/mctwynne/followers",
"following_url": "https://api.github.com/users/mctwynne/following{/other_user}",
"gists_url": "https://api.github.com/users/mctwynne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mctwynne",
"id": 22352286,
"login": "mctwynne",
"node_id": "MDQ6VXNlcjIyMzUyMjg2",
"organizations_url": "https://api.github.com/users/mctwynne/orgs",
"received_events_url": "https://api.github.com/users/mctwynne/received_events",
"repos_url": "https://api.github.com/users/mctwynne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mctwynne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mctwynne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mctwynne",
"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"
}
] |
open
| false | null |
[] | null | 6 |
2019-03-05T17:47:02Z
|
2020-09-24T00:12:24Z
| null |
NONE
| null |
Since `http.client` only supports [HTTP 1.0](https://github.com/python/cpython/blob/3.7/Lib/http/client.py#L895) for the CONNECT method it's not required to send the `Host` header. Unfortunately, HTTPS proxies often expect a `Host` header to be present, and fail to connect in its absence. I thought this might be of some interest here since `requests` + proxies is not particularly uncommon.
Is this something that could be supported in `requests`?
## Expected Result
The expectation is that `requests` will include the `Host` header as part of the CONNECTion process.
## Actual Result
The `Host` header is not included.
## Reproduction Steps
```python
import requests
>>> requests.get('https://google.ca', timeout=5, verify=False, proxies={'https': 'localhost:8081'})
Traceback (most recent call last):
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 594, in urlopen
self._prepare_proxy(conn)
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 805, in _prepare_proxy
conn.connect()
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/urllib3/connection.py", line 344, in connect
ssl_context=context)
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 344, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/usr/lib/python3.6/ssl.py", line 817, in __init__
self.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
socket.timeout: _ssl.c:830: The handshake operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='google.ca', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:830: The handshake operation t
imed out',)))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/me/.venvs/requests_venv/lib/python3.6/site-packages/requests/adapters.py", line 510, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='google.ca', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', timeout('_ssl.c:830: The handshake operation tim
ed out',)))
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.7"
},
"platform": {
"release": "4.15.0-43-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
| null |
{
"+1": 6,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 6,
"url": "https://api.github.com/repos/psf/requests/issues/5011/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5011/timeline
| null | null | null | null | false |
[
"@kenneth-reitz Do you happen to have a rough idea of how much effort would be involved in supporting this feature?",
"I am also having huge problem with this as well.\r\n\r\nAll of our proxies require at least HTTP/1.1 👎 \r\n\r\nRequests tries to connect using HTTP/1.0 and fails with:\r\n\r\nRemoteDisconnected('Remote end closed connection without response')\r\n\r\nI tried patch client _tunnel function to send 1.1 header and Host, the same way CURL sends, but I am getting Invalid response afterwards on:\r\n\r\nresponse = self.response_class(self.sock, method=self._method)\r\n\r\nprobably lot more changes are needed on tunneling https requests...\r\n\r\nBy the way http requests work normally.",
"I don't believe this is a bug or feature in requests. Rather, we rely on underlying libraries to generate the appropriate Host header and HTTP version. I know urllib3 just added support for TLS-in-TLS (using TLS to connect to a TLS proxy and sending a TLS request over that). Perhaps things have become better and this is maybe fixed (or at least partially better). ",
"Yeah, this is part of client.py: https://raw.githubusercontent.com/python/cpython/master/Lib/http/client.py\r\nI tried latest master branch, and tunneling https over https connect proxy is unfortunately not working.\r\nI also tried this pull request:\r\n\r\nhttps://github.com/python/cpython/pull/8305\r\n\r\nbut unfortunately that didn't solve the issue.",
"(Btw urllib3 TLS+TLS support hasn't been merged or released yet, still in development)",
"Thanks sethmlarson, I just tested urllib3 branch, and TLS+TLS works perfectly! Thanks for the tip!\r\n\r\nhttps://github.com/jalopezsilva/urllib3/tree/tls_in_tls_integration"
] |
https://api.github.com/repos/psf/requests/issues/5010
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5010/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5010/comments
|
https://api.github.com/repos/psf/requests/issues/5010/events
|
https://github.com/psf/requests/issues/5010
| 417,121,769 |
MDU6SXNzdWU0MTcxMjE3Njk=
| 5,010 |
Status_Code in Session
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7834336?v=4",
"events_url": "https://api.github.com/users/prrvchr/events{/privacy}",
"followers_url": "https://api.github.com/users/prrvchr/followers",
"following_url": "https://api.github.com/users/prrvchr/following{/other_user}",
"gists_url": "https://api.github.com/users/prrvchr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/prrvchr",
"id": 7834336,
"login": "prrvchr",
"node_id": "MDQ6VXNlcjc4MzQzMzY=",
"organizations_url": "https://api.github.com/users/prrvchr/orgs",
"received_events_url": "https://api.github.com/users/prrvchr/received_events",
"repos_url": "https://api.github.com/users/prrvchr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/prrvchr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/prrvchr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/prrvchr",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-03-05T05:17:07Z
|
2021-09-05T00:06:56Z
|
2019-03-28T22:29:13Z
|
NONE
|
resolved
|
Hi,
it would be really nice to have access to the status code from the Session, such as:
```python
with session.get(url, params=params, timeout=g_timeout) as r:
if r.status_code == session.codes.ok:
return r.json()
```
Thank you.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7834336?v=4",
"events_url": "https://api.github.com/users/prrvchr/events{/privacy}",
"followers_url": "https://api.github.com/users/prrvchr/followers",
"following_url": "https://api.github.com/users/prrvchr/following{/other_user}",
"gists_url": "https://api.github.com/users/prrvchr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/prrvchr",
"id": 7834336,
"login": "prrvchr",
"node_id": "MDQ6VXNlcjc4MzQzMzY=",
"organizations_url": "https://api.github.com/users/prrvchr/orgs",
"received_events_url": "https://api.github.com/users/prrvchr/received_events",
"repos_url": "https://api.github.com/users/prrvchr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/prrvchr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/prrvchr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/prrvchr",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5010/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5010/timeline
| null |
completed
| null | null | false |
[
"What would be the benefit for you of having those accessible from a `requests.Session` over using the look ups from `requests.codes` ?",
"I use Requests under UNO (OpenOffice / LibreOffice), and I provide it with extension [OAuth2OOo](https://github.com/prrvchr/OAuth2OOo/blob/master/README.md) to allow OpenOffice which only supports python 2.X for now, to work.\r\n\r\nThe other extensions that require OAuth2 and Requests use only Session with the import of Request in the function providing the Session. Because UNO use lazy loading, I can only use dynamic import, the Requests module being provided by the extension OAuth2OOo is only available after the extension is loaded.\r\n\r\nIf the status_code are in Session then I do not need anything else ...(All in one)\r\nIn thinking where to put it, that I thought Session was the best.\r\nBesides, I already allowed myself to patch, it's only a line:\r\n\r\n`self.codes = codes`\r\n\r\nThank",
"Hi,\r\nI confessed I was a little misguided, the good solution is to use Python dynamic typing and assign the status_code to an attribute of my Session variable, but certainly not to modify the source code of Requests ... Forgive me.\r\nI close this issue"
] |
https://api.github.com/repos/psf/requests/issues/5009
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5009/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5009/comments
|
https://api.github.com/repos/psf/requests/issues/5009/events
|
https://github.com/psf/requests/issues/5009
| 416,654,613 |
MDU6SXNzdWU0MTY2NTQ2MTM=
| 5,009 |
Why can't I use decorator with requests?
|
{
"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"
}
|
[
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
}
] |
closed
| true | null |
[] | null | 5 |
2019-03-04T06:45:20Z
|
2021-09-05T00:06:57Z
|
2019-03-06T00:46:52Z
|
NONE
|
resolved
|
```
import requests
r = requests
def my_decorator(func):
def wrapper(*args):
print(func.hostname)
print('sdasdas')
return wrapper
say_wee = my_decorator(r.sessions.urlparse('http://google.com'))
print(type(say_wee))
r.sessions.urlparse = say_wee
r.get('http://google.com')
```
I want to add some actions to the default sessions.urlparse. I get error:
```
Traceback (most recent call last):
File "res.py", line 14, in <module>
r.get('http://google.com')
File "/Library/Python/2.7/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/Library/Python/2.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 668, in send
history = [resp for resp in gen] if allow_redirects else []
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 150, in resolve_redirects
previous_fragment = urlparse(req.url).fragment
AttributeError: 'NoneType' object has no attribute 'fragment'
```
| 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/5009/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5009/timeline
| null |
completed
| null | null | false |
[
"Hi, @marataziat \r\n\r\n`say_wee = my_decorator(r.sessions.urlparse('http://google.com'))`\r\n\r\nYou shouldn't use a decorator on a `ParseResult`.",
"What exactly are you trying to achieve? \r\n\r\nYour decorator takes a function as argument, but you actually pass it a `ParseResult`.\r\nAnd your decorator doesn't call the original `requests.sessions.urlparse`, but you probably want to.",
"@timofurrer I want to add some additional layer of validating to the requests library. I don't want to rewrite all the functions so I made a decorator which just adds some code to the urlparse function. ",
"If you just want to extend the `r.sessions.urlparse` function your decorator should more look like the following: \r\n\r\n```python\r\nimport requests\r\n\r\n\r\ndef my_decorator(func):\r\n def wrapper(*args, **kwargs):\r\n print(\"Got r.sessions.urlparse *args:\", args)\r\n print(\"Got r.sessions.urlparse **kwargs:\", kwargs)\r\n return func(*args, **kwargs)\r\n return wrapper\r\n\r\n\r\nrequests.sessions.urlparse = my_decorator(requests.sessions.urlparse)\r\nprint(requests.get('http://google.com'))\r\n```",
"Ohhh thank you "
] |
https://api.github.com/repos/psf/requests/issues/5008
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5008/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5008/comments
|
https://api.github.com/repos/psf/requests/issues/5008/events
|
https://github.com/psf/requests/issues/5008
| 416,527,850 |
MDU6SXNzdWU0MTY1Mjc4NTA=
| 5,008 |
[Solved] UnicodeDecodeError: 'utf-8' codec can't decode byte
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8638284?v=4",
"events_url": "https://api.github.com/users/AboTyim/events{/privacy}",
"followers_url": "https://api.github.com/users/AboTyim/followers",
"following_url": "https://api.github.com/users/AboTyim/following{/other_user}",
"gists_url": "https://api.github.com/users/AboTyim/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AboTyim",
"id": 8638284,
"login": "AboTyim",
"node_id": "MDQ6VXNlcjg2MzgyODQ=",
"organizations_url": "https://api.github.com/users/AboTyim/orgs",
"received_events_url": "https://api.github.com/users/AboTyim/received_events",
"repos_url": "https://api.github.com/users/AboTyim/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AboTyim/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AboTyim/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AboTyim",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2019-03-03T15:27:25Z
|
2021-03-26T11:20:47Z
|
2019-03-04T08:52:12Z
|
NONE
|
resolved
|
Summary.
## Expected Result
File "/home/xxx/website/connection.py", line 38, in requests
response = requests.get(link, params=params, **kwargs)
File "/home/xxx/venv/lib/python3.5/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/home/xxx/venv/lib/python3.5/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/home/xxx/venv/lib/python3.5/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/xxx/venv/lib/python3.5/site-packages/requests/sessions.py", line 668, in send
history = [resp for resp in gen] if allow_redirects else []
File "/home/xxx/venv/lib/python3.5/site-packages/requests/sessions.py", line 668, in <listcomp>
history = [resp for resp in gen] if allow_redirects else []
File "/home/xxx/venv/lib/python3.5/site-packages/requests/sessions.py", line 149, in resolve_redirects
url = self.get_redirect_target(resp)
File "/home/xxx/venv/lib/python3.5/site-packages/requests/sessions.py", line 115, in get_redirect_target
return to_native_string(location, 'utf8')
File "/home/xxx/venv/lib/python3.5/site-packages/requests/_internal_utils.py", line 25, in to_native_string
out = string.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd9 in position 71: invalid continuation byte
## Actual Result
What happened instead.
## Reproduction Steps
```python
import requests
response = requests.get("https://www.shahbapress.com/news/8443/")
response.encoding = 'utf-8'
```
## System Information
$ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.5.6"
},
"platform": {
"release": "4.15.0-29deepin-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010008f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
python 3.5.6
```
to fix error in file _internal_utils.py line number 25
replace this line:
```
out = string.decode(encoding)
```
to line:
```
out = string.decode(encoding, 'ignore')
```
thank you
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7189225?v=4",
"events_url": "https://api.github.com/users/tvytlx/events{/privacy}",
"followers_url": "https://api.github.com/users/tvytlx/followers",
"following_url": "https://api.github.com/users/tvytlx/following{/other_user}",
"gists_url": "https://api.github.com/users/tvytlx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tvytlx",
"id": 7189225,
"login": "tvytlx",
"node_id": "MDQ6VXNlcjcxODkyMjU=",
"organizations_url": "https://api.github.com/users/tvytlx/orgs",
"received_events_url": "https://api.github.com/users/tvytlx/received_events",
"repos_url": "https://api.github.com/users/tvytlx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tvytlx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tvytlx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tvytlx",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5008/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5008/timeline
| null |
completed
| null | null | false |
[
"Hi, @AboTyim I'm closing this issue since you marked it as Solved.",
"It still happens with other urls\r\n\r\n response = requests.get(\"https://www.carm.es/web/pagina?IDCONTENIDO=701&IDTIPO=100&RASTRO=c286$m\")\r\n",
"> It still happens with other urls\r\n> \r\n> ```\r\n> response = requests.get(\"https://www.carm.es/web/pagina?IDCONTENIDO=701&IDTIPO=100&RASTRO=c286$m\")\r\n> ```\r\n\r\nYou can manually edit the file \"_internal_utils.py\" as shown above",
"In my case the part casing the error is /8443 in the url ( https://www.shahbapress.com/news/8443/ )\r\nI remade the url like this\r\nhttps://www.shahbapress.com/news\\/8443/ (back-slash used before the slash having numbers next)"
] |
https://api.github.com/repos/psf/requests/issues/5007
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5007/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5007/comments
|
https://api.github.com/repos/psf/requests/issues/5007/events
|
https://github.com/psf/requests/issues/5007
| 416,518,446 |
MDU6SXNzdWU0MTY1MTg0NDY=
| 5,007 |
UnicodeDecodeError: 'utf-8' codec can't decode byte
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8638284?v=4",
"events_url": "https://api.github.com/users/AboTyim/events{/privacy}",
"followers_url": "https://api.github.com/users/AboTyim/followers",
"following_url": "https://api.github.com/users/AboTyim/following{/other_user}",
"gists_url": "https://api.github.com/users/AboTyim/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AboTyim",
"id": 8638284,
"login": "AboTyim",
"node_id": "MDQ6VXNlcjg2MzgyODQ=",
"organizations_url": "https://api.github.com/users/AboTyim/orgs",
"received_events_url": "https://api.github.com/users/AboTyim/received_events",
"repos_url": "https://api.github.com/users/AboTyim/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AboTyim/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AboTyim/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AboTyim",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-03-03T13:53:37Z
|
2021-09-05T00:06:58Z
|
2019-03-04T08:45:06Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7189225?v=4",
"events_url": "https://api.github.com/users/tvytlx/events{/privacy}",
"followers_url": "https://api.github.com/users/tvytlx/followers",
"following_url": "https://api.github.com/users/tvytlx/following{/other_user}",
"gists_url": "https://api.github.com/users/tvytlx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tvytlx",
"id": 7189225,
"login": "tvytlx",
"node_id": "MDQ6VXNlcjcxODkyMjU=",
"organizations_url": "https://api.github.com/users/tvytlx/orgs",
"received_events_url": "https://api.github.com/users/tvytlx/received_events",
"repos_url": "https://api.github.com/users/tvytlx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tvytlx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tvytlx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tvytlx",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5007/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5007/timeline
| null |
completed
| null | null | false |
[] |
|
https://api.github.com/repos/psf/requests/issues/5006
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5006/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5006/comments
|
https://api.github.com/repos/psf/requests/issues/5006/events
|
https://github.com/psf/requests/issues/5006
| 415,682,872 |
MDU6SXNzdWU0MTU2ODI4NzI=
| 5,006 |
[BUG] Requests ignoring setting OP_NO_SSLv3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19909203?v=4",
"events_url": "https://api.github.com/users/flymg/events{/privacy}",
"followers_url": "https://api.github.com/users/flymg/followers",
"following_url": "https://api.github.com/users/flymg/following{/other_user}",
"gists_url": "https://api.github.com/users/flymg/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/flymg",
"id": 19909203,
"login": "flymg",
"node_id": "MDQ6VXNlcjE5OTA5MjAz",
"organizations_url": "https://api.github.com/users/flymg/orgs",
"received_events_url": "https://api.github.com/users/flymg/received_events",
"repos_url": "https://api.github.com/users/flymg/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/flymg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/flymg/subscriptions",
"type": "User",
"url": "https://api.github.com/users/flymg",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2019-02-28T15:33:01Z
|
2022-02-26T04:00:37Z
|
2021-11-28T03:14:48Z
|
NONE
|
resolved
|
Hello,
i'm trying to get a domain on a private server, but requests get continuously fails with sslv3 alert handshake failure.
I have configured the session to ignore sslv3 according to the blog post here https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/
but it continues using it as statet in the exception message.
Any ideas what i am making wrong here?
Heres my minimal script:
```python
import ssl
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.ssl_ import create_urllib3_context
CIPHERS = (
'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'
'!eNULL:!MD5'
)
class DESAdapter(HTTPAdapter):
"""
A TransportAdapter that re-enables 3DES support in Requests.
"""
def create_ssl_context(self):
ctx = ssl.create_default_context()
# opt out the SSLv3
ctx.options |= ssl.OP_NO_SSLv3
ctx.set_ciphers( CIPHERS )
return ctx
def init_poolmanager(self, *args, **kwargs):
kwargs['ssl_context'] = self.create_ssl_context()
return super(DESAdapter, self).init_poolmanager(*args, **kwargs)
def proxy_manager_for(self, *args, **kwargs):
kwargs['ssl_context'] = self.create_ssl_context()
return super(DESAdapter, self).proxy_manager_for(*args, **kwargs)
s = requests.Session()
s.mount('https://my-broken-intranet-domain.net:4942', DESAdapter())
# This will throw the error:
r = s.get('https://my-broken-intranet-domain.net:4942')
```
Exception has occurred: requests.exceptions.SSLError
HTTPSConnectionPool(host='my-broken-intranet-domain.net', port=4942): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1056)')))
With Curl, the request goes trough and the negotiated CIPHER and TLS are:
> curl -v https://my-broken-intranet-domain.net:4942
```
...
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DES-CBC3-SHA
* ALPN, server did not agree to a protocol
```
Versions:
Python 3.7.2
Name: requests
Version: 2.21.0
Name: urllib3
Version: 1.24.1
OpenSSL
1.1.0j
Thanks for the help!
|
{
"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/5006/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5006/timeline
| null |
completed
| null | null | false |
[
"Ok guys, the Problem is related to Python 3.7.2.\r\n\r\nI checked version 3.6.8 and the request goes through.\r\n\r\nI believe it is due to some kind of packaged OpenSSL, that comes with this version.\r\n\r\nCan someone please create a bug from this to check it?",
"I am currently seeing the same thing in __Python 2.7.13__ and __Python 3.5.3__ , running latest requests and urllib3 via pip2 && pip3 ` install --force-reinstall --no-cache-dir requests`\r\n```\r\n>>> import requests\r\n>>> requests.__version__\r\n'2.22.0'\r\n>>> import urllib3\r\n>>> urllib3.__version__\r\n'1.25.3\r\n>>>\r\n```\r\n\r\nopenssl on my system is 1.1.0j distro is __Debian 9.9__... \r\n\r\nOne weird thing i did notice\r\n\r\n```\r\n>>> import ssl\r\n>>> print ssl.OPENSSL_VERSION\r\nOpenSSL 1.1.0j 20 Nov 2018\r\n>>> import OpenSSL\r\n>>> print OpenSSL.SSL.SSLeay_version(0)\r\nOpenSSL 1.1.1c 28 May 2019\r\n>>>\r\n```\r\n\r\nSite i'm testing with is https://www.howsmyssl.com/a/check\r\n\r\nI have tested with a mount pool manager HTTPAdapter using `ssl.SSLContext()` and `create_urllib3_context()`\r\n\r\nNow... the weird thing is... if i don't specify a cipher at all... it works...\r\n\r\nwithout any cipher set.. I see a return content of\r\n\r\n```\r\nb'{\"given_cipher_suites\":[\"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384\",\"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\",\"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256\",\"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\",\"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256\",\"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256\",\"TLS_DHE_DSS_WITH_AES_256_GCM_SHA384\",\"TLS_DHE_RSA_WITH_AES_256_GCM_SHA384\",\"TLS_DHE_DSS_WITH_AES_128_GCM_SHA256\",\"TLS_DHE_RSA_WITH_AES_128_GCM_SHA256\",\"TLS_DHE_RSA_WITH_CHACHA20_POLY1305\",\"TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8\",\"TLS_ECDHE_ECDSA_WITH_AES_256_CCM\",\"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384\",\"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384\",\"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA\",\"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA\",\"TLS_DHE_RSA_WITH_AES_256_CCM_8\",\"TLS_DHE_RSA_WITH_AES_256_CCM\",\"TLS_DHE_RSA_WITH_AES_256_CBC_SHA256\",\"TLS_DHE_DSS_WITH_AES_256_CBC_SHA256\",\"TLS_DHE_RSA_WITH_AES_256_CBC_SHA\",\"TLS_DHE_DSS_WITH_AES_256_CBC_SHA\",\"TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8\",\"TLS_ECDHE_ECDSA_WITH_AES_128_CCM\",\"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256\",\"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\",\"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA\",\"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA\",\"TLS_DHE_RSA_WITH_AES_128_CCM_8\",\"TLS_DHE_RSA_WITH_AES_128_CCM\",\"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256\",\"TLS_DHE_DSS_WITH_AES_128_CBC_SHA256\",\"TLS_DHE_RSA_WITH_AES_128_CBC_SHA\",\"TLS_DHE_DSS_WITH_AES_128_CBC_SHA\",\"TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384\",\"TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384\",\"TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256\",\"TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256\",\"TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256\",\"TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256\",\"TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256\",\"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256\",\"TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA\",\"TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA\",\"TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA\",\"TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA\",\"TLS_RSA_WITH_AES_256_GCM_SHA384\",\"TLS_RSA_WITH_AES_128_GCM_SHA256\",\"TLS_RSA_WITH_AES_256_CCM_8\",\"TLS_RSA_WITH_AES_256_CCM\",\"TLS_RSA_WITH_AES_128_CCM_8\",\"TLS_RSA_WITH_AES_128_CCM\",\"TLS_RSA_WITH_AES_256_CBC_SHA256\",\"TLS_RSA_WITH_AES_128_CBC_SHA256\",\"TLS_RSA_WITH_AES_256_CBC_SHA\",\"TLS_RSA_WITH_AES_128_CBC_SHA\",\"TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256\",\"TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256\",\"TLS_RSA_WITH_CAMELLIA_256_CBC_SHA\",\"TLS_RSA_WITH_CAMELLIA_128_CBC_SHA\",\"TLS_EMPTY_RENEGOTIATION_INFO_SCSV\"],\"ephemeral_keys_supported\":true,\"session_ticket_supported\":true,\"tls_compression_supported\":false,\"unknown_cipher_suite_supported\":false,\"beast_vuln\":false,\"able_to_detect_n_minus_one_splitting\":false,\"insecure_cipher_suites\":{},\"tls_version\":\"TLS 1.2\",\"rating\":\"Probably Okay\"}'\r\n```\r\n\r\nif i set a cipher I see...\r\n\r\n```\r\nHTTPSConnectionPool(host='www.howsmyssl.com', port=443): Max retries exceeded with url: /a/check (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:720)'),))\r\n``` \r\n\r\nFull trace..\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"./test.py\", line 62, in <module>\r\n ret = session.get('https://www.howsmyssl.com/a/check')\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 546, in get\r\n return self.request('GET', url, **kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 533, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 646, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/adapters.py\", line 514, in send\r\n raise SSLError(e, request=request)\r\nrequests.exceptions.SSLError: HTTPSConnectionPool(host='www.howsmyssl.com', port=443): Max retries exceeded with url: /a/check (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:720)'),))\r\n```\r\n\r\n```python\r\nimport requests\r\nimport ssl\r\nfrom requests.adapters import HTTPAdapter\r\nfrom requests.packages.urllib3.util.ssl_ import create_urllib3_context\r\n\r\nclass CipherSuiteAdapter(HTTPAdapter):\r\n def __init__(self, cipherSuite=None, **kwargs):\r\n self.ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)\r\n self.ssl_context.options |= ssl.OP_NO_SSLv2\r\n self.ssl_context.options |= ssl.OP_NO_SSLv3\r\n self.ssl_context.set_ciphers(cipherSuite)\r\n #create_urllib3_context(ssl.PROTOCOL_TLSv1_2, ciphers=cipherSuite)\r\n super(CipherSuiteAdapter, self).__init__(**kwargs)\r\n\r\n #########################################################################\r\n\r\n def init_poolmanager(self, *args, **kwargs):\r\n kwargs['ssl_context'] = self.ssl_context\r\n return super(CipherSuiteAdapter, self).init_poolmanager(*args, **kwargs)\r\n\r\n#########################################################################\r\n\r\nsession = requests.session()\r\nsession.mount('https://', CipherSuiteAdapter(cipherSuite='ECDHE-ECDSA-AES128-GCM-SHA256'))\r\nsession.get('https://www.howsmyssl.com/a/check')\r\n```",
"@Lukasa , I know you've seen this error before from see'ing various tickets / issues... im yet to find a solution that works however, do you have any insight at all?",
"I got the same issue on windows using __python 2.7.11__\r\n\r\n```\r\n>>> requests.__version__\r\n'2.22.0'\r\n>>> import urllib3\r\n>>> urllib3.__version__\r\n'1.25.2'\r\n>>> import ssl\r\n>>> print ssl.OPENSSL_VERSION\r\nOpenSSL 1.0.2d 9 Jul 2015\r\n>>>\r\n```",
"This error appears to be something specific to certain types of ciphers chosen... ie \"AES256-GCM-SHA384\" works fine and does not generate the SSLv3 handshake issue.",
"@Lukasa could this be related to SNI at all?",
"I don't think this is a defect in Requests specifically. Would require more testing to track down the source (including potentially taking pcaps of the handshake in Wireshark). Closing this for now."
] |
https://api.github.com/repos/psf/requests/issues/5005
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5005/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5005/comments
|
https://api.github.com/repos/psf/requests/issues/5005/events
|
https://github.com/psf/requests/issues/5005
| 415,163,835 |
MDU6SXNzdWU0MTUxNjM4MzU=
| 5,005 |
How to avoid SSRF when you use requests to parse untrusted URLs?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-02-27T14:52:39Z
|
2021-09-04T00:06:27Z
|
2019-07-19T07:51:49Z
|
NONE
|
resolved
|
For an example I have a Flask app, it gets 'url' parameter from GET request. Then it do something like this:
```
requests.get(params['url']).text
```
So how to avoid localhost requests? Should I make a new network interface, which can access only external network and then send requests? I tried to search some answers for that and I found only https://github.com/JordanMilne/Advocate/ but the autor says that we shouldn't use it in production. So how to properly secure from SSRF in case like this? Can requests do requests through specified virtual network interfaces?
| 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/5005/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5005/timeline
| null |
completed
| null | null | false |
[
"I'd say this isn't within the realm of requests responsibility. This is an input sanitization issue not an HTTP issue. My recommendation would be parsing the URL and maintaining an \"allow list\" of hosts and URL constructions that are acceptable to make requests to (scheme, w/o userinfo, etc).",
"I have found a better way: https://stackoverflow.com/questions/691045/how-do-you-determine-if-an-ip-address-is-private-in-python you can just check if IP is blacklisted by this or not. Idk how secure it is but I think it's better than nothing. ",
"```\r\n>>> ip = '169.254.169.254'\r\n>>> ipaddress.ip_address(ip).is_global\r\nFalse\r\n>>>\r\n```\r\nLol, it's just a default python3 module and it can secure you even against aws metadata ip!! How can I make a module which will \"proxy\" the default requests module and add url ssrf protection?"
] |
https://api.github.com/repos/psf/requests/issues/5004
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5004/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5004/comments
|
https://api.github.com/repos/psf/requests/issues/5004/events
|
https://github.com/psf/requests/pull/5004
| 414,915,125 |
MDExOlB1bGxSZXF1ZXN0MjU2NTE3ODQz
| 5,004 |
Lock pytest-httpbin to <1.0
|
{
"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"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-02-27T02:30:17Z
|
2021-08-31T00:07:24Z
|
2019-03-02T00:57:10Z
|
MEMBER
|
resolved
|
[pytest-httpbin](https://github.com/kevin1024/pytest-httpbin) release 1.0.0 updated the `subjectAltName` field to the certificate which our unit tests assume doesn't have an IP Address entry in order to test warning generation. [Changelog for 1.0.0 even mentions this breakage in our unit tests.](https://github.com/kevin1024/pytest-httpbin/commit/be3c3205972195ca632949ed7af1dc7086cb7899)
|
{
"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/5004/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5004/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5004.diff",
"html_url": "https://github.com/psf/requests/pull/5004",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5004.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5004"
}
| true |
[
"So ran `pip freeze` after installing from pipenv and [we're still receiving pytest-httpbin==1.0.0](https://travis-ci.org/kennethreitz/requests/jobs/499055970#L551).\r\n\r\nDon't know what to do from here. Pipenv bug?"
] |
https://api.github.com/repos/psf/requests/issues/5003
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5003/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5003/comments
|
https://api.github.com/repos/psf/requests/issues/5003/events
|
https://github.com/psf/requests/issues/5003
| 414,887,835 |
MDU6SXNzdWU0MTQ4ODc4MzU=
| 5,003 |
POST request works in Postman/cURL, but not in Requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5006978?v=4",
"events_url": "https://api.github.com/users/mukundt/events{/privacy}",
"followers_url": "https://api.github.com/users/mukundt/followers",
"following_url": "https://api.github.com/users/mukundt/following{/other_user}",
"gists_url": "https://api.github.com/users/mukundt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mukundt",
"id": 5006978,
"login": "mukundt",
"node_id": "MDQ6VXNlcjUwMDY5Nzg=",
"organizations_url": "https://api.github.com/users/mukundt/orgs",
"received_events_url": "https://api.github.com/users/mukundt/received_events",
"repos_url": "https://api.github.com/users/mukundt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mukundt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mukundt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mukundt",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 32 |
2019-02-27T00:35:02Z
|
2021-11-26T04:00:30Z
|
2021-08-28T03:54:18Z
|
NONE
|
resolved
|
I have a POST request that works perfectly with both Postman an cURL (it returns a JSON blob of data). However, when I perform the exact same request with Python's Requests library, I get a 200 success response, but instead of my JSON blob, I get this:
<html>
<head>
<META NAME="robots" CONTENT="noindex,nofollow">
<script src="/_Incapsula_Resource?SWJIYLWA=5074a744e2e3d891814e9a2dace20bd4,719d34d31c8e3a6e6fffd425f7e032f3">
</script>
<body>
</body></html>
I've used HTTP request bins to verify that the request (headers and payload) from Postman/cURL is *exactly the same* as the one from Python Requests.
Here is my Postman request in cURL:
curl -X POST \
https:/someurl/bla/bla \
-H 'Content-Type: application/json' \
-H 'Referer: https://www.host.com/bla/bla/' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:65.0) Gecko/20100101 Firefox/65.0' \
-H 'cache-control: no-cache' \
-d '{"json1":"blabla","etc":"etc"}'
...and here is my Python code:
payload = {
"json1": "blabla",
"etc": "etc",
}
headers = {
'Host': 'www.host.com',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
'Referer': 'https://www.host.com/bla/bla/',
'Content-Type':'application/json',
'X-Requested-With': 'XMLHttpRequest',
'Connection': 'keep-alive',
'Origin': 'https://www.host.com',
}
s = requests.Session()
response_raw = s.post(url, json=payload, headers=headers)
print(response_raw)
print(response_raw.text)
I have verified that the payload and headers are correct and valid. I don't think it's a cookies or redirect issue, since I've disabled both of those params with Postman/cURL and everything still works fine. I'm stymied how the host server is somehow able to tell the difference between two seemingly identical HTTP requests...
Any help would be much appreciated; thanks!
|
{
"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/5003/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5003/timeline
| null |
completed
| null | null | false |
[
"This weird behavior has been reproduced. See [comment thread on StackOverfow](https://stackoverflow.com/questions/54878769/post-request-works-in-postman-but-not-in-python-requests-200-response-with-rob?noredirect=1#comment96632705_54878769).",
"It seems someone (if not all) in requests team make this happened on purpose.\r\nIt also happened in my post.\r\n\r\nThe only logical explaining is:\r\nRequests do not want handle header in order,\r\nSo that someone can sell product or code that will detect requests very easily.\r\nOr they just do that for the government.",
"hi.\r\nif return status is 200 ,\r\nExplain:your python code and url of request all no error,\r\nos your request perhaps is Cross domain request,\r\nYou need to set the permission of the web server to this domain or it will trigger the browser's homology policy.\r\nKey word: `CORS`",
"Can you print the response headers? `print(response_raw.headers)` I suspect it has to do with 'requests' not being able to decode content encoded in 'br'",
"I am having same issue where I am able to access the GET API through postman and browser but while trying with request module getting below error\r\nError Message: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))\r\n \r\nPython 3.7.4\r\nrequests==2.22.0\r\n\r\nand using below code \r\n response = requests.get('url')\r\n print(response)\r\n\r\n\r\n\r\n\r\n** checked that in postman not setting any request header.",
"I'm encountering this issue as well with `requests.__version__ == '2.22.0'` and python 3.7.4. This is the corresponding minimal cURL request:\r\n```\r\ncurl 'https://hearst.referrals.selectminds.com/ajax/content/landingpage_job_results?JobSearch.id=5917052&page_index=5&uid=173' \\\r\n-X POST \\\r\n--compressed \\\r\n-H 'Cookie: ORA_OTSS_SESSION_ID=073b162852b14d23b7ba84488fcec034b6b7d6896e3b77d291f35ddc54c743fb.hearst.chprapu11411.tee.taleocloud.net; JSESSIONID=B621ADEBAC95CA9D65C83B4B51220248.TC_832943_832940' \\\r\n-H 'tss-token: 3hs5eXc7xtNpNz50t8iJx2twIhPZeht/t1npR5q1CSo=' \r\n```\r\n\r\nI've attempted all means of passing the `Cookie` header (e.g., passing it in as a dictionary, using sessions and it's internal `CookieJar` object, maintaining my own `CookieJar` instance, etc.) and it seems as though requests isn't passing the headers along correctly. \r\n\r\nAlso, hello fellow CMU '17 alum @mukundt—I think we took a few classes together 😄 ",
"any update on that?\r\ni have the same issue my request was working previously then it stopped.\r\nand i can curl the same request.",
"Even i see this issue.\r\npls let us know the status of this.\r\n\r\nany logs of info needed please dont hesitate to ask.",
"Any other advancement on this? I've got the same issue (`wget` and `curl` and Python scripts fail, but browser works) as described in the stack overflow thread (linked above).\r\n\r\nAll request headers appear to be the same (the browser reports a half-dozen were used and I copy/pasted their text values into `wget` and `curl` options, but no luck; `requests` module had the same result).\r\n\r\nRemember the ghosts in Matrix 2? \"We are started to get annoyed.\" \"Yes, we are.\" 😐",
"@Azhrei Is this something you can share publicly? I would love to take on the challenge to solve it for you.",
"Wow, I'd be happy to have another set of eyeballs looking at this. (Mine are getting a bit bloodshot at this point. 😉)\r\n\r\nThe public URL is https://www.sunpass.com/ (the Florida electronic toll system) and that URL redirects to https://www.sunpass.com/en/home/index.shtml\r\n\r\nI've tried multiple approaches; this is the Bash script I've been using to try to replicate the request the browser makes:\r\n```\r\n#!/bin/bash\r\n\r\ncurl -q \\\r\n -v \\\r\n -o x.html \\\r\n -i \\\r\n -k \\\r\n -D x.headers \\\r\n --cookie-jar x.cookies \\\r\n -H \"Connection: keep-alive\" \\\r\n -H \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\" \\\r\n -H \"Accept-Language: en-US\" \\\r\n -H \"Accept-Encoding: br,gzip,deflate\" \\\r\n -A \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15\" \\\r\n https://www.sunpass.com/en/home/index.shtml\r\n\r\nexit\r\n\r\nwget -O x.html \\\r\n --rejected-log=/dev/stdout \\\r\n --save-headers \\\r\n --load-cookies x.cookies \\\r\n --save-cookies x.cookies \\\r\n --keep-session-cookies \\\r\n --header=\"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\" \\\r\n --header=\"Accept-Language: en-US\" \\\r\n --header=\"Accept-Encoding: br,gzip,deflate\" \\\r\n -U \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15\" \\\r\n https://www.sunpass.com/en/home/index.shtml\r\n```\r\nI've been working with `curl` lately, but comment out those first lines (including the `exit`) and it'll test with `wget` instead.\r\n\r\nI'm out of ideas. My next step is going to be to install a proxy server (Squid, probably) so that I can see _everything_. (I've tried using `tcpdump`/`wireshark` but the connection is HTTPS so I can't see anything. I'm not sure Squid will help for that reason; can I make a TLS connection to Squid, then have Squid make a TLS connection to the destination, such that I can see the unencrypted data as it passes through the proxy?)\r\n\r\nThanks for taking a look!\r\n\r\n**Edit:** I should've included the Python code that does the same thing. I'm actually using `requests_html` as a front-end to `requests` because the page contains JavaScript. So the Python code is essentially:\r\n```\r\nfrom requests_html import HTMLSession\r\n\r\nsession = HTMLSession()\r\nr = session.get(URL, headers={...}, timeout=10)\r\nr.html.render()\r\n```\r\n`URL` and the headers are the same as above, in the script.",
"Hello! Did you find a solution to this problem?",
"I have stalled on this; no progress since I made the above post. Right now, I'm manually traversing the target web site and downloading the data I need myself, but automating this task is still high on my todo list, so any progress others are making is still of great interest to me!",
"I succeeded to get content from the their web-server. BUT! They have a clever human verification built into their website. So when I scrape the content via script I'm presented with a recaptcha instead of the actual data. I don't think there is a way around this. This has nothing to do with curl or for that matter with any script language or scraper. It's purely related to the website in question.\r\n\r\nIf anyone experiences an issue with a different website, I would love to help.\r\n\r\nAttached is the page I get from their website with your commend:\r\n[Response.txt](https://github.com/psf/requests/files/4210788/Response.txt)\r\n\r\n",
"Yep, that's the same stuff I get.\r\n\r\nAny idea what their \"robot detection\" is looking for? I thought it might've been something to do with the timing of requests, but after some tests, I don't think that's it. What has stumped me is that they return that bogus data on the first request; it's not like they ping the browser and ask for it to run some JS or something...\r\n\r\nWhat code do you have that returns the captcha request? Or is that the page that the `src` attribute that the returned data shows...?",
"So, I followed your lead and went down the rabbit hole.\r\n\r\nThe page that the `script` refers to is always delivered gzip-compressed (apparently). It's ~24K that uncompresses into 169K of \"hidden\" JS code.\r\n\r\nThat script is executed and generates another chunk of JS that is ~108K.\r\n\r\nThen that code (which is full of text that is written using `\\x` hex escapes) is down to ~74K when I've replaced the hex-encoded text with straight ASCII.\r\n\r\nThis code further contains what appears to be base64-encoded strings that are again decoded... The variable and function names in this code are all obfuscated by converting them to hash strings.\r\n\r\nThis is where I'm at now. I'll report again when I've made some progress on the functional blocks of this code.",
"@Azhrei It sounds like the website is not making content available unless JavaScript execution is available. Have you tried using Selenium to drive a real browser instead of an HTTP client?",
"Yes, that's clearly what they're attempting. No idea why, but whatever...\r\n\r\nI mentioned above that I'm not actually using `requests`, but `requests_html`. This is a front-end module that downloads the Chromium JS engine on first use so that JS can be rendered in the page. I've used it on a couple of test URLs an it seems to work well, so I've got the JS part worked out. 🙂\r\n\r\nContinuing my last post, I've hit a snag. When I create a page and put my \"resolved\" JS into it, it gets into some kind of weird loop and blows the JS stack in the browser. I'm guessing it's because I'm loading it from a `file://` URL so the function that's trying to set a cookie is failing in a weird way. Clearly, there is still some work to do...",
"had the same issue\r\nworked for me to replace requests.post with requests.request:\r\n\r\n```\r\nresponse = requests.request(\"POST\", url, headers=headers, data = payload)\r\nprint(response.text.encode('utf8'))\r\n```\r\n",
"> Yes, that's clearly what they're attempting. No idea why, but whatever...\r\n\r\nTo stop bots, not everyone wants to be crawled",
"It’s a ridiculously complex approach, though. Especially given that the page being discussed is the home landing page and the useful (and extensive) data is available only after authenticating.\r\n\r\nBut it’s Florida, y’know. We build our web sites the way we handle our voting processes — badly. 🙄🥺\r\n\r\nI still haven’t figured out how it prevents bots either. If I render the page using a JS engine, how is a crawler being prevented...? No time to dig into it more right now, though...",
"> I succeeded to get content from the their web-server. BUT! They have a clever human verification built into their website. So when I scrape the content via script I'm presented with a recaptcha instead of the actual data. I don't think there is a way around this. This has nothing to do with curl or for that matter with any script language or scraper. It's purely related to the website in question.\r\n>\r\n> Attached is the page I get from their website with your commend:\r\n> [Response.txt](https://github.com/psf/requests/files/4210788/Response.txt)\r\n\r\nYep, that's what I see as well.\r\n\r\nCan you describe what you figured out and/or how you were able to get the page content? As I mentioned above, my next step is going to be to proxy the site somehow, as don't see any web traffic difference between what my browser does and what my script does?!?\r\n\r\nThanks.",
"okay - hope this helps (yes I am impacted by this problem as well but don't have spare time from my regular job to help).\r\n\r\nwith regards to the test URL provided up (www.sunpass.com) here's something that might help.\r\n\r\nThis site is hosted behind incapsula cloud WAF's. and they have a few bot protection functions, including injecting recaptcha's, but they also have a bot/automation protection mechanism of malformed Cookies with a CRLF (most browsers handle this fine, most automation tools (eg python/java/etc) break on this cookie).\r\n\r\nDon't know if this will help in anyway.",
"Thanks, I’ll look into that (next week, when I’ll have some time).\r\n\r\nI went down the rabbit hole trying to decode their silly JavaScript obfuscation and found some weird stuff, but something like a malformed cookie didn’t occur to me. I’ll also do some web searches on them to see what else I can find (I saw the their name in the initial response but my Google fu must’ve been weak when I looked for them).\r\n\r\nThank you!",
"I had a similar issue. Got away with urllib3. ",
"Really? Wow, that'd be too easy, but I'll give it a shot as well. It couldn't hurt. 🤷♂️",
"convert the response into json\r\n`resp = requests.post(....)\r\nprint(resp.json())\r\n`",
"> I succeeded to get content from the their web-server. BUT! They have a clever human verification built into their website. So when I scrape the content via script I'm presented with a recaptcha instead of the actual data. I don't think there is a way around this. This has nothing to do with curl or for that matter with any script language or scraper. It's purely related to the website in question.\r\n> \r\n> If anyone experiences an issue with a different website, I would love to help.\r\n> \r\n> Attached is the page I get from their website with your commend:\r\n> [Response.txt](https://github.com/psf/requests/files/4210788/Response.txt)\r\n\r\nHi Aron,\r\n\r\nCould you please help , I am facing same issue.\r\n\r\nthanks",
"> Hi Aron,\r\n> \r\n> Could you please help , I am facing same issue.\r\n> \r\n> thanks\r\n\r\nShow me your work, and I'll try to take it from there. What are you trying to do? (Which website?)",
"Hi there \r\nCC: @Aron2560 \r\n\r\nI have the same issue. It can be easily tested on the https://www.ozon.ru:\r\n\r\nIt works perfectly via curl:\r\n```\r\ncurl -H \"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36\" 'https://www.ozon.ru'\r\n```\r\nResponse: a long content \r\n\r\nBut doesn't work via code (I use Apache HttpClient fluent, java):\r\n``` \r\nRequest.get(\"https://www.ozon.ru\")\r\n .addHeader(HttpHeaders.USER_AGENT, \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36\")\r\n .execute()\r\n .returnContent()\r\n .toString()\r\n```\r\n\r\nResponse is:\r\n```\r\n<html style=\"height:100%\"><head><META NAME=\"ROBOTS\" CONTENT=\"NOINDEX, NOFOLLOW\"><meta name=\"format-detection\" content=\"telephone=no\"><meta name=\"viewport\" content=\"initial-scale=1.0\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\"><script type=\"text/javascript\" src=\"/_Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3\"></script></head><body style=\"margin:0px;height:100%\"><iframe id=\"main-iframe\" src=\"/_Incapsula_Resource?SWUDNSAI=30&xinfo=2-1431547-0%200NNN%20RT%281591636163716%2088%29%20q%280%20-1%20-1%200%29%20r%280%20-1%29%20B12%2811%2c348807%2c0%29%20U18&incident_id=580000270002950602-5855638190294722&edet=12&cinfo=0b000000&rpinfo=0\" frameborder=0 width=\"100%\" height=\"100%\" marginheight=\"0px\" marginwidth=\"0px\">Request unsuccessful. Incapsula incident ID: 580000270002950602-5855638190294722</iframe></body></html>\r\n```\r\n\r\nIt looks really strange. I tried with totally the same headers that send curl but it also doesn't work.\r\n```\r\n\r\nRequest.get(\"https://www.ozon.ru\")\r\n .addHeader(HttpHeaders.USER_AGENT, \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36\")\r\n .addHeader(HttpHeaders.ACCEPT, \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\")\r\n .addHeader(HttpHeaders.ACCEPT_ENCODING, \"gzip, deflate\")\r\n .addHeader(HttpHeaders.ACCEPT_LANGUAGE, \"en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7\")\r\n .addHeader(HttpHeaders.CONNECTION, \"keep-alive\")\r\n .addHeader(\"Upgrade-Insecure-Requests\", \"1\")\r\n .execute()\r\n .returnContent()\r\n .toString()\r\n```\r\n\r\nI'm confused and exhausted. Any ideas from you guys?\r\n\r\nKind regards,\r\nAlexey"
] |
https://api.github.com/repos/psf/requests/issues/5002
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5002/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5002/comments
|
https://api.github.com/repos/psf/requests/issues/5002/events
|
https://github.com/psf/requests/issues/5002
| 414,095,090 |
MDU6SXNzdWU0MTQwOTUwOTA=
| 5,002 |
Socket leakage - CLOSE_WAIT - multithreading
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13306063?v=4",
"events_url": "https://api.github.com/users/dancvrcek/events{/privacy}",
"followers_url": "https://api.github.com/users/dancvrcek/followers",
"following_url": "https://api.github.com/users/dancvrcek/following{/other_user}",
"gists_url": "https://api.github.com/users/dancvrcek/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dancvrcek",
"id": 13306063,
"login": "dancvrcek",
"node_id": "MDQ6VXNlcjEzMzA2MDYz",
"organizations_url": "https://api.github.com/users/dancvrcek/orgs",
"received_events_url": "https://api.github.com/users/dancvrcek/received_events",
"repos_url": "https://api.github.com/users/dancvrcek/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dancvrcek/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dancvrcek/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dancvrcek",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 6 |
2019-02-25T13:05:23Z
|
2021-02-05T02:21:48Z
| null |
NONE
| null |
Any thoughts please as I ran out of ideas what could be wrong. The problem is very possibly in the way I use requests and unfortunately I can't provide detailed configuration or the code itself but here we go.
Design:
Note: All system parts are currently running on the same server so the requests.sessions are to localhost.
The application has multiple virtual encryption classes (VCS), each can use one of upstream encryption services (ES). One of ESes has a RESTful API -> the virtual encryption class uses requests.get() for queries.
When the application starts, it creates an instance of VCS and this in turn creates its instance of a configuration class for an ES.
there is a main static method, which listens on downstream connections. On each such connection, it will create a WorkingThread which is given the VCS instance as a parameter. The WorkingThread:
1. asks ES to create a requests.session (static method)
2. runs a bunch of get() requests
3. closes the requests.session
The downstream client serializes connections so at the moment there's only one WorkingThread running at any one time. All upstream connections are to the same URL, what changes are HTTP GET parameters.
What happens is that when there are, e.g., 10 connections created back-to-back, the application leaves 9 sockets in the CLOSE_WAIT state. If there is just 1 downstream connection, the socket is correctly closed.
## Expected Result
Correctly closed sockets.
## Actual Result
When a new requests.Session() is created immediately after the previous has been closed, it leaks a socket (indefinite CLOSE_WAIT).
## Reproduction Steps
Not available at the moment - I tried run get() calls within "with", with "Connection: close" header, explicitly closing responses as well as the session, disabling selinux to no avail.
The dataflow summary: TCP server accepts a connection, creates a workingthread, which is given an global persistent object instance with an upstream config. the workingThread opens a requests.session, runs several get() requests, closes the session and sends a TCP response back.
## System Information
I can't access the server at the moment, but as of 20th Feb, 2019
Centos7.6, Python 2.7.5 requests and other packages are up to date, installed with pip
| 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/5002/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5002/timeline
| null | null | null | null | false |
[
"## System Information\r\n\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.5\"\r\n }, \r\n \"platform\": {\r\n \"release\": \"3.10.0-693.17.1.el7.x86_64\", \r\n \"system\": \"Linux\"\r\n }, \r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\", \r\n \"version\": null\r\n }, \r\n \"requests\": {\r\n \"version\": \"2.21.0\"\r\n }, \r\n \"system_ssl\": {\r\n \"version\": \"1000105f\"\r\n }, \r\n \"urllib3\": {\r\n \"version\": \"1.24.1\"\r\n }, \r\n \"using_pyopenssl\": false\r\n}\r\n\r\n",
"I'm still trying to replicate with a small python script. So far, I have managed to do that once (several consecutive runs but I lost it after changing the code slightly). It seemed like the thread doing get() requests was terminated while the session was still in the ESTABLISHED state. It would then go directly into infinite CLOSE_WAIT.\r\n\r\nAs I mentioned, if there are 10 tasks (each = 1 thread and multiple get() requests), only the last one leaves its socket in CLOSE_WAIT state. These threads have to be running spawned immediately after each other (first responds downstream -> a new thread is spawn, so 2 threads can overlap). If there is a gap between following threads, all sockets close correctly.\r\n\r\nIf I don't close the session, I get CLOSE_WAIT for all tasks I execute.\r\n\r\nThe most recent version uses simply requests.get(....) calls -> session should be torn down immediately after the response is received (stream=False ... i.e., default value).\r\n\r\n\r\n\r\nBTW, the server to which the Python script connects to is a Java Spring app.\r\nall requests are to localhost\r\n\r\n",
"ok, so the problem remains even when I use urllib/urllib2.\r\n\r\n If anyone has any thoughts, I'd really appreciate to hear any ideas.",
"... I should have mentioned that I'm opening a few hundred connections within a couple of seconds.",
"Looks like I ran into the similar (or same problem). Many threads, one session..",
"have you tried using the Connection:close header....HTTP 1.1 by default uses Connection:keep-alive, so if a socket ends its job, and the server did nor response back with a connection:close or when chucked responses you the client dont read the last chunked bite...the tcp socket will still open until the handler closes it...you can simple read the data using the response.content property, you can copy the response object or is you are using session, try a request ina context."
] |
https://api.github.com/repos/psf/requests/issues/5001
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5001/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5001/comments
|
https://api.github.com/repos/psf/requests/issues/5001/events
|
https://github.com/psf/requests/pull/5001
| 413,961,070 |
MDExOlB1bGxSZXF1ZXN0MjU1Nzc4Mzkz
| 5,001 |
pep8 fix
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/181942?v=4",
"events_url": "https://api.github.com/users/cocobear/events{/privacy}",
"followers_url": "https://api.github.com/users/cocobear/followers",
"following_url": "https://api.github.com/users/cocobear/following{/other_user}",
"gists_url": "https://api.github.com/users/cocobear/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cocobear",
"id": 181942,
"login": "cocobear",
"node_id": "MDQ6VXNlcjE4MTk0Mg==",
"organizations_url": "https://api.github.com/users/cocobear/orgs",
"received_events_url": "https://api.github.com/users/cocobear/received_events",
"repos_url": "https://api.github.com/users/cocobear/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cocobear/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cocobear/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cocobear",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-02-25T07:02:46Z
|
2021-08-30T00:06:50Z
|
2019-08-20T04:20:26Z
|
NONE
|
resolved
|
fix some pep8 errors.
|
{
"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/5001/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5001/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/5001.diff",
"html_url": "https://github.com/psf/requests/pull/5001",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5001.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5001"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/5000
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5000/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5000/comments
|
https://api.github.com/repos/psf/requests/issues/5000/events
|
https://github.com/psf/requests/issues/5000
| 413,885,095 |
MDU6SXNzdWU0MTM4ODUwOTU=
| 5,000 |
`no_proxy` setting ignores the `proxies` dictionary
|
{
"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"
}
|
[] |
open
| false | null |
[] | null | 3 |
2019-02-24T23:51:01Z
|
2020-07-02T15:08:11Z
| null |
CONTRIBUTOR
| null |
These work:
```
$ python -c "import os,requests;os.environ['HTTPS_PROXY']='https://b.r.o.k.e.n.com';requests.get('https://google.com', proxies={'no_proxy': 'google.com'})"
$ python -c "import os,requests;os.environ['HTTPS_PROXY']='https://b.r.o.k.e.n.com';os.environ['NO_PROXY']='google.com';requests.get('https://google.com')"
```
These do not work:
```
$ python -c "import requests;requests.get('https://google.com', proxies={'https': 'https://b.r.o.k.e.n.com', 'no_proxy': 'google.com'})"
$ python -c "import os,requests;os.environ['NO_PROXY']='google.com';requests.get('https://google.com', proxies={'https': 'https://b.r.o.k.e.n.com'})"
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.6.5"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
cc @Lukasa @sigmavirus24
| 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/5000/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5000/timeline
| null | null | null | null | false |
[
"Many issue (#4871, #879, #4600 ) is relative to `no_proxy`, and this is definitely a bug, even someone provide some patched code, why it's still unresolved?",
"Please fix the issue as it causes a slightly bigger issue - the session.send() method is ignoring the os.environ proxy settings so there is not way to specify proxy settings other than passing proxies explicitly, which doesn't bypass and ignores no_proxy.",
"A possible hint looking at the logic for \"should we bypass proxies\" in Requests, is that this logic is only checked on redirects…\r\n\r\nhttps://github.com/psf/requests/blob/1b417634721ec377abb7f17bc1f215e07202c2f7/requests/sessions.py#L292\r\n\r\nWhen I would expect it to _also_ be called on each request to decide \"should we use proxies for this URL\". Eg in `.get_adapter()`, or whichever place is responsible for saying \"use the connection pool, or a proxy\":\r\n\r\nhttps://github.com/psf/requests/blob/1b417634721ec377abb7f17bc1f215e07202c2f7/requests/sessions.py#L718-L730\r\n\r\nBut I'm not 100% sure at which layer the proxies vs connection pool decision occur, eg if it's in the default `HTTPAdapter` or elsewhere (haven't dug that far into the code).\r\n\r\nFor what it's worth, the 2nd failing test case works as expected with [HTTPX](https://python-httpx.org):\r\n\r\n```python\r\n>>> import os, httpx\r\n>>> os.environ['no_proxy'] = 'google.com'\r\n>>> proxies = {'https': 'https://no.where.com'}\r\n>>> c = httpx.Client(proxies=proxies)\r\n>>> c.get('https://google.com')\r\n<Response [200 OK]>\r\n```\r\n\r\nThe 1st failing test case doesn't though, because `no_proxy` keys aren't taken into account yet by HTTPX (see https://github.com/encode/httpx/issues/1043)."
] |
https://api.github.com/repos/psf/requests/issues/4999
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4999/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4999/comments
|
https://api.github.com/repos/psf/requests/issues/4999/events
|
https://github.com/psf/requests/pull/4999
| 413,695,697 |
MDExOlB1bGxSZXF1ZXN0MjU1NjEzOTM3
| 4,999 |
Add project URLs with links to source code and docs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1144873?v=4",
"events_url": "https://api.github.com/users/greysteil/events{/privacy}",
"followers_url": "https://api.github.com/users/greysteil/followers",
"following_url": "https://api.github.com/users/greysteil/following{/other_user}",
"gists_url": "https://api.github.com/users/greysteil/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/greysteil",
"id": 1144873,
"login": "greysteil",
"node_id": "MDQ6VXNlcjExNDQ4NzM=",
"organizations_url": "https://api.github.com/users/greysteil/orgs",
"received_events_url": "https://api.github.com/users/greysteil/received_events",
"repos_url": "https://api.github.com/users/greysteil/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/greysteil/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/greysteil/subscriptions",
"type": "User",
"url": "https://api.github.com/users/greysteil",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-02-23T13:26:00Z
|
2021-08-30T00:06:47Z
|
2019-08-20T04:21:32Z
|
CONTRIBUTOR
|
resolved
|
Warehouse now uses the `project_urls` provided to display links in the sidebar on [this screen](https://pypi.org/project/requests/), as well as including them in API responses to help automation tool find the source code for Requests. For example, see Django's [setup.py](https://github.com/django/django/blob/master/setup.py) and [PyPI listing](https://pypi.org/project/Django/).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/4999/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4999/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4999.diff",
"html_url": "https://github.com/psf/requests/pull/4999",
"merged_at": "2019-08-20T04:21:32Z",
"patch_url": "https://github.com/psf/requests/pull/4999.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4999"
}
| true |
[
"fantastic!"
] |
https://api.github.com/repos/psf/requests/issues/4998
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4998/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4998/comments
|
https://api.github.com/repos/psf/requests/issues/4998/events
|
https://github.com/psf/requests/issues/4998
| 413,494,208 |
MDU6SXNzdWU0MTM0OTQyMDg=
| 4,998 |
utils.get_encodings_from_content regexps incorrect matches
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jbrockmendel",
"id": 8078968,
"login": "jbrockmendel",
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jbrockmendel",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 1 |
2019-02-22T17:03:38Z
|
2021-11-28T03:31:38Z
| null |
NONE
| null |
`get_encodings_from_contents` uses regexps:
```
charset_re = re.compile(r'<meta.*?charset=["\']*(.+?)["\'>]', flags=re.I)
pragma_re = re.compile(r'<meta.*?content=["\']*;?charset=(.+?)["\'>]', flags=re.I)
xml_re = re.compile(r'^<\?xml.*?encoding=["\']*(.+?)["\'>]')
```
I'm finding cases where this is matching "<meta foo="bar">random junk charset=something_weird". A real-life example is at https://www.walmart.com/ip/108356879 where I get 7 matches. The first one gives the desired "utf-8". The next five are all "UTF-8\\". The last one matches on a 24711 character match and produces a 1730 character gibberish result.
Locally I've fixed this by changing the regexp patterns, replacing the first ".*?" with "[^>\\]*?"
Would a PR implementing this in requests (and/or requests-toolbelt) be welcome?
| 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/4998/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4998/timeline
| null | null | null | null | false |
[
"A PR fixing this behavior would be welcome!"
] |
https://api.github.com/repos/psf/requests/issues/4997
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4997/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4997/comments
|
https://api.github.com/repos/psf/requests/issues/4997/events
|
https://github.com/psf/requests/issues/4997
| 413,363,129 |
MDU6SXNzdWU0MTMzNjMxMjk=
| 4,997 |
should_bypass_proxies not thread-safe
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1963944?v=4",
"events_url": "https://api.github.com/users/bmerry/events{/privacy}",
"followers_url": "https://api.github.com/users/bmerry/followers",
"following_url": "https://api.github.com/users/bmerry/following{/other_user}",
"gists_url": "https://api.github.com/users/bmerry/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bmerry",
"id": 1963944,
"login": "bmerry",
"node_id": "MDQ6VXNlcjE5NjM5NDQ=",
"organizations_url": "https://api.github.com/users/bmerry/orgs",
"received_events_url": "https://api.github.com/users/bmerry/received_events",
"repos_url": "https://api.github.com/users/bmerry/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bmerry/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bmerry/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bmerry",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 0 |
2019-02-22T11:29:47Z
|
2019-02-22T11:29:47Z
| null |
CONTRIBUTOR
| null |
`requests.utils.should_bypass_proxies` temporary modifies the environment, calls into httplib and then restores the environment. However, it takes no locks while doing so, so two threads both using requests could lead to a permanent change to the environment. Even with a lock, any other thread that depends on the environment may observe the change (e.g. it may launch curl in a subprocess, and curl will then pick up this `no_proxy` setting).
## Expected Result
The environment is not modified by requests.
## Actual Result
I haven't observed this bug in practice - it's a theoretical race condition I can see in the code. In the reproduction code below, I believe the following sequence could occur:
1. Thread 1 enters the set_environ context manager, sets `old_value = None`, `os.environ['no_proxy'] = 'xyz'`.
2. Thread 2 enters set_environ, sets `old_value = 'xyz'`, `os.environ['no_proxy'] = 'xyz'.
3. Thread 1 exits, deletes `os.environ['no_proxy']`.
4. Thread 1 exits, sets `os.environ['no_proxy'] = 'xyz'`.
Now after all the requests have been finished, the environment has been modified.
## Reproduction Steps
I think this code can in theory trigger the race condition, although I haven't observed it. It needs an HTTP server on localhost:8080 (or just edit the URL)
```python
#!/usr/bin/env python3
import threading
import os
import requests
def my_thread():
session = requests.Session()
for i in range(100):
with session.get('http://localhost:8080/', proxies={'no_proxy': 'xyz'}) as resp:
pass
threads = [threading.Thread(target=my_thread) for _ in range(16)]
for thread in threads:
thread.start()
for thread in threads:
thread.join()
print('no_proxy:', os.environ.get('no_proxy', 'not set'))
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.6"
},
"platform": {
"release": "4.15.0-45-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010007f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/4997/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4997/timeline
| null | null | null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/4996
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4996/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4996/comments
|
https://api.github.com/repos/psf/requests/issues/4996/events
|
https://github.com/psf/requests/pull/4996
| 413,329,861 |
MDExOlB1bGxSZXF1ZXN0MjU1MzM3NDMy
| 4,996 |
Add link to user-agent documentation
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1708780?v=4",
"events_url": "https://api.github.com/users/sblondon/events{/privacy}",
"followers_url": "https://api.github.com/users/sblondon/followers",
"following_url": "https://api.github.com/users/sblondon/following{/other_user}",
"gists_url": "https://api.github.com/users/sblondon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sblondon",
"id": 1708780,
"login": "sblondon",
"node_id": "MDQ6VXNlcjE3MDg3ODA=",
"organizations_url": "https://api.github.com/users/sblondon/orgs",
"received_events_url": "https://api.github.com/users/sblondon/received_events",
"repos_url": "https://api.github.com/users/sblondon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sblondon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sblondon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sblondon",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2019-02-22T10:04:41Z
|
2021-08-30T00:06:49Z
|
2019-08-20T04:24:09Z
|
CONTRIBUTOR
|
resolved
|
So the user has a pointer to the documentation about the searched topic.
|
{
"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/4996/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4996/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4996.diff",
"html_url": "https://github.com/psf/requests/pull/4996",
"merged_at": "2019-08-20T04:24:09Z",
"patch_url": "https://github.com/psf/requests/pull/4996.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4996"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/4995
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4995/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4995/comments
|
https://api.github.com/repos/psf/requests/issues/4995/events
|
https://github.com/psf/requests/issues/4995
| 412,751,889 |
MDU6SXNzdWU0MTI3NTE4ODk=
| 4,995 |
Empty body when using requests.post() that follows a 302
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1175745?v=4",
"events_url": "https://api.github.com/users/bernardomk/events{/privacy}",
"followers_url": "https://api.github.com/users/bernardomk/followers",
"following_url": "https://api.github.com/users/bernardomk/following{/other_user}",
"gists_url": "https://api.github.com/users/bernardomk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bernardomk",
"id": 1175745,
"login": "bernardomk",
"node_id": "MDQ6VXNlcjExNzU3NDU=",
"organizations_url": "https://api.github.com/users/bernardomk/orgs",
"received_events_url": "https://api.github.com/users/bernardomk/received_events",
"repos_url": "https://api.github.com/users/bernardomk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bernardomk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bernardomk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bernardomk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 11 |
2019-02-21T05:11:42Z
|
2021-09-05T00:06:56Z
|
2019-03-18T03:55:03Z
|
NONE
|
resolved
|
Hi,
I have Python 3.7.1 and requests 2.19.1 installed and I am doing a POST to an endpoint that returns 302, apparently requests.post is not sending the body.
If I run this, it works fine:
`response = s.post('https://my-url', headers=headers, data=json.dumps(data))`
But when I run the code bellow, it fails:
`response = requests.post('https://my-url', headers=headers, data=json.dumps(data))`
I get this response from the server:
`'{"message":"Required parameter tag is missing"}'`
Which in my case would either mean a bad JSON object payload or an empty request body. Checking the server logs, I can see that the request body is empty.
Is this behavior expected? Am I doing something wrong?
Thanks in advance.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7189225?v=4",
"events_url": "https://api.github.com/users/tvytlx/events{/privacy}",
"followers_url": "https://api.github.com/users/tvytlx/followers",
"following_url": "https://api.github.com/users/tvytlx/following{/other_user}",
"gists_url": "https://api.github.com/users/tvytlx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tvytlx",
"id": 7189225,
"login": "tvytlx",
"node_id": "MDQ6VXNlcjcxODkyMjU=",
"organizations_url": "https://api.github.com/users/tvytlx/orgs",
"received_events_url": "https://api.github.com/users/tvytlx/received_events",
"repos_url": "https://api.github.com/users/tvytlx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tvytlx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tvytlx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tvytlx",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4995/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4995/timeline
| null |
completed
| null | null | false |
[
"You may set something in session, since this works:\r\n\r\n```\r\nresponse = s.post('https://my-url', headers=headers, data=json.dumps(data))\r\n```\r\n\r\nso use `requests.post` won't use the old session, it will start a new session instead.",
"Hi,\r\nThanks for the answer.\r\n\r\nBut if that was the case I would get a 401 or 403, right? And I see the request getting to the server.\r\n\r\nAlso, if I do curl with --post302 (not setting a cookie), also works.",
"Can you try to post to `http://httpbin.org/post` ? This site will echo your request data.\r\n\r\nAnd if you can give a runnable requests snippet I can help you debug.",
"Everything is identical. \r\n\r\nBut this is a straight POST, in my case I have at least three 302s going and I think request.post it's not sending the body after the redirects.\r\n\r\nI'll try to do some more digging. \r\n\r\nThanks again.",
"Here's the snippet:\r\n\r\n```\r\nimport requests\r\nimport json\r\n\r\ns = requests.Session()\r\n\r\nheaders = {\r\n 'Content-Type': 'application/json',\r\n 'Accept': '*/*',\r\n 'Authorization': 'Bearer <redacted>'\r\n}\r\n\r\ndata = {\"<key>\":{\"<key>\":\"<value>\",\"<key>\":\"<value>\",\"<key>\":\"<value>\"}, \"<key>\":[{\"<key>\":\"<value>\",\"<key>\":\"<value>\",\"reference\":\"<value>\"}]}\r\n# Works\r\nresponse = s.post('https://<my-url>', headers=headers, data=json.dumps(data))\r\n# Doesn't work:\r\nresponse = requests.post('https://<my-url>', headers=headers, data=json.dumps(data))\r\n```\r\n\r\nAgain, curl with --post302 works. From curl docs:\r\n\r\n> --post302\r\n> \r\n> (HTTP) Tells curl to respect RFC 7231/6.4.3 and not convert POST requests into GET requests when following a 302 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using -L, --location.\r\n> \r\n> See also --post301 and --post303 and -L, --location. Added in 7.19.1.\r\n> \r\n\r\nI haven't looked at the difference in requests yet, but I guess s.post is not converting the POST into GET and requests.post is, that's why body is not sent (doesn't make sense for a GET).",
"Hi, I tried post to a 302 URL using flask, it turns out that both `request` and `session` doesn't post data for 302, only curl with `--post302` works.\r\n\r\nHere's flask simple server:\r\n```\r\n# -*- coding: utf-8 -*-\r\nfrom flask import Flask, redirect, request\r\napp = Flask(__name__)\r\n\r\[email protected](\"/redirect_post\", methods=['GET', 'POST'])\r\ndef hello():\r\n return redirect(\"/real_post\")\r\n\r\[email protected]('/real_post', methods=['GET', 'POST'])\r\ndef login():\r\n print(request.form)\r\n print(request.data)\r\n return request.data\r\n```\r\n\r\nHere's curl test:\r\n```\r\ncurl -Xpost -d \"data=something\" http://127.0.0.1:5000/redirect_post -L\r\n\r\n127.0.0.1 - - [22/Feb/2019 14:26:39] \"post /redirect_post HTTP/1.1\" 302 -\r\nImmutableMultiDict([])\r\nb''\r\n127.0.0.1 - - [22/Feb/2019 14:26:39] \"post /real_post HTTP/1.0\" 200 -\r\n\r\ncurl -Xpost -d \"data=something\" http://127.0.0.1:5000/redirect_post -L --post302\r\n\r\n127.0.0.1 - - [22/Feb/2019 14:26:57] \"post /redirect_post HTTP/1.1\" 302 -\r\nImmutableMultiDict([('data', 'something')])\r\nb''\r\n127.0.0.1 - - [22/Feb/2019 14:26:57] \"post /real_post HTTP/1.0\" 200 -\r\n```\r\n\r\nAnd here is requests' test:\r\n\r\n```\r\nimport requests\r\n\r\ns = requests.Session()\r\ns.post(\"http://127.0.0.1:5000/redirect_post\", json={\"hello\": \"world\"})\r\nrequests.post(\"http://127.0.0.1:5000/redirect_post\", json={\"hello\": \"world\"})\r\n\r\n127.0.0.1 - - [22/Feb/2019 14:27:27] \"POST /redirect_post HTTP/1.1\" 302 -\r\nImmutableMultiDict([])\r\nb''\r\n127.0.0.1 - - [22/Feb/2019 14:27:27] \"GET /real_post HTTP/1.1\" 200 -\r\n127.0.0.1 - - [22/Feb/2019 14:27:27] \"POST /redirect_post HTTP/1.1\" 302 -\r\nImmutableMultiDict([])\r\nb''\r\n127.0.0.1 - - [22/Feb/2019 14:27:27] \"GET /real_post HTTP/1.1\" 200 -\r\n```\r\nIt shows that requests turn method to `GET` when redirect.",
"\r\n\r\nSame issue here. A POST request ends up in a 302 redirection and requests sends a GET to the new location.\r\n\r\nIt looks like requests is not respecting the HTTP method on redirections\r\n\r\n",
"@bernardomk you can use the [history property](http://docs.python-requests.org/en/latest/user/quickstart/#redirection-and-history) to track those redirections and see what happened",
"@bernardomk Is there an update?",
"@dmnava It's expected behavior to convert POST into GET during a 302 redirect.",
"HTTP 307 can ensure client keep HTTP method while redirecting.\r\n\r\nhttps://zh.wikipedia.org/wiki/HTTP_307"
] |
https://api.github.com/repos/psf/requests/issues/4989
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4989/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4989/comments
|
https://api.github.com/repos/psf/requests/issues/4989/events
|
https://github.com/psf/requests/issues/4989
| 412,029,070 |
MDU6SXNzdWU0MTIwMjkwNzA=
| 4,989 |
Redirect with empty location header not followed
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5472848?v=4",
"events_url": "https://api.github.com/users/thollingshead/events{/privacy}",
"followers_url": "https://api.github.com/users/thollingshead/followers",
"following_url": "https://api.github.com/users/thollingshead/following{/other_user}",
"gists_url": "https://api.github.com/users/thollingshead/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/thollingshead",
"id": 5472848,
"login": "thollingshead",
"node_id": "MDQ6VXNlcjU0NzI4NDg=",
"organizations_url": "https://api.github.com/users/thollingshead/orgs",
"received_events_url": "https://api.github.com/users/thollingshead/received_events",
"repos_url": "https://api.github.com/users/thollingshead/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/thollingshead/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/thollingshead/subscriptions",
"type": "User",
"url": "https://api.github.com/users/thollingshead",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-02-19T17:03:17Z
|
2022-03-29T19:00:32Z
|
2021-12-29T18:18:44Z
|
NONE
|
resolved
|
I am working with an external service whose authentication pattern is to set a cookie authentication token and return a 302 redirect to the same location (the location header is an empty string). This redirect is not being followed, I believe due to [this line](https://github.com/kennethreitz/requests/blob/v2.21.0/requests/sessions.py#L151).
This forces code like the following:
```python
import requests
with requests.session() as session:
session.cert = (cert, key)
resp = session.get(url)
# Extra code to handle redirect with empty location
if resp.status_code == 302 and resp.headers["location"] == "":
resp = session.get(url)
```
## System Information
Requests v2.21.0
Python 2.7.15
Windows Server 2012 R2
|
{
"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/4989/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4989/timeline
| null |
completed
| null | null | false |
[
"According to [RFC 7231](https://tools.ietf.org/html/rfc7231#section-7.1.2) the `Location` header is not allowed to be empty. Do most browser handle this as you describe?",
"Given we haven't heard back on this in quite a while, I'm going to resolve. The current behavior of the service is objectively incorrect and I'm insistent to start adding behavior where we're guessing at the right thing to do. The best solution for this case will be to handle the redirect manually."
] |
https://api.github.com/repos/psf/requests/issues/4987
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4987/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4987/comments
|
https://api.github.com/repos/psf/requests/issues/4987/events
|
https://github.com/psf/requests/pull/4987
| 411,220,464 |
MDExOlB1bGxSZXF1ZXN0MjUzNzMxMDgz
| 4,987 |
[fix] fix failing doctests in requests/*
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19170381?v=4",
"events_url": "https://api.github.com/users/aless10/events{/privacy}",
"followers_url": "https://api.github.com/users/aless10/followers",
"following_url": "https://api.github.com/users/aless10/following{/other_user}",
"gists_url": "https://api.github.com/users/aless10/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/aless10",
"id": 19170381,
"login": "aless10",
"node_id": "MDQ6VXNlcjE5MTcwMzgx",
"organizations_url": "https://api.github.com/users/aless10/orgs",
"received_events_url": "https://api.github.com/users/aless10/received_events",
"repos_url": "https://api.github.com/users/aless10/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/aless10/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aless10/subscriptions",
"type": "User",
"url": "https://api.github.com/users/aless10",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-02-17T18:47:44Z
|
2021-08-30T00:06:49Z
|
2019-08-20T04:25:51Z
|
CONTRIBUTOR
|
resolved
|
## Why this PR
Running the command:
`
$ py.test --doctest-module requests
`
gives failing doctests. This PR aims to fix these failing doctests.
Issue Link: https://github.com/kennethreitz/requests/issues/4986
## How to test
`
$ py.test --doctest-module requests
`
All the 11 doctests should pass.
|
{
"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/4987/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4987/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4987.diff",
"html_url": "https://github.com/psf/requests/pull/4987",
"merged_at": "2019-08-20T04:25:51Z",
"patch_url": "https://github.com/psf/requests/pull/4987.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4987"
}
| true |
[
"fantastic"
] |
https://api.github.com/repos/psf/requests/issues/4986
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4986/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4986/comments
|
https://api.github.com/repos/psf/requests/issues/4986/events
|
https://github.com/psf/requests/issues/4986
| 411,217,995 |
MDU6SXNzdWU0MTEyMTc5OTU=
| 4,986 |
Doctest fails (7 out of 11)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19170381?v=4",
"events_url": "https://api.github.com/users/aless10/events{/privacy}",
"followers_url": "https://api.github.com/users/aless10/followers",
"following_url": "https://api.github.com/users/aless10/following{/other_user}",
"gists_url": "https://api.github.com/users/aless10/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/aless10",
"id": 19170381,
"login": "aless10",
"node_id": "MDQ6VXNlcjE5MTcwMzgx",
"organizations_url": "https://api.github.com/users/aless10/orgs",
"received_events_url": "https://api.github.com/users/aless10/received_events",
"repos_url": "https://api.github.com/users/aless10/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/aless10/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aless10/subscriptions",
"type": "User",
"url": "https://api.github.com/users/aless10",
"user_view_type": "public"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 117744,
"name": "Bug",
"node_id": "MDU6TGFiZWwxMTc3NDQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Bug"
},
{
"color": "d4c5f9",
"default": false,
"description": "",
"id": 1237085166,
"name": "PR(s) available",
"node_id": "MDU6TGFiZWwxMjM3MDg1MTY2",
"url": "https://api.github.com/repos/psf/requests/labels/PR(s)%20available"
}
] |
closed
| true | null |
[] | null | 2 |
2019-02-17T18:24:38Z
|
2021-11-05T03:00:29Z
|
2021-08-07T02:26:11Z
|
CONTRIBUTOR
|
resolved
|
Hi,
while I was working on doctests, I noticed some doctests were failing.
## Expected Result
````
$ pytest --doctest-module .
============================= test session starts ===============================
platform darwin -- Python 3.7.0, pytest-4.0.2, py-1.7.0, pluggy-0.8.1
rootdir: requests/requests, inifile: pytest.ini
plugins: xdist-1.26.1, mock-1.10.1, httpbin-1.0.0, forked-1.0.2, cov-2.6.1
collected 11 items
__init__.py . [ 9%]
adapters.py . [ 18%]
api.py . [ 27%]
models.py .. [ 45%]
sessions.py . [ 54%]
status_codes.py . [ 63%]
utils.py .... [100%]
==========================11 passed in 2.92 seconds=============================
````
## Actual Result
````
============================= test session starts ==============================
platform darwin -- Python 3.7.0, pytest-4.0.2, py-1.7.0, pluggy-0.8.1
rootdir: requests/requests, inifile: pytest.ini
plugins: xdist-1.26.1, mock-1.10.1, httpbin-1.0.0, forked-1.0.2, cov-2.6.1
collected 11 items
__init__.py F [ 9%]
adapters.py . [ 18%]
api.py F [ 27%]
models.py F. [ 45%]
sessions.py F [ 54%]
status_codes.py F [ 63%]
utils.py F..F [100%]
=============================== FAILURES ===================================
______________________________ [doctest] requests ______________________________
010 ~~~~~~~~~~~~~~~~~~~~~
011
012 Requests is an HTTP library, written in Python, for human beings. Basic GET
013 usage:
014
015 >>> import requests
016 >>> r = requests.get('https://www.python.org')
017 >>> r.status_code
018 200
019 >>> 'Python is a programming language' in r.content
UNEXPECTED EXCEPTION: TypeError("a bytes-like object is required, not 'str'")
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/doctest.py", line 1329, in __run
compileflags, 1), test.globs)
File "<doctest requests[3]>", line 1, in <module>
TypeError: a bytes-like object is required, not 'str'
requests/requests/__init__.py:19: UnexpectedException
________________________ [doctest] requests.api.request ________________________
043 to a CA bundle to use. Defaults to ``True``.
044 :param stream: (optional) if ``False``, the response content will be immediately downloaded.
045 :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
046 :return: :class:`Response <Response>` object
047 :rtype: requests.Response
048
049 Usage::
050
051 >>> import requests
052 >>> req = requests.request('GET', 'https://httpbin.org/get')
Expected:
<Response [200]>
Got nothing
requests/requests/api.py:52: DocTestFailure
__________________ [doctest] requests.models.PreparedRequest ___________________
273 The fully mutable :class:`PreparedRequest <PreparedRequest>` object,
274 containing the exact bytes that will be sent to the server.
275
276 Generated from either a :class:`Request <Request>` object or manually.
277
278 Usage::
279
280 >>> import requests
281 >>> req = requests.Request('GET', 'https://httpbin.org/get')
282 >>> r = req.prepare()
Expected:
<PreparedRequest [GET]>
Got nothing
requests/requests/models.py:282: DocTestFailure
_____________________ [doctest] requests.sessions.Session ______________________
345 Basic Usage::
346
347 >>> import requests
348 >>> s = requests.Session()
349 >>> s.get('https://httpbin.org/get')
350 <Response [200]>
351
352 Or as a context manager::
353
354 >>> with requests.Session() as s:
UNEXPECTED EXCEPTION: SyntaxError('unexpected EOF while parsing', ('<doctest requests.sessions.Session[3]>', 1, 30, 'with requests.Session() as s:\n'))
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/doctest.py", line 1329, in __run
compileflags, 1), test.globs)
File "<doctest requests.sessions.Session[3]>", line 1
with requests.Session() as s:
^
SyntaxError: unexpected EOF while parsing
requests/requests/sessions.py:354: UnexpectedException
_______________________ [doctest] requests.status_codes ________________________
003
004 The ``codes`` object defines a mapping from common names for HTTP statuses
005 to their numerical codes, accessible either as attributes or as dictionary
006 items.
007
008 >>> requests.codes['temporary_redirect']
UNEXPECTED EXCEPTION: NameError("name 'requests' is not defined")
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/doctest.py", line 1329, in __run
compileflags, 1), test.globs)
File "<doctest requests.status_codes[0]>", line 1, in <module>
NameError: name 'requests' is not defined
requests/requests/status_codes.py:8: UnexpectedException
__________________ [doctest] requests.utils.from_key_val_list __________________
260 Take an object and test to see if it can be represented as a
261 dictionary. Unless it can not be represented as such, return an
262 OrderedDict, e.g.,
263
264 ::
265
266 >>> from_key_val_list([('key', 'val')])
267 OrderedDict([('key', 'val')])
268 >>> from_key_val_list('string')
UNEXPECTED EXCEPTION: ValueError('cannot encode objects that are not 2-tuples')
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/doctest.py", line 1329, in __run
compileflags, 1), test.globs)
File "<doctest requests.utils.from_key_val_list[1]>", line 1, in <module>
File "/Users/Ale/PycharmProjects/requests/requests/requests/utils.py", line 279, in from_key_val_list
raise ValueError('cannot encode objects that are not 2-tuples')
ValueError: cannot encode objects that are not 2-tuples
requests/requests/utils.py:268: UnexpectedException
___________________ [doctest] requests.utils.to_key_val_list ___________________
285 Take an object and test to see if it can be represented as a
286 dictionary. If it can be, return a list of tuples, e.g.,
287
288 ::
289
290 >>> to_key_val_list([('key', 'val')])
291 [('key', 'val')]
292 >>> to_key_val_list({'key': 'val'})
293 [('key', 'val')]
294 >>> to_key_val_list('string')
UNEXPECTED EXCEPTION: ValueError('cannot encode objects that are not 2-tuples')
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/doctest.py", line 1329, in __run
compileflags, 1), test.globs)
File "<doctest requests.utils.to_key_val_list[2]>", line 1, in <module>
File "/Users/Ale/PycharmProjects/requests/requests/requests/utils.py", line 303, in to_key_val_list
raise ValueError('cannot encode objects that are not 2-tuples')
ValueError: cannot encode objects that are not 2-tuples
requests/requests/utils.py:294: UnexpectedException
====================== 7 failed, 4 passed in 3.76 seconds ======================
````
## Reproduction Steps
```bash
$ py.test --doctest-module requests
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.0"
},
"platform": {
"release": "18.0.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010008f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
|
{
"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/4986/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4986/timeline
| null |
completed
| null | null | false |
[
"The PR looks good. Let's wait for the ci to go through.",
"Hi! I noticed that the related PR was merged (https://github.com/psf/requests/pull/4987) but this issue is still open. \r\nShould we close it?"
] |
https://api.github.com/repos/psf/requests/issues/4985
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4985/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4985/comments
|
https://api.github.com/repos/psf/requests/issues/4985/events
|
https://github.com/psf/requests/issues/4985
| 411,107,116 |
MDU6SXNzdWU0MTExMDcxMTY=
| 4,985 |
Need a clarification on adapters.py
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40484319?v=4",
"events_url": "https://api.github.com/users/user1493/events{/privacy}",
"followers_url": "https://api.github.com/users/user1493/followers",
"following_url": "https://api.github.com/users/user1493/following{/other_user}",
"gists_url": "https://api.github.com/users/user1493/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/user1493",
"id": 40484319,
"login": "user1493",
"node_id": "MDQ6VXNlcjQwNDg0MzE5",
"organizations_url": "https://api.github.com/users/user1493/orgs",
"received_events_url": "https://api.github.com/users/user1493/received_events",
"repos_url": "https://api.github.com/users/user1493/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/user1493/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/user1493/subscriptions",
"type": "User",
"url": "https://api.github.com/users/user1493",
"user_view_type": "public"
}
|
[
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
}
] |
closed
| true | null |
[] | null | 0 |
2019-02-16T19:56:41Z
|
2021-11-05T03:00:29Z
|
2021-08-07T02:26:47Z
|
NONE
|
resolved
|
Can someone please tell me what is the use of the below lines in **adapters.py**?
Does it actually check for a proxy and uses it in get_connection?
```
if proxy:
proxy = prepend_scheme_if_needed(proxy, 'http')
proxy_url = parse_url(proxy)
if not proxy_url.host:
raise InvalidProxyURL("Please check proxy URL. It is malformed"
" and could be missing the host.")
proxy_manager = self.proxy_manager_for(proxy)
conn = proxy_manager.connection_from_url(url)
```
My system has no proxy enabled, I confirmed the same with `netsh winhttp show proxy`
Output:
`Current WinHTTP proxy settings: Direct access (no proxy server)`
Not sure why the control is getting into `if proxy:` after `proxy = select_proxy(url, proxies)`
|
{
"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/4985/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4985/timeline
| null |
completed
| null | null | false |
[] |
https://api.github.com/repos/psf/requests/issues/4984
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4984/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4984/comments
|
https://api.github.com/repos/psf/requests/issues/4984/events
|
https://github.com/psf/requests/issues/4984
| 410,683,141 |
MDU6SXNzdWU0MTA2ODMxNDE=
| 4,984 |
requests.exceptions.InvalidProxyURL: Please check proxy URL
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40484319?v=4",
"events_url": "https://api.github.com/users/user1493/events{/privacy}",
"followers_url": "https://api.github.com/users/user1493/followers",
"following_url": "https://api.github.com/users/user1493/following{/other_user}",
"gists_url": "https://api.github.com/users/user1493/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/user1493",
"id": 40484319,
"login": "user1493",
"node_id": "MDQ6VXNlcjQwNDg0MzE5",
"organizations_url": "https://api.github.com/users/user1493/orgs",
"received_events_url": "https://api.github.com/users/user1493/received_events",
"repos_url": "https://api.github.com/users/user1493/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/user1493/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/user1493/subscriptions",
"type": "User",
"url": "https://api.github.com/users/user1493",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2019-02-15T09:43:47Z
|
2021-11-10T08:00:27Z
|
2021-08-12T07:27:19Z
|
NONE
|
resolved
|
Hi,
I created a python script to export a dimension structure. This script was then converted to an exe file using pyinstaller.
I then called this exe file via cmd in my machine. The exe worked and exported the data.
But when I used this exe in another machine, it gave out the highlighted error. Any idea how to sort this out?
code:
```
import configparser
import os
import sys cube_name = sys.argv[1]
config = configparser.ConfigParser()
cwd = os.getcwd()
config.read(os.path.join(cwd, 'config.ini'))
metadata_file = os.path.join(cwd, cube_name+'.xlsx')
import pandas as pd
from TM1py.Services import TM1Service
from TM1py.Utils import Utils
with TM1Service(**config['USCPADM_SIT']) as tm1:
all_cubes = tm1.cubes.get(cube_name)
dims = all_cubes.dimensions
with pd.ExcelWriter(metadata_file) as writer:
for dim in dims:
df = []
dimension = tm1.dimensions.get(dim) for hierarchy in dimension: for element in hierarchy:
df.append(element.name) pd.DataFrame(df).to_excel(writer, sheet_name=dim, header=False,
index=False)
```
Error:
```
Traceback (most recent call last): File "dim.py", line 16, in
File "site-packages\TM1py\Services\TM1Service.py", line 12, in **init**
File "site-packages\TM1py\Services\RESTService.py", line 96, in **init**
File "site-packages\TM1py\Services\RESTService.py", line 169, in _start_session
File "site-packages\requests\sessions.py", line 525, in get
File "site-packages\requests\sessions.py", line 512, in request
File "site-packages\requests\sessions.py", line 622, in send
File "site-packages\requests\adapters.py", line 388, in send
File "site-packages\requests\adapters.py", line 292, in get_connection
requests.exceptions.InvalidProxyURL: Please check proxy URL. It is malformed and could be missing the host. [10048] Failed to execute script dim
```
I tested the proxy settings in both the machines and the results were same:
`netsh winhttp show proxy`
**Current WinHTTP proxy settings:**
**Direct access (no proxy server).**
|
{
"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/4984/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4984/timeline
| null |
completed
| null | null | false |
[
"I still don't have the expertise required to help you with that issue, but I suggest you edit the issue formatting to make it easier for maintainers to understand the problem.\r\n\r\nPut triple backticks (```) around multi-line code (in that case, both **code** and **error**) and keep the line breaks.\r\nE.g.:\r\n\r\n ```\r\n code goes here\r\n including line breaks\r\n ```\r\n\r\nThanks!",
"Sorry about the way I posted the question. I'm totally new to Github, still learning.\r\nThanks for quick tip!",
"It's okay, Github's markdown can be confusing sometimes.\r\n\r\nYou're almost there, just need to put line breaks before each triple backtick (```) exactly like I exemplified in my previous comment.",
"Thanks! But I still have my clarifications, hope someone would help me out.",
"@timofurrer do you know who can investigate this issue?",
"No idea, I started checking it myself. Will provide an update here if I find the solution.",
"My second machine has no proxy enabled, I confirmed the same with `netsh winhttp show proxy`\r\nOutput:\r\n`Current WinHTTP proxy settings: Direct access (no proxy server)`\r\n\r\nNot sure why the control is getting into `if proxy:` after `proxy = select_proxy(url, proxies)`\r\n\r\nSo I removed the below lines (288 - 296) from **adapters.py** and created the executable file again. I used this new executable file in the second machine, now the file worked successfully.\r\n\r\n```\r\n if proxy:\r\n proxy = prepend_scheme_if_needed(proxy, 'http')\r\n proxy_url = parse_url(proxy)\r\n if not proxy_url.host:\r\n raise InvalidProxyURL(\"Please check proxy URL. It is malformed\"\r\n \" and could be missing the host.\")\r\n proxy_manager = self.proxy_manager_for(proxy)\r\n conn = proxy_manager.connection_from_url(url)\r\n else:\r\n```\r\nI used this as a workaround, please let me know how to fix this permanently.",
"This looks like a bug in the library, can someone please investigate on this?"
] |
https://api.github.com/repos/psf/requests/issues/4983
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4983/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4983/comments
|
https://api.github.com/repos/psf/requests/issues/4983/events
|
https://github.com/psf/requests/pull/4983
| 410,599,001 |
MDExOlB1bGxSZXF1ZXN0MjUzMzAzOTM4
| 4,983 |
Add trusted domains
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/29538756?v=4",
"events_url": "https://api.github.com/users/jaketreacher/events{/privacy}",
"followers_url": "https://api.github.com/users/jaketreacher/followers",
"following_url": "https://api.github.com/users/jaketreacher/following{/other_user}",
"gists_url": "https://api.github.com/users/jaketreacher/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jaketreacher",
"id": 29538756,
"login": "jaketreacher",
"node_id": "MDQ6VXNlcjI5NTM4NzU2",
"organizations_url": "https://api.github.com/users/jaketreacher/orgs",
"received_events_url": "https://api.github.com/users/jaketreacher/received_events",
"repos_url": "https://api.github.com/users/jaketreacher/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jaketreacher/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jaketreacher/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jaketreacher",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-02-15T04:21:37Z
|
2021-08-30T00:06:42Z
|
2019-08-20T04:23:53Z
|
CONTRIBUTOR
|
resolved
|
Solution for #2949
Allows setting a list of domains that are "trusted", so the authorization header isn't stripped upon being redirected there.
Default functionality remains unchanged.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4983/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4983/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4983.diff",
"html_url": "https://github.com/psf/requests/pull/4983",
"merged_at": "2019-08-20T04:23:53Z",
"patch_url": "https://github.com/psf/requests/pull/4983.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4983"
}
| true |
[
"elegant solution! I approve.",
"This seems to have broken Python 2.7 compatibility (see issue #5175 and my PR #5182)"
] |
https://api.github.com/repos/psf/requests/issues/4982
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4982/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4982/comments
|
https://api.github.com/repos/psf/requests/issues/4982/events
|
https://github.com/psf/requests/issues/4982
| 410,569,610 |
MDU6SXNzdWU0MTA1Njk2MTA=
| 4,982 |
Requests returns 200 for a url that is invalid
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9022863?v=4",
"events_url": "https://api.github.com/users/ReddyKilowatt/events{/privacy}",
"followers_url": "https://api.github.com/users/ReddyKilowatt/followers",
"following_url": "https://api.github.com/users/ReddyKilowatt/following{/other_user}",
"gists_url": "https://api.github.com/users/ReddyKilowatt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ReddyKilowatt",
"id": 9022863,
"login": "ReddyKilowatt",
"node_id": "MDQ6VXNlcjkwMjI4NjM=",
"organizations_url": "https://api.github.com/users/ReddyKilowatt/orgs",
"received_events_url": "https://api.github.com/users/ReddyKilowatt/received_events",
"repos_url": "https://api.github.com/users/ReddyKilowatt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ReddyKilowatt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ReddyKilowatt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ReddyKilowatt",
"user_view_type": "public"
}
|
[
{
"color": "fef2c0",
"default": false,
"description": null,
"id": 298537994,
"name": "Needs More Information",
"node_id": "MDU6TGFiZWwyOTg1Mzc5OTQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Needs%20More%20Information"
}
] |
closed
| true | null |
[] | null | 2 |
2019-02-15T01:48:38Z
|
2021-09-05T00:06:58Z
|
2019-02-15T17:29:23Z
|
NONE
|
resolved
|
Summary.
## Expected Result
requests should return 404 for an invalid url
What you expected.
status_code should be 404
## Actual Result
status_code was 200
What happened instead.
status_code was 200
## Reproduction Steps
```python
import requests
# this is a VALID url
req = requests.get("https://talkpython.fm/episodes/transcript/96/exploring-awesome-python")
print(req.status_code)
```
200 is displayed
```python
import requests
# this is a BAD url
req = requests.get("https://talkpython.fm/episodes/transcript/this_ur_is_just-WRONG")
print(req.status_code)
```
200 is displayed SHOULD display 404
## System Information
Windows 7, Pro 64-Bit
conda 4.6.2
$ python -m requests.help
```
(py36sci) C:\>python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.5"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.6.6"
},
"platform": {
"release": "7",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "1010101f",
"version": "19.0.0"
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "100020ff"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": true
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
(py36sci) C:\>python
Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 11:48:23) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9022863?v=4",
"events_url": "https://api.github.com/users/ReddyKilowatt/events{/privacy}",
"followers_url": "https://api.github.com/users/ReddyKilowatt/followers",
"following_url": "https://api.github.com/users/ReddyKilowatt/following{/other_user}",
"gists_url": "https://api.github.com/users/ReddyKilowatt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ReddyKilowatt",
"id": 9022863,
"login": "ReddyKilowatt",
"node_id": "MDQ6VXNlcjkwMjI4NjM=",
"organizations_url": "https://api.github.com/users/ReddyKilowatt/orgs",
"received_events_url": "https://api.github.com/users/ReddyKilowatt/received_events",
"repos_url": "https://api.github.com/users/ReddyKilowatt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ReddyKilowatt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ReddyKilowatt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ReddyKilowatt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4982/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4982/timeline
| null |
completed
| null | null | false |
[
"Hi @ReddyKilowatt,\r\n\r\nI'm not able to reproduce this bug: \r\n```\r\n$ try requests==2.21.0\r\n==> Use python python3.6\r\n[*] Downloading packages: requests==2.21.0\r\nPython 3.6.7 (default, Oct 22 2018, 11:32:17) \r\n[GCC 8.2.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> valid_request = requests.get(\"https://talkpython.fm/episodes/transcript/96/exploring-awesome-python\")\r\n>>> print(valid_request.status_code)\r\n200\r\n>>> invalid_request = requests.get(\"https://talkpython.fm/episodes/transcript/this_ur_is_just-WRONG\")\r\n>>> print(invalid_request.status_code)\r\n404\r\n```\r\n\r\nCan you double check it please? Thanks!",
"I've talked to the site maintainer and he confirmed it was a server issue and quickly fixed it.\r\nI'm now seeing the expected 404 value.\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4981
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4981/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4981/comments
|
https://api.github.com/repos/psf/requests/issues/4981/events
|
https://github.com/psf/requests/issues/4981
| 409,522,201 |
MDU6SXNzdWU0MDk1MjIyMDE=
| 4,981 |
Requests does not properly set skip_accept_encoding on httplib
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39321046?v=4",
"events_url": "https://api.github.com/users/cyberfox1/events{/privacy}",
"followers_url": "https://api.github.com/users/cyberfox1/followers",
"following_url": "https://api.github.com/users/cyberfox1/following{/other_user}",
"gists_url": "https://api.github.com/users/cyberfox1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cyberfox1",
"id": 39321046,
"login": "cyberfox1",
"node_id": "MDQ6VXNlcjM5MzIxMDQ2",
"organizations_url": "https://api.github.com/users/cyberfox1/orgs",
"received_events_url": "https://api.github.com/users/cyberfox1/received_events",
"repos_url": "https://api.github.com/users/cyberfox1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cyberfox1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cyberfox1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cyberfox1",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-02-12T22:06:18Z
|
2021-09-05T00:07:02Z
|
2019-02-13T13:36:56Z
|
NONE
|
resolved
|
The result is an illegal and unwanted header Accept-Encoding is added to the requests.
|
{
"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/4981/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4981/timeline
| null |
completed
| null | null | false |
[
"Requests does not communicate directly with httplib but uses urllib3."
] |
https://api.github.com/repos/psf/requests/issues/4980
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4980/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4980/comments
|
https://api.github.com/repos/psf/requests/issues/4980/events
|
https://github.com/psf/requests/issues/4980
| 409,491,002 |
MDU6SXNzdWU0MDk0OTEwMDI=
| 4,980 |
I think there is a bug with supporting multi-part POST with multiple files, and one JSON body
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1434642?v=4",
"events_url": "https://api.github.com/users/Carmageddon/events{/privacy}",
"followers_url": "https://api.github.com/users/Carmageddon/followers",
"following_url": "https://api.github.com/users/Carmageddon/following{/other_user}",
"gists_url": "https://api.github.com/users/Carmageddon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Carmageddon",
"id": 1434642,
"login": "Carmageddon",
"node_id": "MDQ6VXNlcjE0MzQ2NDI=",
"organizations_url": "https://api.github.com/users/Carmageddon/orgs",
"received_events_url": "https://api.github.com/users/Carmageddon/received_events",
"repos_url": "https://api.github.com/users/Carmageddon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Carmageddon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Carmageddon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Carmageddon",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2019-02-12T20:42:09Z
|
2021-09-05T00:07:02Z
|
2019-02-13T13:35:59Z
|
NONE
|
resolved
|
Summary.
## Expected Result
I expect that I can expand this code which works for ONE zip "files" file, and JSON message body, to be expandable to 2 or more ZIP files along with the JSON body:
```
multipart_form_data_object_orig = {
'files': (args.files[0], open(args.files[0], 'rb'), "application/json"),
'message': (None, open(args.message, 'rb'), 'application/json')
}
response = requests.post(args.url + ':' + str(args.port) + '/' + args.endpoint, files=multipart_form_data_object_orig,
proxies=proxies)
```
## Actual Result
When I add a second element `'files': (args.files[1], open(args.files[1], 'rb'), "application/json"),`, one overwrites the other.
In Curl, we can do -F "[email protected],file2.zip" and both are properly passed
What happened instead.
## Reproduction Steps
```python
import requests
##args handling stuff..
multipart_form_data_object_orig = {
'files': (args.files[0], open(args.files[0], 'rb'), "application/json"),
'files': (args.files[1], open(args.files[1], 'rb'), "application/json"),
'message': (None, open(args.message, 'rb'), 'application/json')
}
response = requests.post(args.url + ':' + str(args.port) + '/' + args.endpoint, files=multipart_form_data_object_orig)
```
The JAVA API is only seeing one file in the files array, while Curl's request shows 2 files.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "2.7.15"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "100020ff"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
There is a comperhensive question on StackOverflow I posted with all the variations to requests I tried to do in order to reproduce the CURL request:
https://stackoverflow.com/questions/54656686/python-requests-emulate-a-curl-post-sending-multipart-request-with-1-or-more-fil
Including the comparison of what httpbin shows for CURL, and for Python - they are DIFFERENT, and I was unable to find a way to make them identical, hence I believe this must be a bug in Requests, since this is a rarely used capability in APIs...
|
{
"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/4980/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4980/timeline
| null |
completed
| null | null | false |
[
"Hi there! Thanks for opening this issue. 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 inspect your `multipart_form_data_object_orig` dictionary and read up on how dictionaries in Python work."
] |
https://api.github.com/repos/psf/requests/issues/4979
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4979/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4979/comments
|
https://api.github.com/repos/psf/requests/issues/4979/events
|
https://github.com/psf/requests/issues/4979
| 409,359,816 |
MDU6SXNzdWU0MDkzNTk4MTY=
| 4,979 |
iter_content returned size is far bigger than chunk_size
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/566650?v=4",
"events_url": "https://api.github.com/users/impredicative/events{/privacy}",
"followers_url": "https://api.github.com/users/impredicative/followers",
"following_url": "https://api.github.com/users/impredicative/following{/other_user}",
"gists_url": "https://api.github.com/users/impredicative/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/impredicative",
"id": 566650,
"login": "impredicative",
"node_id": "MDQ6VXNlcjU2NjY1MA==",
"organizations_url": "https://api.github.com/users/impredicative/orgs",
"received_events_url": "https://api.github.com/users/impredicative/received_events",
"repos_url": "https://api.github.com/users/impredicative/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/impredicative/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/impredicative/subscriptions",
"type": "User",
"url": "https://api.github.com/users/impredicative",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2019-02-12T15:34:16Z
|
2021-11-05T03:00:28Z
|
2021-08-07T02:28:52Z
|
NONE
|
resolved
|
I expect `iter_content` to return me `chunk_size` number of bytes, but it never does. It returns me a far larger and random number of bytes. In contrast, `urllib.request` returns me exactly the number of bytes I request using its `.read(chunk_size)` method.
It is not acceptable for the returned chunk to use up to 5x more memory as evidenced below. Imagine this happening in say 64 threads at once. It should return exactly the number of bytes I asked for (or less at the end).
## Expected Result
```python
>>> import requests
>>> requests.__version__
'2.21.0'
>>> req = requests.get('http://docs.python-requests.org/en/latest/user/advanced/', stream=True)
>>> it = req.iter_content(8192)
>>> len(next(it))
8192
>>> len(next(it))
8192
>>> len(next(it))
8192
```
## Actual Result
```python
>>> import requests
>>> requests.__version__
'2.21.0'
>>> req = requests.get('http://docs.python-requests.org/en/latest/user/advanced/', stream=True)
>>> it = req.iter_content(8192)
>>> len(next(it))
3345
>>> len(next(it))
48672
>>> len(next(it))
47182
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.2"
},
"platform": {
"release": "4.18.0-15-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010007f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": false
}
```
|
{
"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": 5,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 5,
"url": "https://api.github.com/repos/psf/requests/issues/4979/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4979/timeline
| null |
completed
| null | null | false |
[
"The docs mention that the returned item length may be different because of decoding, so I believe this is expected behavior.\r\n\r\n> The chunk size is the number of bytes it should read into memory. This is not necessarily the length of each item returned as decoding can take place.\r\n\r\n(See [docs for Response.iter_content](http://docs.python-requests.org/en/master/api/#requests.Response.iter_content))\r\n\r\nEDIT: @kenneth-reitz can you confirm this?",
"It may be documented and expected, but then the chunk_size loses any value for the user. urllib has no such problem. It works perfectly all the time for `read()` and returns exactly the number of bytes that were asked for. Please consider using an internal buffer or such for the extra bytes that the user hasn't asked for. Returning fewer bytes than chunk_size is even worse! I thought `requests` was supposed to present a clean and friendly interface to the user. For a GET request, the user may not care about how many bytes are internally read behind the scenes, as long as it's somewhat close to chunk_size.",
"this is expected behavior, if what you're saying is correct @rHuggler ",
"Does the problem go away if you don't use compression?"
] |
https://api.github.com/repos/psf/requests/issues/4978
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4978/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4978/comments
|
https://api.github.com/repos/psf/requests/issues/4978/events
|
https://github.com/psf/requests/pull/4978
| 409,296,677 |
MDExOlB1bGxSZXF1ZXN0MjUyMzE0MjYz
| 4,978 |
Fix double image request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/791279?v=4",
"events_url": "https://api.github.com/users/sayzlim/events{/privacy}",
"followers_url": "https://api.github.com/users/sayzlim/followers",
"following_url": "https://api.github.com/users/sayzlim/following{/other_user}",
"gists_url": "https://api.github.com/users/sayzlim/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sayzlim",
"id": 791279,
"login": "sayzlim",
"node_id": "MDQ6VXNlcjc5MTI3OQ==",
"organizations_url": "https://api.github.com/users/sayzlim/orgs",
"received_events_url": "https://api.github.com/users/sayzlim/received_events",
"repos_url": "https://api.github.com/users/sayzlim/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sayzlim/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sayzlim/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sayzlim",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2019-02-12T13:26:21Z
|
2021-08-30T00:06:46Z
|
2019-08-20T04:21:13Z
|
CONTRIBUTOR
|
resolved
|
Use official framework for the "custom" ad design integration.
|
{
"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/4978/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4978/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4978.diff",
"html_url": "https://github.com/psf/requests/pull/4978",
"merged_at": "2019-08-20T04:21:13Z",
"patch_url": "https://github.com/psf/requests/pull/4978.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4978"
}
| true |
[
"screenshot?",
"Same as before, only the minor changes.\r\n\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4977
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4977/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4977/comments
|
https://api.github.com/repos/psf/requests/issues/4977/events
|
https://github.com/psf/requests/issues/4977
| 408,796,220 |
MDU6SXNzdWU0MDg3OTYyMjA=
| 4,977 |
QUESTION: How does content length of chunked encoded data is decided?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16623935?v=4",
"events_url": "https://api.github.com/users/mzfr/events{/privacy}",
"followers_url": "https://api.github.com/users/mzfr/followers",
"following_url": "https://api.github.com/users/mzfr/following{/other_user}",
"gists_url": "https://api.github.com/users/mzfr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mzfr",
"id": 16623935,
"login": "mzfr",
"node_id": "MDQ6VXNlcjE2NjIzOTM1",
"organizations_url": "https://api.github.com/users/mzfr/orgs",
"received_events_url": "https://api.github.com/users/mzfr/received_events",
"repos_url": "https://api.github.com/users/mzfr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mzfr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mzfr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mzfr",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2019-02-11T14:03:27Z
|
2021-09-05T00:07:03Z
|
2019-02-11T15:19:19Z
|
NONE
|
resolved
|
I am trying to use [treq](https://github.com/twisted/treq/) for downloading a file from https://speed.hetzner.de/100MB.bin (this link is just for testing). Now if I use requests to send a get the file like
```python
import requests
url = 'https://speed.hetzner.de/100MB.bin'
r = requests.get(url)
```
I get the content and checking the headers
```python
>>> r.headers
{'Server': 'nginx', 'Date': 'Mon, 11 Feb 2019 13:51:08 GMT', 'Content-Type': 'application/octet-stream', 'Content-Length': '104857600', 'Last-Modified': 'Tue, 08 Oct 2013 11:48:13 GMT', 'Connection': 'keep-alive', 'ETag': '"5253f0fd-6400000"', 'Strict-Transport-Security': 'max-age=15768000; includeSubDomains', 'Accept-Ranges': 'bytes'}
```
We can see the content length i.e 104857600 but If I do the same thing with treq and then try to find the response `Content-Length` then it returns `unknow size`.
I have talked on treq mailing list and they told me
```
Do you have Chunked encoding
https://en.wikipedia.org/wiki/Chunked_transfer_encoding
In this case, the content length is not advertised in the response headers.
```
So I just wanted to know how does `requests` shows the content length? Is there any special function in requests that finds out the content length of such kind of files?
Thanks
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4977/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4977/timeline
| null |
completed
| null | null | false |
[
"We don't. You seem to be encountering a different path on the server than `treq` for unknown reasons. If the server sent back headers we present them, otherwise we do not magically replace or misrepresent what the server sent.",
"@sigmavirus24 I apologize if it a dumb question but I tried requests with the following URL: https://heyguys.cc/ and I got the `content-length: 1615` but I don't see any content-length header when I am seeing the request in the raw headers of Firefox developer tool. Do you mind telling me why that could be?",
"Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here."
] |
https://api.github.com/repos/psf/requests/issues/4976
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4976/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4976/comments
|
https://api.github.com/repos/psf/requests/issues/4976/events
|
https://github.com/psf/requests/pull/4976
| 408,472,870 |
MDExOlB1bGxSZXF1ZXN0MjUxNjk5NzUw
| 4,976 |
Fix for response with UTF-8 BOM
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16357187?v=4",
"events_url": "https://api.github.com/users/eduardomourar/events{/privacy}",
"followers_url": "https://api.github.com/users/eduardomourar/followers",
"following_url": "https://api.github.com/users/eduardomourar/following{/other_user}",
"gists_url": "https://api.github.com/users/eduardomourar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/eduardomourar",
"id": 16357187,
"login": "eduardomourar",
"node_id": "MDQ6VXNlcjE2MzU3MTg3",
"organizations_url": "https://api.github.com/users/eduardomourar/orgs",
"received_events_url": "https://api.github.com/users/eduardomourar/received_events",
"repos_url": "https://api.github.com/users/eduardomourar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/eduardomourar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/eduardomourar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/eduardomourar",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 10 |
2019-02-09T21:30:47Z
|
2021-08-29T00:07:10Z
|
2019-08-20T04:27:00Z
|
CONTRIBUTOR
|
resolved
|
As per discussion in the PR [Azure/msrest-for-python/#145](https://github.com/Azure/msrest-for-python/pull/145), there some issues with server responses (specially from Microsoft) that have BOM in it. You can see errors in the tests from my branch [here](https://github.com/eduardomourar/requests/runs/61195184) reproducing the same behavior when trying to parse both text and JSON.
This has been fixed by forcing encoding to `utf-8-sig` when HTTP header has signalized `utf-8` or leave to _chardet_ when no encoding has been identified. That way the parsing works as expected and no errors are thrown.
|
{
"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/4976/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4976/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4976.diff",
"html_url": "https://github.com/psf/requests/pull/4976",
"merged_at": "2019-08-20T04:27:00Z",
"patch_url": "https://github.com/psf/requests/pull/4976.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4976"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4976?src=pr&el=h1) Report\n> Merging [#4976](https://codecov.io/gh/requests/requests/pull/4976?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/c9309e4c59acfa757b34619205794e18f2009c43?src=pr&el=desc) will **increase** coverage by `0.04%`.\n> The diff coverage is `100%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4976?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4976 +/- ##\n==========================================\n+ Coverage 66.89% 66.94% +0.04% \n==========================================\n Files 15 15 \n Lines 1577 1579 +2 \n==========================================\n+ Hits 1055 1057 +2 \n Misses 522 522\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4976?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/4976/diff?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `77.45% <100%> (+0.1%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4976?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/4976?src=pr&el=footer). Last update [c9309e4...19cff44](https://codecov.io/gh/requests/requests/pull/4976?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"So I'm not certain this is actually the right place to fix this. I need to do more research to figure out how backwards compatible this actually is.\r\n\r\nAs a work-around, one can forcibly override `encoding` on a `Response` to deal with this. Especially in a library like you describe, if they know this is an issue they can (via their wrapper) do `r.encoding = 'utf-8-sig' if r.encoding == 'utf-8' else r.encoding`",
"@sigmavirus24 , thanks! We are using the approach you mentioned in the msrest library, but I believe other libraries will experience this issue. The issue being that RFC 7159 does not allow BOM and `json` python library throws an error rightfully so. I believe using `utf-8-sig` encode we will be normalizing the data and it will avoid errors when parsing as JSON, XML, etc.",
"RFC 7159 does not allow BOM's on UTF8, correct. How does that apply to XML?",
"Aha, to quote the [codecs][] documentation:\r\n\r\n\r\n```\r\nTo increase the reliability with which a UTF-8 encoding can be detected, Microsoft invented a variant of UTF-8 (that Python 2.5 calls \"utf-8-sig\") for its Notepad program: Before any of the Unicode characters is written to the file, a UTF-8 encoded BOM (which looks like this as a byte sequence: 0xef, 0xbb, 0xbf) is written. As it’s rather improbable that any charmap encoded file starts with these byte values (which would e.g. map to\r\n\r\n LATIN SMALL LETTER I WITH DIAERESIS\r\n RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK\r\n INVERTED QUESTION MARK\r\n\r\nin iso-8859-1), this increases the probability that a utf-8-sig encoding can be correctly guessed from the byte sequence. So here the BOM is not used to be able to determine the byte order used for generating the byte sequence, but as a signature that helps in guessing the encoding. On encoding the utf-8-sig codec will write 0xef, 0xbb, 0xbf as the first three bytes to the file. On decoding utf-8-sig will skip those three bytes if they appear as the first three bytes in the file. In UTF-8, the use of the BOM is discouraged and should generally be avoided.\r\n```\r\n\r\nThe important part here is that `utf-8-sig` is special in that it will ignore Microsoft's nonsense that they implemented against the specification. (`On decoding utf-8-sig will skip those three bytes if they appear as the first three bytes in the file.`) This leads me to believe (probably incorrectly) that this would be backwards compatible with what we had previously.\r\n\r\n\r\n[codecs]: https://docs.python.org/3/library/codecs.html#encodings-and-unicode",
"> RFC 7159 does not allow BOM's on UTF8, correct. How does that apply to XML?\r\n\r\nIt doesn't apply directly. But, if you take a look into the test log from my branch (https://travis-ci.com/eduardomourar/requests/jobs/176565327), an error will be thrown when running `response.text`. And usually that would be the input for libraries such as `ElementTree`. ",
"Regarding backward compatibility, I believe we are covered too. The code will influence as little as possible because we are not replacing `Response.encoding` we are only temporary switching it when getting the decoded content. The only issue that user might find is that the size will be 3 bytes less than before (like you mentioned).",
"@sigmavirus24 , is there anything needed here from my side?",
"@kennethreitz, @sigmavirus24 and @nateprewitt , could you help with this PR, please?",
"fantastic work!"
] |
https://api.github.com/repos/psf/requests/issues/4965
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4965/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4965/comments
|
https://api.github.com/repos/psf/requests/issues/4965/events
|
https://github.com/psf/requests/issues/4965
| 407,445,365 |
MDU6SXNzdWU0MDc0NDUzNjU=
| 4,965 |
Accessing response.content twice removes forgets read error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/17047541?v=4",
"events_url": "https://api.github.com/users/tlandschoff-scale/events{/privacy}",
"followers_url": "https://api.github.com/users/tlandschoff-scale/followers",
"following_url": "https://api.github.com/users/tlandschoff-scale/following{/other_user}",
"gists_url": "https://api.github.com/users/tlandschoff-scale/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tlandschoff-scale",
"id": 17047541,
"login": "tlandschoff-scale",
"node_id": "MDQ6VXNlcjE3MDQ3NTQx",
"organizations_url": "https://api.github.com/users/tlandschoff-scale/orgs",
"received_events_url": "https://api.github.com/users/tlandschoff-scale/received_events",
"repos_url": "https://api.github.com/users/tlandschoff-scale/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tlandschoff-scale/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tlandschoff-scale/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tlandschoff-scale",
"user_view_type": "public"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 117744,
"name": "Bug",
"node_id": "MDU6TGFiZWwxMTc3NDQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Bug"
}
] |
open
| false | null |
[] | null | 1 |
2019-02-06T21:46:17Z
|
2020-02-18T22:37:17Z
| null |
NONE
| null |
I had a hard debugging time today because an error in the response stream is only reported when accessing `response.content` for the first time.
This is especially irritating when running code in a debugger.
## Expected Result
If accessing `response.content` the first time raises an exception I would expect that accessing `response.content` again would also raise an exception (ideally the same).
## Actual Result
Instead after raising on the first get, getting `response.content` again returns an empty string.
## Reproduction Steps
Here is a patch with a new test case for this: [error_replay_test.diff.gz](https://github.com/requests/requests/files/2838360/error_replay_test.diff.gz).
Basically, it boils down to this:
```python
import requests
response = requests.post("http://connreset.biz/get/incomplete/chunked", stream=True)
try:
response.content
except Exception:
# Error handling code, may try something else or fall through
pass
content = response.content # empty string
```
Output of my test case:
```
$ pipenv run py.test tests/test_lowlevel.py -q --tb=short -k retain
F [100%]
============================= FAILURES =============================
_______________ test_response_content_retains_error ________________
tests/test_lowlevel.py:343: in test_response_content_retains_error
assert False, "error response has content: {0!r}".format(content)
E AssertionError: error response has content: ''
E assert False
1 failed, 15 deselected in 0.60 seconds
```
## System Information
$ python -m requests.help
*Edit*: Oops, I used `pipenv run python -m requests.help` which actually called into system python 2.7. Here comes the real data:
```
$ pipenv run python3 -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.6.8+"
},
"platform": {
"release": "4.15.0-43-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.24"
},
"using_pyopenssl": false
}
```
Thanks for looking into this!
| 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/4965/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4965/timeline
| null | null | null | null | false |
[
"It looks like we never closed the issue after the PR was merged. I'm reverting #5087 because it doesn't cover all of our read APIs (`content`, `iter_content`, `iter_lines`, `text`, `__iter__`) uniformly.\r\n\r\nI took a quick pass but the edge cases the tests are missing aren't something I can get resolved today. We can reopen a new PR and revisit options later if anyone wants."
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.