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... |
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 m... |
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: HTTPSConnectionPoo... |
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-... |
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 pro... |
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... |
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 yo... |
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... |
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... |
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, ... |
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... |
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, confi... |
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, header... |
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 ... |
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 ... |
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 some... |
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 thi... |
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 no... |
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... |
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... |
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:... |
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 ... |
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 sufficien... |
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?... |
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 ... |
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:password@127.0.0.1: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=aHR0cHM6Ly9hbGV4Z2F... |
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 ... |
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}... | 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... |
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:somepassw@httpbin.org/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:somepassw@httpbin.org/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:somepassw@httpbin.org/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... |
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 ... |
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 La... |
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... |
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://nanochancsvnej4vxiidu4fhpchkxffl3mgqypub63xadeet... |
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(... |
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 OpenOff... |
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... |
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:... |
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 __Pytho... |
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... |
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... |
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... |
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 sp... |
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 wou... |
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... |
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,
... | 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... |
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 i... |
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 "files=@file.zip,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_or... |
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... |
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 follo... |
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... |
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. ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.