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/4461
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4461/labels{/name}
https://api.github.com/repos/psf/requests/issues/4461/comments
https://api.github.com/repos/psf/requests/issues/4461/events
https://github.com/psf/requests/issues/4461
287,815,865
MDU6SXNzdWUyODc4MTU4NjU=
4,461
couldn't access iter_contents()
{ "avatar_url": "https://avatars.githubusercontent.com/u/9799869?v=4", "events_url": "https://api.github.com/users/kpputhiyattil/events{/privacy}", "followers_url": "https://api.github.com/users/kpputhiyattil/followers", "following_url": "https://api.github.com/users/kpputhiyattil/following{/other_user}", "gists_url": "https://api.github.com/users/kpputhiyattil/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kpputhiyattil", "id": 9799869, "login": "kpputhiyattil", "node_id": "MDQ6VXNlcjk3OTk4Njk=", "organizations_url": "https://api.github.com/users/kpputhiyattil/orgs", "received_events_url": "https://api.github.com/users/kpputhiyattil/received_events", "repos_url": "https://api.github.com/users/kpputhiyattil/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kpputhiyattil/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kpputhiyattil/subscriptions", "type": "User", "url": "https://api.github.com/users/kpputhiyattil", "user_view_type": "public" }
[]
closed
true
null
[]
null
15
2018-01-11T15:00:55Z
2021-09-08T04:00:52Z
2018-01-12T05:40:43Z
NONE
resolved
Summary. ## Expected Result What you expected. Need to download the file ## Actual Result What happened instead. AttributeError: 'None Tye' object has no attribute 'Read' ## Reproduction Steps ```python import requests import requests.models #url to login url = 'xxxx.com' payload = {'loginName': 'userName', 'password': '123456'} r = requests.post(url, data=payload) print r.headers print r.cookies url_dwnload="#download url" payload = {'fileId': 2028, 'blockSize':1024} resp_obj = requests.get(url_dwnload, cookies=r.cookies, params=payload, stream=True) for c in resp_obj.cookies: if c.name == 'DOWNLOAD_STATUS': if c.value == 'SUCCESS': with open( r'C:\Users\test\AppData\Local\SmartDocs\agent220.smartdocsonline.com\ruby.paul\tempfolder\6\New Text Document - Copy.txt.gz', 'wb') as f: for chunk in resp_obj.iter_content( chunk_size=1024): if chunk: # print('###') f.write(chunk) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.10" }, "platform": { "release": "8", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000201f" }, "urllib3": { "version": "1.22" }, "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": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4461/reactions" }
https://api.github.com/repos/psf/requests/issues/4461/timeline
null
completed
null
null
false
[ "I couldn't access iter_content() after importing requests when i called from visual studio professional 2015, but can be accessed if called from pycharm.", "The feature template is there to make sure we get the information we need to help you. Could you fill out the entire template?", "```py\r\nimport requests\r\nimport requests.models\r\n#url to login\r\nurl = 'xxxx.com'\r\npayload = {'loginName': 'userName', 'password': '123456'}\r\n\r\nr = requests.post(url, data=payload)\r\nprint r.headers\r\nprint r.cookies\r\n\r\nurl_dwnload=\"#download url\"\r\npayload = {'fileId': 2028, 'blockSize':1024}\r\n\r\nresp_obj = requests.get(url_dwnload, cookies=r.cookies, params=payload, stream=True)\r\nfor c in resp_obj.cookies:\r\n\r\n if c.name == 'DOWNLOAD_STATUS':\r\n if c.value == 'SUCCESS':\r\n with open(\r\n r'C:\\Users\\test\\AppData\\Local\\SmartDocs\\agent220.smartdocsonline.com\\ruby.paul\\tempfolder\\6\\New Text Document - Copy.txt.gz', 'wb') as f:\r\n for chunk in resp_obj.iter_content( chunk_size=1024):\r\n if chunk:\r\n # print('###')\r\n f.write(chunk)\r\n\r\nl = requests.get(url_dwnload, cookies=r.cookies, params=payload, stream=True)\r\n```\r\n\r\nThis is the code i was using", "Can you follow each part of the template, including what the output of `python -m requests.help`?\r\nAlso what is the output and error you're receiving when you run your code?", "Please check {\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"2.7.10\"\r\n },\r\n \"platform\": {\r\n \"release\": \"8\",\r\n \"system\": \"Windows\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1000201f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n },\r\n \"using_pyopenssl\": false\r\n}\r\n", "As I asked above, what does your code output? This is the reason that the template exists, so that all of this information is given to people that want to help you. Please use it in the future.", "Hi,\nI am getting the output as below,\n{'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'Set-Cookie':\n'_app_vis_id_=77840FFCDD7B64EF18ECFE48A9517BC4; Path=/server/; Secure;\nHttpOnly', 'Vary': 'Accept-Encoding', 'Server': 'SmartDocs Web Server',\n'Connection': 'keep-alive', 'Date': 'Thu, 11 Jan 2018 15:23:43 GMT',\n'Content-Type': 'application/json;charset=UTF-8'}\n<RequestsCookieJar[<Cookie _app_vis_id_=77840FFCDD7B64EF18ECFE48A9517BC4\nfor agent220.smartdocsonline.com/server/>]>\nTraceback (most recent call last):\n File \"C:\\Users\\Krishna\\Documents\\Visual Studio\n2015\\Projects\\PythonApplication2\\PythonApplication2.py\", line 20, in\n<module>\n for chunk in resp_obj.iter_content( chunk_size=1024):\n File \"C:\\Python27\\lib\\site-packages\\requests\\models.py\", line 745, in\ngenerate\n for chunk in self.raw.stream(chunk_size, decode_content=True):\n File \"C:\\Python27\\lib\\site-packages\\urllib3\\response.py\", line 432, in\nstream\n for line in self.read_chunked(amt, decode_content=decode_content):\n File \"C:\\Python27\\lib\\site-packages\\urllib3\\response.py\", line 601, in\nread_chunked\n chunk = self._handle_chunk(amt)\n File \"C:\\Python27\\lib\\site-packages\\urllib3\\response.py\", line 566, in\n_handle_chunk\n returned_chunk = self._fp._safe_read(self.chunk_left)\n File \"C:\\Python27\\lib\\httplib.py\", line 703, in _safe_read\n chunk = self.fp.read(min(amt, MAXAMOUNT))\nAttributeError: 'NoneType' object has no attribute 'read'\n\nOn Thu, Jan 11, 2018 at 8:39 PM, Seth M. Larson <[email protected]>\nwrote:\n\n> Can you follow each part of the template, including what the output of python\n> -m requests.help?\n> Also what is the output and error you're receiving when you run your code?\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/issues/4461#issuecomment-356962121>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AJWIvdPVzJyKSuziqJzKWhpTj4WNj8Kqks5tJiQbgaJpZM4Ra-dA>\n> .\n>\n", "Couldn't access the reported issue page\n\nOn Thu, Jan 11, 2018 at 8:52 PM, Krishna Prasad Puthiyattil <\[email protected]> wrote:\n\n> Hi,\n> I am getting the output as below,\n> {'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', 'Set-Cookie':\n> '_app_vis_id_=77840FFCDD7B64EF18ECFE48A9517BC4; Path=/server/; Secure;\n> HttpOnly', 'Vary': 'Accept-Encoding', 'Server': 'SmartDocs Web Server',\n> 'Connection': 'keep-alive', 'Date': 'Thu, 11 Jan 2018 15:23:43 GMT',\n> 'Content-Type': 'application/json;charset=UTF-8'}\n> <RequestsCookieJar[<Cookie _app_vis_id_=77840FFCDD7B64EF18ECFE48A9517BC4\n> for agent220.smartdocsonline.com/server/>]>\n> Traceback (most recent call last):\n> File \"C:\\Users\\Krishna\\Documents\\Visual Studio 2015\\Projects\\\n> PythonApplication2\\PythonApplication2.py\", line 20, in <module>\n> for chunk in resp_obj.iter_content( chunk_size=1024):\n> File \"C:\\Python27\\lib\\site-packages\\requests\\models.py\", line 745, in\n> generate\n> for chunk in self.raw.stream(chunk_size, decode_content=True):\n> File \"C:\\Python27\\lib\\site-packages\\urllib3\\response.py\", line 432, in\n> stream\n> for line in self.read_chunked(amt, decode_content=decode_content):\n> File \"C:\\Python27\\lib\\site-packages\\urllib3\\response.py\", line 601, in\n> read_chunked\n> chunk = self._handle_chunk(amt)\n> File \"C:\\Python27\\lib\\site-packages\\urllib3\\response.py\", line 566, in\n> _handle_chunk\n> returned_chunk = self._fp._safe_read(self.chunk_left)\n> File \"C:\\Python27\\lib\\httplib.py\", line 703, in _safe_read\n> chunk = self.fp.read(min(amt, MAXAMOUNT))\n> AttributeError: 'NoneType' object has no attribute 'read'\n>\n> On Thu, Jan 11, 2018 at 8:39 PM, Seth M. Larson <[email protected]>\n> wrote:\n>\n>> Can you follow each part of the template, including what the output of python\n>> -m requests.help?\n>> Also what is the output and error you're receiving when you run your code?\n>>\n>> —\n>> You are receiving this because you authored the thread.\n>> Reply to this email directly, view it on GitHub\n>> <https://github.com/requests/requests/issues/4461#issuecomment-356962121>,\n>> or mute the thread\n>> <https://github.com/notifications/unsubscribe-auth/AJWIvdPVzJyKSuziqJzKWhpTj4WNj8Kqks5tJiQbgaJpZM4Ra-dA>\n>> .\n>>\n>\n>\n", "@kpputhiyattil, the provided reproduction doesn’t appear to work as written. Did you delete the contents of your cookie for loop, or was the following content intended to be inside the cookie loop?\r\n\r\nSo the only way I can find to trigger this from the Requests API is to close the response while iterating the generator of a response sent with `Transfer-Encoding: chunked`. This will set the underlying file descriptor to None, causing your error.\r\n\r\n```python\r\nresp = requests.get(‘https://www.google.com/‘, stream=True)\r\nfor chunk in resp.iter_content(1024):\r\n resp.close()\r\n print(chunk)\r\n```\r\n\r\nAre you generating multiple generators or parallelizing any of your code across threads? Soemthing is closing your response mid-read which is the root cause of this error. If you aren’t doing either of the above things, could you please provide a *minmimal* reproduction script? I’m pretty sure this is external to Requests but want to verify we’re not accidentally closing something unintentionally. Thanks!", "The issue is persisting only with visual studio 2015 when I try to debug.\nEither if I run via Pycharm ide or I run in the visual studio without\ndebugging, I am getting the expected output. Any idea why it is so?\n\nOn Thu, Jan 11, 2018 at 11:32 PM, Nate Prewitt <[email protected]>\nwrote:\n\n> @kpputhiyattil <https://github.com/kpputhiyattil>, the provided\n> reproduction doesn’t appear to work as written. Did you delete the contents\n> of your cookie for loop, or was the following content intended to be inside\n> the cookie loop?\n>\n> So the only way I can find to trigger this from the Requests API is to\n> close the response while iterating the generator of a response sent with Transfer-Encoding:\n> chunked. This will set the underlying file descriptor to None, causing\n> your error.\n>\n> resp = requests.get(‘https://www.google.com/‘, stream=True)for chunk in resp.iter_content(1024):\n> resp.close()\n> print(chunk)\n>\n> Are you generating multiple generators or parallelizing any of your code\n> across threads? Soemthing is closing your response mid-read which is the\n> root cause of this error. If you aren’t doing either of the above things,\n> could you please provide a *minmimal* reproduction script? I’m pretty\n> sure this is external to Requests but want to verify we’re not accidentally\n> closing something unintentionally. Thanks!\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/issues/4461#issuecomment-357010383>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AJWIvaxGgY5ExXAr__vbuknd982zLRdqks5tJkybgaJpZM4Ra-dA>\n> .\n>\n", "@kpputhiyattil ok, that narrows things down a bit. I did some testing and it looks like this is reproducible with just urllib3 but not httplib by itself. This means, something in urllib3 is being interacted with by the debugger and closing the underlying socket file descriptor before we finish reading.\r\n\r\nSince this isn't a bug in Requests, but our underlying library [urllib3](https://github.com/shazow/urllib3), I suggest we move this issue over there. We'll be able to determine if this is worth investigating and fixing at that level. Thanks @kpputhiyattil!\r\n\r\nHere's a reproduction you can show in that issue. I was able to trigger it with the vscode debugger.\r\n\r\n```python\r\nimport urllib3\r\n\r\nhttp = urllib3.PoolManager()\r\nresp = http.request('GET', 'https://www.google.com/')\r\n\r\nfor chunk in resp.stream(1024, decode_content=True):\r\n print(chunk)\r\n```", "Thank you so much for spending your time with us. One more query, what will\nbe the workaround for the issue until urlib3 fix the issue?\n\nOn Fri, Jan 12, 2018 at 11:11 AM, Nate Prewitt <[email protected]>\nwrote:\n\n> @kpputhiyattil <https://github.com/kpputhiyattil> ok, that narrows things\n> down a bit. I did some testing and it looks like this is reproducible with\n> just urllib3 but not httplib by itself. This means, something in urllib3 is\n> being interacted with by the debugger and closing the underlying socket\n> file descriptor before we finish reading.\n>\n> Since this isn't a bug in Requests, but our underlying library urllib3\n> <https://github.com/shazow/urllib3>, I suggest we move this issue over\n> there. We'll be able to determine if this is worth investigating and fixing\n> at that level. Thanks @kpputhiyattil <https://github.com/kpputhiyattil>!\n>\n> Here's a reproduction you can show in that issue. I was able to trigger it\n> with the vscode debugger.\n>\n> import urllib3\n>\n> http = urllib3.PoolManager()\n> resp = http.request('GET', 'https://www.google.com/')\n> for chunk in resp.stream(1024, decode_content=True):\n> print(chunk)\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/issues/4461#issuecomment-357148131>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AJWIvTJZ9CF-j123RILrSEelTeIIxC7cks5tJvB3gaJpZM4Ra-dA>\n> .\n>\n", "I think I may have been a bit hasty with my last response. The above snippet triggers a separate but similar exception in urllib3 which will occur regardless of debugger use. Why it's encountering a different failure state when it's the same code Requests I have yet to determine.\r\n\r\nThe error you're encountering seems to be specific to at least vscode (I haven't tried on pycharm). Running the same script with pdb (`python -m pdb poc.py`) will allow for debugging without the exceptions. If you *need* to use the built in debugger for now, you may need to consider using the `content` property, or not passing `stream=True`. The latter will result in everything being loaded into memory though which may not be desired.\r\n\r\nThat's all I can advise right now until we determine what's going on in urllib3.\r\n\r\n#### poc.py\r\n```python\r\nimport requests\r\n\r\nresp = requests.get('https://www.google.com/', stream=True)\r\nfor i in resp.iter_content(1024):\r\n print(1)\r\n```", "@nateprewitt your `urllib3` alone example is because you didn't do `http.request('GET', 'https://google.com', preload_content=False)` if I remember correctly so the content was already loaded into memory and streaming meant that you were trying to read from an httplib response that had already been set to None for garbage collection.", "Why it happens only while debugging? Else it works smoothly..\n\nOn Jan 14, 2018 3:05 AM, \"Ian Stapleton Cordasco\" <[email protected]>\nwrote:\n\n> @nateprewitt <https://github.com/nateprewitt> your urllib3 alone example\n> is because you didn't do http.request('GET', 'https://google.com',\n> preload_content=False) if I remember correctly so the content was already\n> loaded into memory and streaming meant that you were trying to read from an\n> httplib response that had already been set to None for garbage collection.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/issues/4461#issuecomment-357469035>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AJWIvV18u5f_KJ_hOCzMMb0i8CGyOlb8ks5tKSGrgaJpZM4Ra-dA>\n> .\n>\n" ]
https://api.github.com/repos/psf/requests/issues/4460
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4460/labels{/name}
https://api.github.com/repos/psf/requests/issues/4460/comments
https://api.github.com/repos/psf/requests/issues/4460/events
https://github.com/psf/requests/pull/4460
287,644,948
MDExOlB1bGxSZXF1ZXN0MTYyMjgwMTM0
4,460
Remove unsupported Python 3.3 from tox.ini
{ "avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4", "events_url": "https://api.github.com/users/jdufresne/events{/privacy}", "followers_url": "https://api.github.com/users/jdufresne/followers", "following_url": "https://api.github.com/users/jdufresne/following{/other_user}", "gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jdufresne", "id": 347634, "login": "jdufresne", "node_id": "MDQ6VXNlcjM0NzYzNA==", "organizations_url": "https://api.github.com/users/jdufresne/orgs", "received_events_url": "https://api.github.com/users/jdufresne/received_events", "repos_url": "https://api.github.com/users/jdufresne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions", "type": "User", "url": "https://api.github.com/users/jdufresne", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-01-11T02:38:08Z
2021-09-03T00:11:12Z
2018-01-11T14:41:08Z
CONTRIBUTOR
resolved
Python 3.3 is not a supported version so don't test it.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4460/reactions" }
https://api.github.com/repos/psf/requests/issues/4460/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4460.diff", "html_url": "https://github.com/psf/requests/pull/4460", "merged_at": "2018-01-11T14:41:08Z", "patch_url": "https://github.com/psf/requests/pull/4460.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4460" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4460?src=pr&el=h1) Report\n> Merging [#4460](https://codecov.io/gh/requests/requests/pull/4460?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/c98e30b5cb812a5efe0f6c9c40861009069932b7?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4460/graphs/tree.svg?token=mZGswIiXLa&width=650&height=150&src=pr)](https://codecov.io/gh/requests/requests/pull/4460?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4460 +/- ##\n=======================================\n Coverage 90.14% 90.14% \n=======================================\n Files 15 15 \n Lines 1543 1543 \n=======================================\n Hits 1391 1391 \n Misses 152 152\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4460?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4460?src=pr&el=footer). Last update [c98e30b...620a539](https://codecov.io/gh/requests/requests/pull/4460?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n" ]
https://api.github.com/repos/psf/requests/issues/4459
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4459/labels{/name}
https://api.github.com/repos/psf/requests/issues/4459/comments
https://api.github.com/repos/psf/requests/issues/4459/events
https://github.com/psf/requests/pull/4459
287,644,321
MDExOlB1bGxSZXF1ZXN0MTYyMjc5NzEz
4,459
Pass python_requires argument to setuptools
{ "avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4", "events_url": "https://api.github.com/users/jdufresne/events{/privacy}", "followers_url": "https://api.github.com/users/jdufresne/followers", "following_url": "https://api.github.com/users/jdufresne/following{/other_user}", "gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jdufresne", "id": 347634, "login": "jdufresne", "node_id": "MDQ6VXNlcjM0NzYzNA==", "organizations_url": "https://api.github.com/users/jdufresne/orgs", "received_events_url": "https://api.github.com/users/jdufresne/received_events", "repos_url": "https://api.github.com/users/jdufresne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions", "type": "User", "url": "https://api.github.com/users/jdufresne", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2018-01-11T02:34:04Z
2021-09-03T00:11:11Z
2018-01-13T04:06:59Z
CONTRIBUTOR
resolved
Helps pip decide what version of the library to install. https://packaging.python.org/tutorials/distributing-packages/#python-requires > If your project only runs on certain Python versions, setting the > python_requires argument to the appropriate PEP 440 version specifier > string will prevent pip from installing the project on other Python > versions. https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords > python_requires > > A string corresponding to a version specifier (as defined in PEP 440) > for the Python version, used to specify the Requires-Python defined in > PEP 345.
{ "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/4459/reactions" }
https://api.github.com/repos/psf/requests/issues/4459/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4459.diff", "html_url": "https://github.com/psf/requests/pull/4459", "merged_at": "2018-01-13T04:06:59Z", "patch_url": "https://github.com/psf/requests/pull/4459.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4459" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4459?src=pr&el=h1) Report\n> Merging [#4459](https://codecov.io/gh/requests/requests/pull/4459?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/b9d8e00cbc74d847e2b700b0ab26128b85a4344f?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4459/graphs/tree.svg?width=650&height=150&src=pr&token=mZGswIiXLa)](https://codecov.io/gh/requests/requests/pull/4459?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4459 +/- ##\n=======================================\n Coverage 90.14% 90.14% \n=======================================\n Files 15 15 \n Lines 1543 1543 \n=======================================\n Hits 1391 1391 \n Misses 152 152\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4459?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4459?src=pr&el=footer). Last update [b9d8e00...7cefa93](https://codecov.io/gh/requests/requests/pull/4459?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Is there a minimum version of setuptools necessary to support this?", "@sigmavirus24 It was [added in 24.2.0](https://github.com/pypa/setuptools/blob/56bf1a9c12fd881fe6f69c3693cc426acf8012c3/CHANGES.rst#v2420) which was released on [2016-07-20](https://pypi.python.org/pypi/setuptools/json).", "Additionally, `setup()` ignores unknown keyword arguments. So, while only users with setuptools 24.2+ can take advantage of this feature, it is no harm to users of previous versions.", "@jdufresne can you update the branch? I'm totally on-board with this given your commentary. Cheers!", "I have rebased on to the latest master. Thanks." ]
https://api.github.com/repos/psf/requests/issues/4458
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4458/labels{/name}
https://api.github.com/repos/psf/requests/issues/4458/comments
https://api.github.com/repos/psf/requests/issues/4458/events
https://github.com/psf/requests/issues/4458
287,632,421
MDU6SXNzdWUyODc2MzI0MjE=
4,458
SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')) for older French website
{ "avatar_url": "https://avatars.githubusercontent.com/u/270476?v=4", "events_url": "https://api.github.com/users/autumnjolitz/events{/privacy}", "followers_url": "https://api.github.com/users/autumnjolitz/followers", "following_url": "https://api.github.com/users/autumnjolitz/following{/other_user}", "gists_url": "https://api.github.com/users/autumnjolitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/autumnjolitz", "id": 270476, "login": "autumnjolitz", "node_id": "MDQ6VXNlcjI3MDQ3Ng==", "organizations_url": "https://api.github.com/users/autumnjolitz/orgs", "received_events_url": "https://api.github.com/users/autumnjolitz/received_events", "repos_url": "https://api.github.com/users/autumnjolitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/autumnjolitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/autumnjolitz/subscriptions", "type": "User", "url": "https://api.github.com/users/autumnjolitz", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-01-11T01:17:17Z
2021-09-08T04:00:54Z
2018-01-11T03:00:33Z
NONE
resolved
Hi, I encountered this issue while filing scrapy/scrapy#3065 regarding `https://agences.creditfoncier.fr/credit-immobilier/toutes-nos-agences`. Like the other bugs, `curl` magically works but Python installations crap out. `uname -a`: ``` Darwin BTJ-GT.local 16.7.0 Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64 x86_64 ``` `python --version`: ``` Python 3.6.2 ``` `pip freeze | grep -iE 'requests|ssl|cryptography'`: ``` cryptography==2.1.4 pyOpenSSL==17.5.0 requests==2.18.4 requests-cache==0.4.13 requests-oauthlib==0.8.0 requests-toolbelt==0.7.1 ``` Checking the OpenSSL version reveals we are using 1.0.2n: ``` (cpython36) BenJolitz-Laptop:~/software$ python -c 'import _ssl;print(_ssl.__file__)' /Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so (cpython36) BenJolitz-Laptop:~/software$ otool -L /Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so /Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2) (cpython36) BenJolitz-Laptop:~/software$ brew info --json=v1 openssl | python -m json.tool | jq .[].installed[].version "1.0.2l" "1.0.2n" (cpython36) BenJolitz-Laptop:~/software$ ls -lt /usr/local/opt/openssl lrwxr-xr-x 1 BenJolitz admin 24 Jan 9 17:51 /usr/local/opt/openssl -> ../Cellar/openssl/1.0.2n (cpython36) BenJolitz-Laptop:~/software$ ``` Yes, OpenSSL 1.0.2n it looks like... ## Expected Result ``` >>> import requests >>> fh = requests.get('https://agences.creditfoncier.fr/credit-immobilier/toutes-nos-agences') >>> fh.code == 200 True ``` ## Actual Result If you have pyOpenSSL==17.5.0 installed: ``` (cpython36) BenJolitz-Laptop:~/software$ python Python 3.6.2 (default, Jul 17 2017, 16:44:45) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> fh = requests.get('https://agences.creditfoncier.fr/credit-immobilier/toutes-nos-agences') Traceback (most recent call last): File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 441, in wrap_socket cnx.do_handshake() File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1806, in do_handshake self._raise_ssl_error(self._ssl, result) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1539, in _raise_ssl_error raise SysCallError(-1, "Unexpected EOF") OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn conn.connect() File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connection.py", line 326, in connect ssl_context=context) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 448, in wrap_socket raise ssl.SSLError('bad handshake: %r' % e) ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/adapters.py", line 440, in send timeout=timeout File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='agences.creditfoncier.fr', port=443): Max retries exceeded with url: /credit-immobilier/toutes-nos-agences (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='agences.creditfoncier.fr', port=443): Max retries exceeded with url: /credit-immobilier/toutes-nos-agences (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) >>> ``` If pyOpenSSL==17.5.0 is NOT INSTALLED: ``` >>> requests.get('https://agences.creditfoncier.fr/credit-immobilier/toutes-nos-agences') Traceback (most recent call last): File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn conn.connect() File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connection.py", line 326, in connect ssl_context=context) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 401, in wrap_socket _context=self, _session=session) File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 808, in __init__ self.do_handshake() File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1061, in do_handshake self._sslobj.do_handshake() File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:748) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/adapters.py", line 440, in send timeout=timeout File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='agences.creditfoncier.fr', port=443): Max retries exceeded with url: /credit-immobilier/toutes-nos-agences (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:748)'),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/Users/BenJolitz/.virtualenvs/cpython36/lib/python3.6/site-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='agences.creditfoncier.fr', port=443): Max retries exceeded with url: /credit-immobilier/toutes-nos-agences (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:748)'),)) >>> >>> ``` ## Reproduction Steps ```python import requests requests.get('https://agences.creditfoncier.fr/credit-immobilier/toutes-nos-agences') ``` ## System Information $ python -m requests.help ``` (cpython36) BenJolitz-Laptop:~/software$ python -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.1.4" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.2" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "1010007f", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ef" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } (cpython36) BenJolitz-Laptop:~/software$ ```
{ "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/4458/reactions" }
https://api.github.com/repos/psf/requests/issues/4458/timeline
null
completed
null
null
false
[ "The problem is not us but your server. If you do `openssl s_client -connect agences.creditfoncier.fr:443` You should see output that includes:\r\n\r\n```\r\nSSL-Session:\r\n Protocol : TLSv1\r\n Cipher : DES-CBC3-SHA\r\n```\r\n\r\nThe way that urllib3 and Requests in Python negotiate TLS (which is far more restrictive for your security) would look roughly like this command:\r\n\r\n```\r\nopenssl s_client -connect agences.creditfoncier.fr:443 -cipher 'TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:ECDH+AESGCM:ECDH+CHACHA20:DH+AESGCM:DH+CHACHA20:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!eNULL:!MD5'\r\n```\r\n\r\nWhen I run that command, I see a few things:\r\n\r\n```\r\nSSL-Session:\r\n Protocol : TLSv1.2\r\n Cipher : 0000\r\n```\r\n\r\nThe server supports TLSv1.2 but doesn't support any of our quite secure ciphers. And on top of that, the server instead of telling us the handshake failed or sending us anything back closes the socket without writing a single damned thing as indicated by:\r\n\r\n```\r\nSSL handshake has read 0 bytes and written 212 bytes\r\n```\r\n\r\nSo, you could alter the cipher list that we use to attempt to safeguard your privacy so that you can connect to this server, or you can complain loudly to them that they should look into the following resources that we used to build our cipher string:\r\n\r\n- https://wiki.mozilla.org/Security/Server_Side_TLS\r\n- https://www.ssllabs.com/projects/best-practices/index.html\r\n- https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/" ]
https://api.github.com/repos/psf/requests/issues/4457
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4457/labels{/name}
https://api.github.com/repos/psf/requests/issues/4457/comments
https://api.github.com/repos/psf/requests/issues/4457/events
https://github.com/psf/requests/pull/4457
287,590,680
MDExOlB1bGxSZXF1ZXN0MTYyMjQwMDAw
4,457
Fixing max_retries to accept Retry instance
{ "avatar_url": "https://avatars.githubusercontent.com/u/1305135?v=4", "events_url": "https://api.github.com/users/phreakmonkey/events{/privacy}", "followers_url": "https://api.github.com/users/phreakmonkey/followers", "following_url": "https://api.github.com/users/phreakmonkey/following{/other_user}", "gists_url": "https://api.github.com/users/phreakmonkey/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/phreakmonkey", "id": 1305135, "login": "phreakmonkey", "node_id": "MDQ6VXNlcjEzMDUxMzU=", "organizations_url": "https://api.github.com/users/phreakmonkey/orgs", "received_events_url": "https://api.github.com/users/phreakmonkey/received_events", "repos_url": "https://api.github.com/users/phreakmonkey/repos", "site_admin": false, "starred_url": "https://api.github.com/users/phreakmonkey/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/phreakmonkey/subscriptions", "type": "User", "url": "https://api.github.com/users/phreakmonkey", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2018-01-10T21:54:44Z
2021-09-04T00:06:34Z
2018-01-10T22:46:19Z
NONE
resolved
adapters. HTTPAdapter max_retries parameter specifies that you can pass an instance of the Retry class directly to it. > :param max_retries: The maximum number of retries each connection > should attempt. Note, this applies only to failed DNS lookups, socket > connections and connection timeouts, never to requests where data has > made it to the server. By default, Requests does not retry failed > connections. If you need granular control over the conditions under > which we retry a request, import urllib3's ``Retry`` class and pass > that instead. However, lines 114-116 of the code will instead put instance of the Retry class into a parameter of the Retry.from_int() function. The result is, once invoked during a retry, this error chain occurs: > File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 469, in get > return self.request('GET', url, **kwargs) > File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request > resp = self.send(prep, **send_kwargs) > File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send > r = adapter.send(request, **kwargs) > File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 362, in send > timeout=timeout > File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 559, in urlopen > _pool=self, _stacktrace=stacktrace) > File "/usr/lib/python2.7/dist-packages/urllib3/util/retry.py", line 227, in increment > total -= 1 > TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' This patch checks to see if max_retries is an int before passing it to Retry.from_int(). That way, if max_retries is already an instance of Retry, it will be left intact and function as documented. Some cursory searches for the above TypeError indicate that this has been an undiagnosed problem across the net for quite a while. Cheers!
{ "avatar_url": "https://avatars.githubusercontent.com/u/1305135?v=4", "events_url": "https://api.github.com/users/phreakmonkey/events{/privacy}", "followers_url": "https://api.github.com/users/phreakmonkey/followers", "following_url": "https://api.github.com/users/phreakmonkey/following{/other_user}", "gists_url": "https://api.github.com/users/phreakmonkey/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/phreakmonkey", "id": 1305135, "login": "phreakmonkey", "node_id": "MDQ6VXNlcjEzMDUxMzU=", "organizations_url": "https://api.github.com/users/phreakmonkey/orgs", "received_events_url": "https://api.github.com/users/phreakmonkey/received_events", "repos_url": "https://api.github.com/users/phreakmonkey/repos", "site_admin": false, "starred_url": "https://api.github.com/users/phreakmonkey/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/phreakmonkey/subscriptions", "type": "User", "url": "https://api.github.com/users/phreakmonkey", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4457/reactions" }
https://api.github.com/repos/psf/requests/issues/4457/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4457.diff", "html_url": "https://github.com/psf/requests/pull/4457", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4457.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4457" }
true
[ "Thanks for this! Can we get a test for this so it won't be regressed. :)", "Strangely, test_requests.py already has a test for this. I can't figure out why it was passing:\r\n\r\n```\r\ndef test_urllib3_retries(httpbin):\r\n from urllib3.util import Retry\r\n s = requests.Session()\r\n s.mount('http://', HTTPAdapter(max_retries=Retry(\r\n total=2, status_forcelist=[500]\r\n )))\r\n\r\n with pytest.raises(RetryError):\r\n s.get(httpbin('status/500'))\r\n```\r\n\r\nIt seems like, prior to my patch, that should have also manifested the TypeError: that I'm seeing. I'm not well versed in pytest though.", "@phreakmonkey urllib3’s implementation of Retry has [a branch in `from_int()`](https://github.com/shazow/urllib3/blob/67591cdfd3f29f168baa05cc1fcc1fc92c7e9deb/urllib3/util/retry.py#L195) specifically for handling a Retry object. Could you please provide some more info of how you encountered this, a minimum viable reproduction, and the output of ’python -m requests.help`?\r\n\r\nMy hunch is either you have an older version of urllib3 or that something was changed in urllib3’s semi-recent retry work that is causing it to no longer behave as expected.", "Oh interesting. This is what I get for using the OS distributions of libraries. The system where I encountered the error is Raspbian 8 on a Raspberry Pi 3:\r\n\r\n```\r\n$ cat /etc/os-release\r\nPRETTY_NAME=\"Raspbian GNU/Linux 8 (jessie)\"\r\nNAME=\"Raspbian GNU/Linux\"\r\nVERSION_ID=\"8\"\r\nVERSION=\"8 (jessie)\"\r\nID=raspbian\r\nID_LIKE=debian\r\nHOME_URL=\"http://www.raspbian.org/\"\r\nSUPPORT_URL=\"http://www.raspbian.org/RaspbianForums\"\r\nBUG_REPORT_URL=\"http://www.raspbian.org/RaspbianBugs\"\r\n```\r\n\r\n```\r\n$ pip show requests\r\n---\r\nName: requests\r\nVersion: 2.4.3\r\nLocation: /usr/lib/python2.7/dist-packages\r\nRequires:\r\n\r\n$ pip show urllib3\r\n---\r\nName: urllib3\r\nVersion: 1.9.1\r\nLocation: /usr/lib/python2.7/dist-packages\r\nRequires:\r\n```\r\n\r\nSo, yeah, outdated OS-included libraries are likely the culprit. That's what I get for thinking \"oh, it's just a Raspberry Pi. No need to set up pyenv and virtualenv for a few automation scripts...\"\r\n\r\nWhelp, carry on!\r\n", "Yep, 2.4.3 is over 3 years old and likely won’t behave with our current documentation. Glad you got it sorted!", "On top of that, the \"undiagnosed issue\" you reference has been diagnosed as several different causes. One of which is that Requests (when installed from PyPI) used to vendor urllib3 and people used to separately install urllib3 in spite of our documentation so there were two different sources of the Retry object." ]
https://api.github.com/repos/psf/requests/issues/4456
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4456/labels{/name}
https://api.github.com/repos/psf/requests/issues/4456/comments
https://api.github.com/repos/psf/requests/issues/4456/events
https://github.com/psf/requests/pull/4456
287,555,279
MDExOlB1bGxSZXF1ZXN0MTYyMjEzNjk5
4,456
an idea on persisting redirect history when exceptions are encountered
{ "avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4", "events_url": "https://api.github.com/users/jvanasco/events{/privacy}", "followers_url": "https://api.github.com/users/jvanasco/followers", "following_url": "https://api.github.com/users/jvanasco/following{/other_user}", "gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jvanasco", "id": 204779, "login": "jvanasco", "node_id": "MDQ6VXNlcjIwNDc3OQ==", "organizations_url": "https://api.github.com/users/jvanasco/orgs", "received_events_url": "https://api.github.com/users/jvanasco/received_events", "repos_url": "https://api.github.com/users/jvanasco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions", "type": "User", "url": "https://api.github.com/users/jvanasco", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 78002701, "name": "Do Not Merge", "node_id": "MDU6TGFiZWw3ODAwMjcwMQ==", "url": "https://api.github.com/repos/psf/requests/labels/Do%20Not%20Merge" } ]
closed
false
null
[]
{ "closed_at": null, "closed_issues": 29, "created_at": "2024-05-19T18:29:04Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/34", "id": 11073254, "labels_url": "https://api.github.com/repos/psf/requests/milestones/34/labels", "node_id": "MI_kwDOABTKOs4AqPbm", "number": 34, "open_issues": 0, "state": "open", "title": "Bankruptcy", "updated_at": "2024-05-20T14:37:16Z", "url": "https://api.github.com/repos/psf/requests/milestones/34" }
2
2018-01-10T19:47:10Z
2024-05-20T14:35:44Z
2024-05-20T14:35:43Z
CONTRIBUTOR
null
this is a quick idea on an approach to address #4455 within `resolve_redirects` exceptions raised by`Session.send` are caught. If they match a given set of tests (currently just the base `ConnectionError` class), the `resp` is replaced with an instance of an exception class used to hold bad response data. Then a new exception is raised. This makes handling these types of errors similar to handling items without redirects for most users (i did not consider the legacy ways of using requests) The immediate ideas/concerns I have on this: 1. It might make sense to have a global "NotARealResponse" object that stands in for a `Response` object and can contain connection/history info when there is no immediate response. I'm not sure this is the only use-case for this. 2. I thought about extending the current exception with request/response data, but this seemed more appropriate. Just to be clear, this is only submitted for discussion/illustration of the other ticket. This is not a PR for merging.
{ "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/4456/reactions" }
https://api.github.com/repos/psf/requests/issues/4456/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4456.diff", "html_url": "https://github.com/psf/requests/pull/4456", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4456.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4456" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4456?src=pr&el=h1) Report\n> Merging [#4456](https://codecov.io/gh/requests/requests/pull/4456?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/c98e30b5cb812a5efe0f6c9c40861009069932b7?src=pr&el=desc) will **decrease** coverage by `0.25%`.\n> The diff coverage is `66.66%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4456/graphs/tree.svg?token=mZGswIiXLa&src=pr&height=150&width=650)](https://codecov.io/gh/requests/requests/pull/4456?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4456 +/- ##\n==========================================\n- Coverage 90.14% 89.89% -0.26% \n==========================================\n Files 15 15 \n Lines 1543 1554 +11 \n==========================================\n+ Hits 1391 1397 +6 \n- Misses 152 157 +5\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4456?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4456/diff?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `93.95% <66.66%> (-1.61%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4456?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4456?src=pr&el=footer). Last update [c98e30b...9dc04b3](https://codecov.io/gh/requests/requests/pull/4456?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "In an effort to clean up the issue tracker to only have issues that are still relevant to the project we've done a quick pass and decided this issue may no longer be relevant for a variety of potential reasons, including:\r\n\r\n* Applies to a much older version, unclear whether the issue still applies.\r\n* Change requires a backwards incompatible release and it's unclear if the benefits are worth the migration effort from the community.\r\n* There isn't a clear demand from the community on the change landing in Requests.\r\n\r\nIf you think the issue should remain open, please comment so below or open a new issue and link back to the original issue. Again, thank you for opening the issue and for the discussion, it's much appreciated." ]
https://api.github.com/repos/psf/requests/issues/4455
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4455/labels{/name}
https://api.github.com/repos/psf/requests/issues/4455/comments
https://api.github.com/repos/psf/requests/issues/4455/events
https://github.com/psf/requests/issues/4455
287,220,555
MDU6SXNzdWUyODcyMjA1NTU=
4,455
no response object captured in error of endless redirect chain and confusing message
{ "avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4", "events_url": "https://api.github.com/users/jvanasco/events{/privacy}", "followers_url": "https://api.github.com/users/jvanasco/followers", "following_url": "https://api.github.com/users/jvanasco/following{/other_user}", "gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jvanasco", "id": 204779, "login": "jvanasco", "node_id": "MDQ6VXNlcjIwNDc3OQ==", "organizations_url": "https://api.github.com/users/jvanasco/orgs", "received_events_url": "https://api.github.com/users/jvanasco/received_events", "repos_url": "https://api.github.com/users/jvanasco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions", "type": "User", "url": "https://api.github.com/users/jvanasco", "user_view_type": "public" }
[]
open
false
null
[]
null
2
2018-01-09T20:29:36Z
2018-01-10T18:12:47Z
null
CONTRIBUTOR
null
I found an incredibly bad URL that causes a handful of issues. the url below jumps between a bunch of SocialFlow (trib.al) and Bitly url shorteners for tracking, then ends up on a connection timeout that also looks like a max retries exceeded (which makes no sense to me) The exception that is raised under Py2 and Py3 does not have a response object, although one should exist – there are a long history of redirects that gets lost and makes this difficult to debug the url's problem. HTTPSConnectionPool(host='this.cm', port=443): Max retries exceeded with url: /slate/follow (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x1021788d0>, 'Connection to this.cm timed out. (connect timeout=2)')) ```python import requests try: url = 'http://slate.me/1KDocND' r = requests.get(url, timeout=2) print("success") print(r.response) except Exception as error: print("error") print(error) print(type(error.response)) ```
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/4455/reactions" }
https://api.github.com/repos/psf/requests/issues/4455/timeline
null
null
null
null
false
[ "The `max retries exceeded with url` is due entirely to the fact that Requests uses a subset of urllib3 at this point. Requests' usage of retries were wholly limited to the API that urllib3 provided prior to creating the Retry object. It's been updated little since. As a result, we don't allow urllib3 to perform its own retries so when something like this fails that is potentially retryable from the perspective of urllib3 but retries is at 0 already, we get that exception. It's plagued us for years. That said, I think we can probably do better here, but @nateprewitt or I will have to do some digging to see why we're missing the work of appending a response to the exception. Thanks for the report and the detail provided. 🎉 ", "I did some digging myself and figured a few things out...\r\n\r\n1. The \"max retries\" text is from `requests/adapters.py` lines 497-514. `urllib3` reports the connection timeout as a `MaxRetryError`, then wraps that error in a `ConnectionError` from `requests/exceptions.py`. \r\n\r\n2. Based on your info above, I traced a bunch of stuff back to resolve_redirects - which i'm very familiar with. I will generate a PR of a starting point for a possible approach (it's just going to be a rough sketch). I'm not familiar with enough of requests to take this on myself, but I may be able to jumpstart someone else." ]
https://api.github.com/repos/psf/requests/issues/4454
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4454/labels{/name}
https://api.github.com/repos/psf/requests/issues/4454/comments
https://api.github.com/repos/psf/requests/issues/4454/events
https://github.com/psf/requests/issues/4454
286,913,596
MDU6SXNzdWUyODY5MTM1OTY=
4,454
response.json() fails when while(1); is in response body
{ "avatar_url": "https://avatars.githubusercontent.com/u/7034670?v=4", "events_url": "https://api.github.com/users/jessemcbride/events{/privacy}", "followers_url": "https://api.github.com/users/jessemcbride/followers", "following_url": "https://api.github.com/users/jessemcbride/following{/other_user}", "gists_url": "https://api.github.com/users/jessemcbride/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jessemcbride", "id": 7034670, "login": "jessemcbride", "node_id": "MDQ6VXNlcjcwMzQ2NzA=", "organizations_url": "https://api.github.com/users/jessemcbride/orgs", "received_events_url": "https://api.github.com/users/jessemcbride/received_events", "repos_url": "https://api.github.com/users/jessemcbride/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jessemcbride/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jessemcbride/subscriptions", "type": "User", "url": "https://api.github.com/users/jessemcbride", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-01-08T22:46:54Z
2021-09-08T05:00:36Z
2018-01-09T05:11:43Z
NONE
resolved
In an effort to prevent [JSON hijacking](https://haacked.com/archive/2009/06/25/json-hijacking.aspx/), some providers append `while(1);` before their JSON response. This doesn't appear to be filtered out by requests automatically, and the end result is a `ValueError`. ## Expected Result A JSON response of this form: ``` while(1);{"some": "json"} ``` should properly translate to a Python dictionary when calling `response.json()`: ``` { "some": "json" } ``` ## Actual Result `response.json()` results in an exception: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/requests/models.py", line 892, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 339, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded ``` ## Reproduction Steps ```python import requests broken = requests.get('https://gist.githubusercontent.com/jessemcbride/3306f72e92f08deff1e32c3df5c7b7c8/raw/621e5e94040486004b3b8e22157f2fb5d73a3686/test') broken.json() # throws an exception working = requests.get('https://gist.githubusercontent.com/jessemcbride/cc091ea99560b9b5c13632d19fefaa75/raw/1fc92d404c6f9113d83d6fdee00e4a59410a7032/test2') working.json() # renders properly ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.13" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ef" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ``` FWIW, I'm not totally convinced that requests should be responsible for fixing this. I'd like to open that up for discussion, though, as we were surprised by the behavior.
{ "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/4454/reactions" }
https://api.github.com/repos/psf/requests/issues/4454/timeline
null
completed
null
null
false
[ "There's a lot of different anti-hijacking methods for instance I've heard of `for(;;)` being used as well.", "Hey @jessemcbride, thanks for starting the conversation on this. I was under the impression we’d discussed something along these lines before but can’t find a ticket for reference. My general thoughts are that `json()` is intended to only be used on json response bodies. When `while(1);` is added, it’s no longer valid json and if it claims otherwise that’s incorrect.\r\n\r\nThat said, if this is a common case for you, it’s pretty easy to handle. You can do something like:\r\n```python\r\nr = requests.get(url)\r\njson_content = json.loads(r.content.strip(‘while(1);’))\r\n```\r\n\r\nSince this is easily implemented by the user, and as @SethMichaelLarson noted there’s more than just `while(1);` to worry about, I think it’s unlikely we’ll do anything in Requests to handle this. Hopefully that answers your questions about the behavior here.", "@nateprewitt I think this might be the one you're looking for? https://github.com/requests/requests/issues/4291#issuecomment-329018131\r\n\r\nIn any case, I agree with your assessment. There are too many edge cases. It's a bummer that JavaScript presents such a vulnerability in the first place :(.\r\n\r\nThank you for your feedback. We'll go ahead and manually patch our code to handle this. Before closing this, though, I wonder if there might be some way to document this as the intended behavior? A section on manually parsing tricky responses might do it. I'd be happy to submit a PR.\r\n ", "@jessemcbride It looks like our [intro docs](http://docs.python-requests.org/en/master/user/quickstart/#json-response-content) and the method's [docstring](https://github.com/requests/requests/blob/c98e30b5cb812a5efe0f6c9c40861009069932b7/requests/models.py#L869-L873) specify that `json()` will yield a `ValueError` on responses without a json body.\r\n\r\nFrom some quick digging, it looks like Google and Facebook implement the stops as `)]}'` and `for(;;)` respectively. They both however return the content as `text/javascript`, which means even if it were a valid JSON document, it shouldn't be treated that way. At least not initially.\r\n\r\nUnless another maintainer feels strongly this would be a needed addition, this is probably a better topic for a blog or simply a comment in this issue. Thanks again for getting the discussion going though!" ]
https://api.github.com/repos/psf/requests/issues/4453
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4453/labels{/name}
https://api.github.com/repos/psf/requests/issues/4453/comments
https://api.github.com/repos/psf/requests/issues/4453/events
https://github.com/psf/requests/issues/4453
286,905,279
MDU6SXNzdWUyODY5MDUyNzk=
4,453
Max retries exceeded with url
{ "avatar_url": "https://avatars.githubusercontent.com/u/22315428?v=4", "events_url": "https://api.github.com/users/phanindravarma38/events{/privacy}", "followers_url": "https://api.github.com/users/phanindravarma38/followers", "following_url": "https://api.github.com/users/phanindravarma38/following{/other_user}", "gists_url": "https://api.github.com/users/phanindravarma38/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/phanindravarma38", "id": 22315428, "login": "phanindravarma38", "node_id": "MDQ6VXNlcjIyMzE1NDI4", "organizations_url": "https://api.github.com/users/phanindravarma38/orgs", "received_events_url": "https://api.github.com/users/phanindravarma38/received_events", "repos_url": "https://api.github.com/users/phanindravarma38/repos", "site_admin": false, "starred_url": "https://api.github.com/users/phanindravarma38/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/phanindravarma38/subscriptions", "type": "User", "url": "https://api.github.com/users/phanindravarma38", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-01-08T22:12:28Z
2021-09-08T04:00:55Z
2018-01-09T14:05:40Z
NONE
resolved
Summary. I am trying to hit a third party API, such as api.ipify.org, which gives IP addresses and read the results. ## Expected Result JSON Response From URL i.e. ip address. What you expected. ## Actual Result requests.exceptions.ConnectionError: HTTPSConnectionPool(host=hostname, port=443): Max retries exceeded with url: /myurl (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10a857610>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)) What happened instead. ## Reproduction Steps ```python import time page = '' while page == '': try: page = requests.get("https://api.ipify.org/") except: print("Connection refused by the server..") print("Let me sleep for 5 seconds") print("ZZzzzz...") time.sleep(100) print("Was a nice sleep, now let me continue...") continue ```
{ "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/4453/reactions" }
https://api.github.com/repos/psf/requests/issues/4453/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.\r\n\r\nAs an aside `nodename nor servname provided, or not known` typically indicates an issue with DNS. It sounds like you're requesting several different URLs that are for several different domains. You should ensure all have domain names and that those domains all work. ", "Also, entertainingly, your reproduction steps (reproduced below) will always fail because of two problems:\r\n\r\n1. You never import `requests` so you get a `NameError`\r\n2. You use `try/except` without catching a specific exception so it will catch the `NameError` and then make you think you've encountered an exception from requests.\r\n\r\n```py\r\nimport time\r\n\r\npage = ''\r\nwhile page == '':\r\n try:\r\n page = requests.get(\"https://api.ipify.org/\")\r\n except:\r\n print(\"Connection refused by the server..\")\r\n print(\"Let me sleep for 5 seconds\")\r\n print(\"ZZzzzz...\")\r\n time.sleep(100)\r\n print(\"Was a nice sleep, now let me continue...\")\r\n continue\r\n```", "Yes, I have imported the requests but in another code block where I have encountered the original problem. \r\nJust to be clear. I am using IPython notebook. So, If I import in one block it will be imported everywhere i.e. in all the other code blocks. ", "Regardless, this isn’t the appropriate place for your question. Please post it on StackOverflow" ]
https://api.github.com/repos/psf/requests/issues/4452
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4452/labels{/name}
https://api.github.com/repos/psf/requests/issues/4452/comments
https://api.github.com/repos/psf/requests/issues/4452/events
https://github.com/psf/requests/pull/4452
286,600,835
MDExOlB1bGxSZXF1ZXN0MTYxNTM5ODQw
4,452
append previous url fragment on redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-01-07T21:28:31Z
2021-09-04T00:06:33Z
2018-01-21T18:41:47Z
MEMBER
resolved
This PR should address #4443 by appending the original request's fragment to subsequent redirects, unless a new fragment is provided in the Location header. This behaviour should bring us into compliance with [RFC 7230 § 7.1.2](https://tools.ietf.org/html/rfc7231#section-7.1.2). I also wrote a test to confirm we don't send fragment information to new servers, our underlying implementation strips that. One outstanding question I do have though is about chained redirects. ----- Let's say we make a request (`http://url#alice`) and get a 302 response (`http://new_url#bob`). We would leave `#bob` as the fragment for the second request. When we request `http://new_url#bob`, we get back another 301 to `http://final_url/`. Do we append `alice` or `bob` at this point? I went with the assumption that the "original" request is the first one in the chain. I could see an argument that all requests are stateless though, and that the `new_url#bob` is the only originating request in scope for the second redirect.
{ "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/4452/reactions" }
https://api.github.com/repos/psf/requests/issues/4452/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4452.diff", "html_url": "https://github.com/psf/requests/pull/4452", "merged_at": "2018-01-21T18:41:47Z", "patch_url": "https://github.com/psf/requests/pull/4452.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4452" }
true
[ "I went ahead and did [some testing](https://gist.github.com/nateprewitt/233301041bbd70cc53ef31a807d85bc7) to see how other user agents handle this. All of the major browsers except Safari will append `#bob`, so I've updated the logic and extended the tests to reflect that.\r\n\r\nI could see having the expected fragment being modified in transit being confusing for end-users, but it's probably best we behave like the rest of the ecosystem unless we have a strong reason not to.", "# [Codecov](https://codecov.io/gh/requests/requests/pull/4452?src=pr&el=h1) Report\n> Merging [#4452](https://codecov.io/gh/requests/requests/pull/4452?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/f89c325fbe9ad0e156b31dd6b7514dbf4d7d0088?src=pr&el=desc) will **increase** coverage by `0.03%`.\n> The diff coverage is `100%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4452/graphs/tree.svg?width=650&src=pr&token=mZGswIiXLa&height=150)](https://codecov.io/gh/requests/requests/pull/4452?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4452 +/- ##\n==========================================\n+ Coverage 90.14% 90.18% +0.03% \n==========================================\n Files 15 15 \n Lines 1543 1548 +5 \n==========================================\n+ Hits 1391 1396 +5 \n Misses 152 152\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4452?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4452/diff?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `95.63% <100%> (+0.08%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4452?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4452?src=pr&el=footer). Last update [f89c325...f60324a](https://codecov.io/gh/requests/requests/pull/4452?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@sigmavirus24 sorry for the delay. I've been playing around with rfc3986 and empty fragments. The rfc3986 conversion is a little more than I've had time to do right now and seems like a good followup PR.\r\n\r\nI have empty fragments working on another branch, but the solution is cluttered and the behaviour around them is mostly undefined.Given that we don't support them currently, I'm going to propose this is the solution we proceed with. If you'd prefer we maintain empty fragments, I'll push up the other branch.", "Alright, rebased and merging." ]
https://api.github.com/repos/psf/requests/issues/4451
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4451/labels{/name}
https://api.github.com/repos/psf/requests/issues/4451/comments
https://api.github.com/repos/psf/requests/issues/4451/events
https://github.com/psf/requests/pull/4451
286,511,628
MDExOlB1bGxSZXF1ZXN0MTYxNDkyNDkw
4,451
Prefer https over http for links in the documentation
{ "avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4", "events_url": "https://api.github.com/users/jdufresne/events{/privacy}", "followers_url": "https://api.github.com/users/jdufresne/followers", "following_url": "https://api.github.com/users/jdufresne/following{/other_user}", "gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jdufresne", "id": 347634, "login": "jdufresne", "node_id": "MDQ6VXNlcjM0NzYzNA==", "organizations_url": "https://api.github.com/users/jdufresne/orgs", "received_events_url": "https://api.github.com/users/jdufresne/received_events", "repos_url": "https://api.github.com/users/jdufresne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions", "type": "User", "url": "https://api.github.com/users/jdufresne", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-01-06T19:25:15Z
2021-09-03T00:11:11Z
2018-01-06T23:23:00Z
CONTRIBUTOR
resolved
- Fixed Read the Docs links - Fixed GitHub links - Fixed PyPI links
{ "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/4451/reactions" }
https://api.github.com/repos/psf/requests/issues/4451/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4451.diff", "html_url": "https://github.com/psf/requests/pull/4451", "merged_at": "2018-01-06T23:23:00Z", "patch_url": "https://github.com/psf/requests/pull/4451.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4451" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4451?src=pr&el=h1) Report\n> Merging [#4451](https://codecov.io/gh/requests/requests/pull/4451?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/3dc84cde5b785a85cb20eb2f0d4530fd568a6af7?src=pr&el=desc) will **decrease** coverage by `0.58%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4451/graphs/tree.svg?src=pr&width=650&token=mZGswIiXLa&height=150)](https://codecov.io/gh/requests/requests/pull/4451?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4451 +/- ##\n==========================================\n- Coverage 90.73% 90.14% -0.59% \n==========================================\n Files 15 15 \n Lines 1673 1543 -130 \n==========================================\n- Hits 1518 1391 -127 \n+ Misses 155 152 -3\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4451?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4451/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `93.11% <0%> (-1.71%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4451?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4451?src=pr&el=footer). Last update [3dc84cd...030dcce](https://codecov.io/gh/requests/requests/pull/4451?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n" ]
https://api.github.com/repos/psf/requests/issues/4450
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4450/labels{/name}
https://api.github.com/repos/psf/requests/issues/4450/comments
https://api.github.com/repos/psf/requests/issues/4450/events
https://github.com/psf/requests/issues/4450
286,488,639
MDU6SXNzdWUyODY0ODg2Mzk=
4,450
How about the error:Max retries exceeded with url
{ "avatar_url": "https://avatars.githubusercontent.com/u/34086198?v=4", "events_url": "https://api.github.com/users/lanhao945/events{/privacy}", "followers_url": "https://api.github.com/users/lanhao945/followers", "following_url": "https://api.github.com/users/lanhao945/following{/other_user}", "gists_url": "https://api.github.com/users/lanhao945/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lanhao945", "id": 34086198, "login": "lanhao945", "node_id": "MDQ6VXNlcjM0MDg2MTk4", "organizations_url": "https://api.github.com/users/lanhao945/orgs", "received_events_url": "https://api.github.com/users/lanhao945/received_events", "repos_url": "https://api.github.com/users/lanhao945/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lanhao945/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lanhao945/subscriptions", "type": "User", "url": "https://api.github.com/users/lanhao945", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-01-06T14:39:26Z
2021-09-08T05:00:36Z
2018-01-06T15:52:13Z
NONE
resolved
## error code ```python Traceback (most recent call last): File "F:/github/about_googlemap/about_googlemap/test_internet.py", line 12, in <module> url='https://www.google.com.hk/') File "F:\github\about_googlemap\venv\lib\site-packages\requests\api.py", line 72, in get return request('get', url, params=params, **kwargs) File "F:\github\about_googlemap\venv\lib\site-packages\requests\api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "F:\github\about_googlemap\venv\lib\site-packages\requests\sessions.py", line 523, in request resp = self.send(prep, **send_kwargs) File "F:\github\about_googlemap\venv\lib\site-packages\requests\sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "F:\github\about_googlemap\venv\lib\site-packages\requests\adapters.py", line 504, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.google.com.hk', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0000000005BFBEB8>: Failed to establish a new connection: [Errno 10060] ',)) ``` ## about the environment - windows 10 Home Edition - python 2.7+ 64 - requests 2.16.0 (I run the code in a virtualenv env) - the place : china. I use shadowsocks , and I can google search by Chrome ## python code ```python import requests response = requests.get( url='https://www.google.com.hk/') print response ``` ## process I try to use googlemaps , a python library, which may rely requests? And I over the wall by shadowsocks. I can view google and search by google with chrome. And I can direct get api json data by view 'https://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC|Seattle&destinations=San+Francisco|Victoria+BC&key=[my_project_key]' with chrome . But when I use requests library such as `requests.get()`, It shows the error above(ps: when I use googlemaps, error also come out, almost the same), I tried to find some solution from github, and I change the version of requests to 2.16.0, but error not go away. Also I see some setting should be in code,such as timeout? But it seems no use for me this time. En, the time, between I run the code and the error finally print out, about 20s. Also , my classmate, had no get the error, we do almost the same steps, but he tells me,he can print the response correctly. ## question - First I want to know , how does this error come? It comes from my setting or the internet outside? - Second, I want to solve the error, what may I do to keep error away? This is I expect. ## otherthings Did I put out more information to you ? If need, tell me please and I would try to give you more information. Thank you
{ "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/4450/reactions" }
https://api.github.com/repos/psf/requests/issues/4450/timeline
null
completed
null
null
false
[ "You might need to make requests aware of your proxy. I suggest reading and following the examples shown in [Advanced Usage - Proxies](http://docs.python-requests.org/en/master/user/advanced/#socks) section of our documentation.\r\n\r\nMake sure you have Socks support installed:\r\n`python -m pip install requests[socks]`\r\n\r\nAnd then define your proxies like this:\r\n\r\n```python\r\nproxies = {\r\n 'http': 'socks5://[USER]:[PASS]@[HOST]:[PORT]',\r\n 'https': 'socks5://[USER]:[PASS]@[HOST]:[PORT]'\r\n}\r\nr = requests.get(url, proxies=proxies)\r\n```\r\n \r\n ", "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.", "Sorry, I get a wrong use of issue. Thank you very much.", "sorry I am late when I see the email. But I had see it in the github. I had solved this problme. This error comes from the proxy, I should change the style pac to global variable.\nThank you very much!\n\nAt 2018-01-06 23:18:52, \"Seth M. Larson\" <[email protected]> wrote:\n\n\nYou might need to make requests aware of your proxy. I suggest reading and following the examples shown in Advanced Usage - Proxies section of our documentation.\n\n—\nYou are receiving this because you authored the thread.\nReply to this email directly, view it on GitHub, or mute the thread." ]
https://api.github.com/repos/psf/requests/issues/4449
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4449/labels{/name}
https://api.github.com/repos/psf/requests/issues/4449/comments
https://api.github.com/repos/psf/requests/issues/4449/events
https://github.com/psf/requests/issues/4449
286,424,609
MDU6SXNzdWUyODY0MjQ2MDk=
4,449
SSL certificate/key not working but same certificate/key works with curl
{ "avatar_url": "https://avatars.githubusercontent.com/u/11277946?v=4", "events_url": "https://api.github.com/users/sheilacheng/events{/privacy}", "followers_url": "https://api.github.com/users/sheilacheng/followers", "following_url": "https://api.github.com/users/sheilacheng/following{/other_user}", "gists_url": "https://api.github.com/users/sheilacheng/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sheilacheng", "id": 11277946, "login": "sheilacheng", "node_id": "MDQ6VXNlcjExMjc3OTQ2", "organizations_url": "https://api.github.com/users/sheilacheng/orgs", "received_events_url": "https://api.github.com/users/sheilacheng/received_events", "repos_url": "https://api.github.com/users/sheilacheng/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sheilacheng/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sheilacheng/subscriptions", "type": "User", "url": "https://api.github.com/users/sheilacheng", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-01-05T22:36:39Z
2021-09-08T04:00:42Z
2018-01-06T16:03:53Z
NONE
resolved
Summary. SSL certificate/key not working but same certificate/key works with curl ## Expected Result certificate/key verifies properly ## Actual Result SSLError: HTTPSConnectionPool(host='app.domain.com', port=443): Max retries exceeded with url: /p1/p2/p3 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),)) ## Reproduction Steps This works: &nbsp;&nbsp;&nbsp; curl -X POST -v -s -k --key client.key --cert client.crt <blah blah ....> <br> This does not and gives the above error. &nbsp;&nbsp;&nbsp; cert_file_path = '/path-to-certfile/cert.pem' &nbsp;&nbsp;&nbsp; key_file_path = '/path-to-keyfile/key.pem' &nbsp;&nbsp;&nbsp; cert = (cert_file_path, key_file_path) &nbsp;&nbsp;&nbsp; requests.post(url, data=payload, cert=cert) <br> The client.key and client.crt are actually both in pem format (ascii readable). The server uses Nginx. I found some references about missing intermediate certificates but I'm not sure how to fix it on the server or add it to my client (just to see it work!). <br> ```python import requests ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.0.3" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "100020cf", "version": "17.2.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020cf" }, "urllib3": { "version": "1.22" }, "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/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/4449/reactions" }
https://api.github.com/repos/psf/requests/issues/4449/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.\r\n\r\n`curl -k` (a.k.a, `curl --insecure`) means do not verify the server's certificate when performing the TLS connection. `cert` in `requests` is equivalent to the `--cert` and `--key` parameters but Requests will still try to perform certificate validation. That means that you probably want to also pass `verify=False` to requests. ", "To follow up, I have the issue described in this post.\r\nhttps://stackoverflow.com/questions/42538930/ssl-error-with-python-requests-despite-up-to-date-dependencies\r\n\r\nThe fix is just to concatenate all the certs (including intermediate ones) into a single cert file and stick it on the cert directly on the server. If you are the client and can't fix the server, just use the test cert in the post." ]
https://api.github.com/repos/psf/requests/issues/4448
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4448/labels{/name}
https://api.github.com/repos/psf/requests/issues/4448/comments
https://api.github.com/repos/psf/requests/issues/4448/events
https://github.com/psf/requests/issues/4448
286,230,719
MDU6SXNzdWUyODYyMzA3MTk=
4,448
sslv3 alert handshake failure
{ "avatar_url": "https://avatars.githubusercontent.com/u/18612720?v=4", "events_url": "https://api.github.com/users/gauttham/events{/privacy}", "followers_url": "https://api.github.com/users/gauttham/followers", "following_url": "https://api.github.com/users/gauttham/following{/other_user}", "gists_url": "https://api.github.com/users/gauttham/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gauttham", "id": 18612720, "login": "gauttham", "node_id": "MDQ6VXNlcjE4NjEyNzIw", "organizations_url": "https://api.github.com/users/gauttham/orgs", "received_events_url": "https://api.github.com/users/gauttham/received_events", "repos_url": "https://api.github.com/users/gauttham/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gauttham/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gauttham/subscriptions", "type": "User", "url": "https://api.github.com/users/gauttham", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-01-05T09:08:55Z
2021-09-08T05:00:37Z
2018-01-05T11:03:16Z
NONE
resolved
Summary: I am trying to hit an API from my MAC to a local server with verify=False Option. The below curl command works perfectly fine for my use case. However, the same thing when done via Python requests module, returns the following error: SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert handshake failure')],)",) Here is the Curl Command: curl -vX POST -H "Content-Type: application/json" -d '{"filters":{"cpcode":["ymdfile"]}}' '<URL>/api/v1/nkarkala/reports/mkttrafficedgebycpcode_D_t-cp_v1?start=2017-11-30T00:00:00Z&end=2017-11-30T01:00:00Z' def refreshARLHostnameInfo(): headers = { 'Content-Type': 'application/json', 'X-Source-Id': 'sshete', } params = ( ('start', '2017-11-30T00:00:00Z'), ('end', '2017-11-30T01:00:00Z'), ) data = '{"filters":{"cpcode":["ymdfile"]}}' print(requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS) response = requests.post( '<URL>/api/v1/nkarkala/reports/mkttrafficedgebycpcode_D_t-cp_v1', headers=headers, params=params, data=data,verify=daconstants.VERIFY) print (response) return response ## Expected Result What you expected. ## Actual Result Error Traceback (most recent call last) ~/projects/premium_env/lib/python3.5/site-packages/requests/packages/urllib3/contrib/pyopenssl.py in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ca_cert_dir) 347 try: --> 348 cnx.do_handshake() 349 except OpenSSL.SSL.WantReadError: ~/projects/premium_env/lib/python3.5/site-packages/OpenSSL/SSL.py in do_handshake(self) 1805 result = _lib.SSL_do_handshake(self._ssl) -> 1806 self._raise_ssl_error(self._ssl, result) 1807 ~/projects/premium_env/lib/python3.5/site-packages/OpenSSL/SSL.py in _raise_ssl_error(self, ssl, result) 1545 else: -> 1546 _raise_current_error() 1547 ~/projects/premium_env/lib/python3.5/site-packages/OpenSSL/_util.py in exception_from_error_queue(exception_type) 53 ---> 54 raise exception_type(errors) 55 Error: [('SSL routines', 'ssl3_read_bytes', 'sslv3 alert handshake failure')] During handling of the above exception, another exception occurred: SSLError Traceback (most recent call last) ~/projects/premium_env/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, **response_kw) 594 body=body, headers=headers, --> 595 chunked=chunked) 596 ~/projects/premium_env/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw) 351 try: --> 352 self._validate_conn(conn) 353 except (SocketTimeout, BaseSSLError) as e: ~/projects/premium_env/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in _validate_conn(self, conn) 830 if not getattr(conn, 'sock', None): # AppEngine might not have `.sock` --> 831 conn.connect() 832 ~/projects/premium_env/lib/python3.5/site-packages/requests/packages/urllib3/connection.py in connect(self) 288 server_hostname=hostname, --> 289 ssl_version=resolved_ssl_version) 290 ~/projects/premium_env/lib/python3.5/site-packages/requests/packages/urllib3/contrib/pyopenssl.py in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ca_cert_dir) 354 except OpenSSL.SSL.Error as e: --> 355 raise ssl.SSLError('bad handshake: %r' % e) 356 break SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert handshake failure')],)",) During handling of the above exception, another exception occurred: SSLError Traceback (most recent call last) ~/projects/premium_env/lib/python3.5/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies) 422 retries=self.max_retries, --> 423 timeout=timeout 424 ) ~/projects/premium_env/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, **response_kw) 620 clean_exit = False --> 621 raise SSLError(e) 622 SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert handshake failure')],)",) During handling of the above exception, another exception occurred: SSLError Traceback (most recent call last) <ipython-input-2-2e5fc36de7bc> in <module>() ----> 1 response = vds_controllers.refreshARLHostnameInfo() ~/projects/premium_env/premium_healthcheck_platform/src/ab-www/premium_healthcheck_platform/storage/vds/vds_controllers.py in refreshARLHostnameInfo() 26 response = requests.post( 27 '<URL>/api/v1/nkarkala/reports/mkttrafficedgebycpcode_D_t-cp_v1', ---> 28 headers=headers, params=params, data=data,verify=daconstants.VERIFY) 29 30 ~/projects/premium_env/lib/python3.5/site-packages/requests/api.py in post(url, data, json, **kwargs) 108 """ 109 --> 110 return request('post', url, data=data, json=json, **kwargs) 111 112 ~/projects/premium_env/lib/python3.5/site-packages/requests/api.py in request(method, url, **kwargs) 54 # cases, and look like a memory leak in others. 55 with sessions.Session() as session: ---> 56 return session.request(method=method, url=url, **kwargs) 57 58 ~/projects/premium_env/lib/python3.5/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 473 } 474 send_kwargs.update(settings) --> 475 resp = self.send(prep, **send_kwargs) 476 477 return resp ~/projects/premium_env/lib/python3.5/site-packages/requests/sessions.py in send(self, request, **kwargs) 594 595 # Send the request --> 596 r = adapter.send(request, **kwargs) 597 598 # Total elapsed time of the request (approximately) ~/projects/premium_env/lib/python3.5/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies) 495 except (_SSLError, _HTTPError) as e: 496 if isinstance(e, _SSLError): --> 497 raise SSLError(e, request=request) 498 elif isinstance(e, ReadTimeoutError): 499 raise ReadTimeout(e, request=request) SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert handshake failure')],)",) ## Reproduction Steps Run the function PIP Freeze Output: aenum==2.0.8 appnope==0.1.0 asn1crypto==0.24.0 bleach==2.1.2 certifi==2017.11.5 cffi==1.11.2 chardet==3.0.4 config==0.3.9 coreapi==2.3.3 coreschema==0.0.4 cryptography==2.1.4 dbattery-python-api==1.2 decorator==4.1.2 Django==1.10.1 django-redis-cache==1.7.1 django-rest-swagger==2.1.2 djangorestframework==3.4.4 dnspython==1.15.0 entrypoints==0.2.3 html5lib==1.0.1 idna==2.6 ijson==2.3 ipdb==0.10.3 ipykernel==4.7.0 ipython==6.2.1 ipython-genutils==0.2.0 ipywidgets==7.0.5 itypes==1.1.0 jedi==0.11.0 Jinja2==2.10 jsonschema==2.6.0 jupyter==1.0.0 jupyter-client==5.1.0 jupyter-console==5.2.0 jupyter-core==4.4.0 MarkupSafe==1.0 mistune==0.8.3 nbconvert==5.3.1 nbformat==4.4.0 ndg-httpsclient==0.4.3 netstorageapi==1.2.8 notebook==5.2.2 openapi-codec==1.3.2 pandocfilters==1.4.2 parso==0.1.0 pexpect==4.3.0 pickleshare==0.7.4 prompt-toolkit==1.0.15 psycopg2==2.7.3.2 ptyprocess==0.5.2 pyasn1==0.4.2 pycparser==2.18 Pygments==2.2.0 PyJWT==1.5.3 pyOpenSSL==17.5.0 PyPika==0.9.4 python-dateutil==2.6.1 pytz==2017.3 pyzmq==16.0.3 qtconsole==4.3.1 redis==2.10.6 requests==2.11.1 simplegeneric==0.8.1 simplejson==3.13.2 six==1.11.0 terminado==0.8.1 testpath==0.3.1 tornado==4.5.2 traitlets==4.3.2 uncurl==0.0.8 uritemplate==3.0.0 urllib3==1.22 wcwidth==0.1.7 webencodings==0.5.1 widgetsnbextension==3.0.8 xerox==0.4.1 Regards, Gautam
{ "avatar_url": "https://avatars.githubusercontent.com/u/18612720?v=4", "events_url": "https://api.github.com/users/gauttham/events{/privacy}", "followers_url": "https://api.github.com/users/gauttham/followers", "following_url": "https://api.github.com/users/gauttham/following{/other_user}", "gists_url": "https://api.github.com/users/gauttham/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gauttham", "id": 18612720, "login": "gauttham", "node_id": "MDQ6VXNlcjE4NjEyNzIw", "organizations_url": "https://api.github.com/users/gauttham/orgs", "received_events_url": "https://api.github.com/users/gauttham/received_events", "repos_url": "https://api.github.com/users/gauttham/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gauttham/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gauttham/subscriptions", "type": "User", "url": "https://api.github.com/users/gauttham", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4448/reactions" }
https://api.github.com/repos/psf/requests/issues/4448/timeline
null
completed
null
null
false
[ "This was an issue with the wrong certs.. My Bad.. Closing this out." ]
https://api.github.com/repos/psf/requests/issues/4447
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4447/labels{/name}
https://api.github.com/repos/psf/requests/issues/4447/comments
https://api.github.com/repos/psf/requests/issues/4447/events
https://github.com/psf/requests/pull/4447
286,133,126
MDExOlB1bGxSZXF1ZXN0MTYxMjMxODI0
4,447
Enable early responses (like 404 errors) to be received for chunk-encoded requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/3890535?v=4", "events_url": "https://api.github.com/users/rasjidw/events{/privacy}", "followers_url": "https://api.github.com/users/rasjidw/followers", "following_url": "https://api.github.com/users/rasjidw/following{/other_user}", "gists_url": "https://api.github.com/users/rasjidw/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rasjidw", "id": 3890535, "login": "rasjidw", "node_id": "MDQ6VXNlcjM4OTA1MzU=", "organizations_url": "https://api.github.com/users/rasjidw/orgs", "received_events_url": "https://api.github.com/users/rasjidw/received_events", "repos_url": "https://api.github.com/users/rasjidw/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rasjidw/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rasjidw/subscriptions", "type": "User", "url": "https://api.github.com/users/rasjidw", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-01-04T22:29:10Z
2021-09-04T00:06:34Z
2018-01-11T03:12:35Z
NONE
resolved
Initial version of a fix for issue #4445.
{ "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/4447/reactions" }
https://api.github.com/repos/psf/requests/issues/4447/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4447.diff", "html_url": "https://github.com/psf/requests/pull/4447", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4447.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4447" }
true
[ "When I get some time I'll look at reworking to avoid the use of threads.", "@rasjidw I'm going to close this in the meantime. Please open a new pull request once you've worked that out." ]
https://api.github.com/repos/psf/requests/issues/4446
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4446/labels{/name}
https://api.github.com/repos/psf/requests/issues/4446/comments
https://api.github.com/repos/psf/requests/issues/4446/events
https://github.com/psf/requests/issues/4446
285,945,233
MDU6SXNzdWUyODU5NDUyMzM=
4,446
Unable to request any webpage
{ "avatar_url": "https://avatars.githubusercontent.com/u/16529675?v=4", "events_url": "https://api.github.com/users/LarsaSolidor/events{/privacy}", "followers_url": "https://api.github.com/users/LarsaSolidor/followers", "following_url": "https://api.github.com/users/LarsaSolidor/following{/other_user}", "gists_url": "https://api.github.com/users/LarsaSolidor/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/LarsaSolidor", "id": 16529675, "login": "LarsaSolidor", "node_id": "MDQ6VXNlcjE2NTI5Njc1", "organizations_url": "https://api.github.com/users/LarsaSolidor/orgs", "received_events_url": "https://api.github.com/users/LarsaSolidor/received_events", "repos_url": "https://api.github.com/users/LarsaSolidor/repos", "site_admin": false, "starred_url": "https://api.github.com/users/LarsaSolidor/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LarsaSolidor/subscriptions", "type": "User", "url": "https://api.github.com/users/LarsaSolidor", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-01-04T10:46:32Z
2021-09-08T05:00:37Z
2018-01-04T16:48:02Z
NONE
resolved
Unable to request any webpage on two Windows 10 64 bit machines with Python 3.6.3 64 bit and Python 3.6.3 64 bit installed. ## Expected Result I expected to receive a Response object with the website data. ## Actual Result Received the following error messages after a very long delay. ``` "C:\Program Files\Python36\python.exe" "C:/Users/user.name/Google Drive/Automation/RoHSWebScraper/main.py" Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\urllib3\contrib\pyopenssl.py", line 441, in wrap_socket cnx.do_handshake() File "C:\Program Files\Python36\lib\site-packages\OpenSSL\SSL.py", line 1716, in do_handshake self._raise_ssl_error(self._ssl, result) File "C:\Program Files\Python36\lib\site-packages\OpenSSL\SSL.py", line 1449, in _raise_ssl_error raise SysCallError(-1, "Unexpected EOF") OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen chunked=chunked) File "C:\Program Files\Python36\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "C:\Program Files\Python36\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn conn.connect() File "C:\Program Files\Python36\lib\site-packages\urllib3\connection.py", line 326, in connect ssl_context=context) File "C:\Program Files\Python36\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Program Files\Python36\lib\site-packages\urllib3\contrib\pyopenssl.py", line 448, in wrap_socket raise ssl.SSLError('bad handshake: %r' % e) ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\requests\adapters.py", line 440, in send timeout=timeout File "C:\Program Files\Python36\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "C:\Program Files\Python36\lib\site-packages\urllib3\util\retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='automatetheboringstuff.com', port=443): Max retries exceeded with url: /files/rj.txt (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:/Users/user.name/Google Drive/Automation/RoHSWebScraper/main.py", line 3, in <module> res = requests.get('https://automatetheboringstuff.com/files/rj.txt', verify=False) File "C:\Program Files\Python36\lib\site-packages\requests\api.py", line 72, in get return request('get', url, params=params, **kwargs) File "C:\Program Files\Python36\lib\site-packages\requests\api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "C:\Program Files\Python36\lib\site-packages\requests\sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "C:\Program Files\Python36\lib\site-packages\requests\sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "C:\Program Files\Python36\lib\site-packages\requests\adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='automatetheboringstuff.com', port=443): Max retries exceeded with url: /files/rj.txt (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) Process finished with exit code 1 ``` ## Reproduction Steps ```python import requests res = requests.get('https://automatetheboringstuff.com/files/rj.txt') type(res) res.raise_for_status() print(res) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.1.4" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "1010007f", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ```
{ "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/4446/reactions" }
https://api.github.com/repos/psf/requests/issues/4446/timeline
null
completed
null
null
false
[ "Hey @LarsaSolidor, if you aren't able to request ANY webpages, then that suggests there is some kind of local network issue. Are you possibly behind a proxy or corporate firewall that may be intercepting your traffic? If you are, you likely need to add any additional required SSL certs with your requests.\r\n\r\nIf you need further assistance, please open an issue on [StackOverflow](https://stackoverflow.com) which is how the Requests project handles help questions. We prefer to keep the Github issue tracker for defects in Requests, which I don't believe this is. Thanks for reaching out!" ]
https://api.github.com/repos/psf/requests/issues/4445
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4445/labels{/name}
https://api.github.com/repos/psf/requests/issues/4445/comments
https://api.github.com/repos/psf/requests/issues/4445/events
https://github.com/psf/requests/issues/4445
285,895,740
MDU6SXNzdWUyODU4OTU3NDA=
4,445
404 responses for chunk-encoded requests may not be received
{ "avatar_url": "https://avatars.githubusercontent.com/u/3890535?v=4", "events_url": "https://api.github.com/users/rasjidw/events{/privacy}", "followers_url": "https://api.github.com/users/rasjidw/followers", "following_url": "https://api.github.com/users/rasjidw/following{/other_user}", "gists_url": "https://api.github.com/users/rasjidw/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rasjidw", "id": 3890535, "login": "rasjidw", "node_id": "MDQ6VXNlcjM4OTA1MzU=", "organizations_url": "https://api.github.com/users/rasjidw/orgs", "received_events_url": "https://api.github.com/users/rasjidw/received_events", "repos_url": "https://api.github.com/users/rasjidw/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rasjidw/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rasjidw/subscriptions", "type": "User", "url": "https://api.github.com/users/rasjidw", "user_view_type": "public" }
[]
closed
false
null
[]
null
3
2018-01-04T06:50:33Z
2024-05-19T19:02:58Z
2024-05-19T19:02:58Z
NONE
null
404 responses (or any response sent by the server prior to the entire request being sent) for chunk-encoded requests may not be received by the caller. This appears to happen if the server closes the connection (after sending the 404 response) prior to the completion of the chunked post / upload. ## Expected Result Posting a chunked encoded request to an invalid URL should return the 404 response. ## Actual Result A ```requests.exceptions.ConnectionError: [Errno 32] Broken pipe``` error is raised instead. ## Reproduction Steps A minimal server using flask is given below: ``` #!/usr/bin/env python3 import sys from flask import Flask, request app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' @app.route('/post_endpoint', methods=['POST']) def post_normal_response(): for line in request.stream: str_line = line.decode('utf-8') sys.stdout.write(str_line) sys.stdout.flush() return 'OK' if __name__ == '__main__': app.run() ``` Client code illustrating the problem is: ``` #!/usr/bin/env python3 from time import sleep import requests VALID_URL = 'http://127.0.0.1:5000/post_endpoint' INVALID_URL = 'http://127.0.0.1:5000/does_not_exist' LINES = ['Line {}\n'.format(x) for x in range(5)] DATA = ''.join(LINES).encode('utf-8') def chunked(): for line in LINES: sleep(1) yield line.encode('utf-8') def test_url(url): r = requests.post(url, data=DATA) print(r) r = requests.post(url, data=chunked()) print(r) if __name__ == '__main__': test_url(VALID_URL) print('-----') test_url(INVALID_URL) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.5.2" }, "platform": { "release": "4.4.0-104-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000207f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ``` ## Patch to address the issue [requests-patch.zip](https://github.com/requests/requests/files/1602607/requests-patch.zip)
{ "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/4445/reactions" }
https://api.github.com/repos/psf/requests/issues/4445/timeline
null
completed
null
null
false
[ "Thanks for this! Instead of submitting the patch as a zip, consider submitting a Pull Request and linking it to this issue. :)", "Pull request done. If the approach is okay I can look at adding tests etc.", "Chunked requests are now handled by urllib3." ]
https://api.github.com/repos/psf/requests/issues/4444
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4444/labels{/name}
https://api.github.com/repos/psf/requests/issues/4444/comments
https://api.github.com/repos/psf/requests/issues/4444/events
https://github.com/psf/requests/issues/4444
285,348,445
MDU6SXNzdWUyODUzNDg0NDU=
4,444
Download file with Chinese charactor, the Response headers filename is incorrect, not cn, but messy code.
{ "avatar_url": "https://avatars.githubusercontent.com/u/13959768?v=4", "events_url": "https://api.github.com/users/truelovesdu/events{/privacy}", "followers_url": "https://api.github.com/users/truelovesdu/followers", "following_url": "https://api.github.com/users/truelovesdu/following{/other_user}", "gists_url": "https://api.github.com/users/truelovesdu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/truelovesdu", "id": 13959768, "login": "truelovesdu", "node_id": "MDQ6VXNlcjEzOTU5NzY4", "organizations_url": "https://api.github.com/users/truelovesdu/orgs", "received_events_url": "https://api.github.com/users/truelovesdu/received_events", "repos_url": "https://api.github.com/users/truelovesdu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/truelovesdu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/truelovesdu/subscriptions", "type": "User", "url": "https://api.github.com/users/truelovesdu", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-01-02T03:04:06Z
2021-09-08T05:00:38Z
2018-01-02T17:00:26Z
NONE
resolved
When I log infos, logging.debug("@@@###:%s" % response.headers) The output is as below: @@@###:{'Server': 'openresty', 'Date': 'Tue, 02 Jan 2018 03:02:52 GMT', 'Content-Type': 'application/octet-stream;charset=utf8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Content-Disposition': ';filename="æµ\x8bè¯\x95ç\x8e¯å¢\x83ä¿¡æ\x81¯.xlsx"', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'} U can see the filename is messy.
{ "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/4444/reactions" }
https://api.github.com/repos/psf/requests/issues/4444/timeline
null
completed
null
null
false
[ "Please provide us with the output of\r\n\r\n```\r\npython -m requests.help\r\n```\r\n\r\nIf that is unavailable on your version of Requests please provide some basic information about your system (Python version, operating system, etc)." ]
https://api.github.com/repos/psf/requests/issues/4443
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4443/labels{/name}
https://api.github.com/repos/psf/requests/issues/4443/comments
https://api.github.com/repos/psf/requests/issues/4443/events
https://github.com/psf/requests/issues/4443
285,308,691
MDU6SXNzdWUyODUzMDg2OTE=
4,443
fragment not append on redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/30517876?v=4", "events_url": "https://api.github.com/users/stcioc/events{/privacy}", "followers_url": "https://api.github.com/users/stcioc/followers", "following_url": "https://api.github.com/users/stcioc/following{/other_user}", "gists_url": "https://api.github.com/users/stcioc/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/stcioc", "id": 30517876, "login": "stcioc", "node_id": "MDQ6VXNlcjMwNTE3ODc2", "organizations_url": "https://api.github.com/users/stcioc/orgs", "received_events_url": "https://api.github.com/users/stcioc/received_events", "repos_url": "https://api.github.com/users/stcioc/repos", "site_admin": false, "starred_url": "https://api.github.com/users/stcioc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stcioc/subscriptions", "type": "User", "url": "https://api.github.com/users/stcioc", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
null
[]
null
5
2018-01-01T13:57:19Z
2021-09-08T04:00:47Z
2018-01-21T18:53:24Z
NONE
resolved
In the following case (see detailed explanation and test case at http://www.webdbg.com/test/redir/fragment/): - try to open a link that contains a fragment (say http://foo/#SomeInfo) - the server sends a 302 Redir to http://bar ## Expected Result The expected result is that requests library follows the redirection and appends the original fragment from the link (e.g. it redirects to http://bar/#SomeInfo) ## Actual Result The redirect link is followed without the fragment (e.g. requests tries to open http://bar) ## Reproduction Steps ```python import requests response = requests.get("https://www.bayden.com/test/redir/fragment/redir-1.asp#/HereIsSomeInfo") html = response.text print(response.url) ``` output is "http://www.enhanceie.com/test/redir/fragment/final.asp" output should be "http://www.enhanceie.com/test/redir/fragment/final.asp#HereIsSomeInfo" ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.2" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "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": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4443/reactions" }
https://api.github.com/repos/psf/requests/issues/4443/timeline
null
completed
null
null
false
[ "This isn't how redirects work. The RFCs (3986, 7230, 7231, 7232, 7233, 7234, 7235) do not require or prescribe retaining the fragment. If you want us to retain the fragment you'll need to handle redirects yourself. The server is telling us what to redirect to and we're supposed to follow that.\r\n\r\nThanks for opening this issue to clarify.", "Actually this was formalized in the rewrite of HTTP/1.1 (see also https://stackoverflow.com/questions/2286402/url-fragment-and-302-redirects)", "This is a fantastic way to leak some data to an untrusted server, however, and is probably far from ideal. Oh well, we'll have to fix this.", "In case that StackOverflow question goes away, here's the relevant portion of 7231: https://tools.ietf.org/html/rfc7231#section-7.1.2", "This should be resolved on master with #4452 and available in the next release. Thanks again for the report @stcioc!" ]
https://api.github.com/repos/psf/requests/issues/4442
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4442/labels{/name}
https://api.github.com/repos/psf/requests/issues/4442/comments
https://api.github.com/repos/psf/requests/issues/4442/events
https://github.com/psf/requests/pull/4442
285,276,545
MDExOlB1bGxSZXF1ZXN0MTYwNjMwNTYz
4,442
Reduce overall memory usage by removing cgi dependency and writing a protected function
{ "avatar_url": "https://avatars.githubusercontent.com/u/18693326?v=4", "events_url": "https://api.github.com/users/DemetriosBairaktaris/events{/privacy}", "followers_url": "https://api.github.com/users/DemetriosBairaktaris/followers", "following_url": "https://api.github.com/users/DemetriosBairaktaris/following{/other_user}", "gists_url": "https://api.github.com/users/DemetriosBairaktaris/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DemetriosBairaktaris", "id": 18693326, "login": "DemetriosBairaktaris", "node_id": "MDQ6VXNlcjE4NjkzMzI2", "organizations_url": "https://api.github.com/users/DemetriosBairaktaris/orgs", "received_events_url": "https://api.github.com/users/DemetriosBairaktaris/received_events", "repos_url": "https://api.github.com/users/DemetriosBairaktaris/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DemetriosBairaktaris/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DemetriosBairaktaris/subscriptions", "type": "User", "url": "https://api.github.com/users/DemetriosBairaktaris", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2017-12-31T21:15:20Z
2021-09-04T00:06:35Z
2018-01-04T22:32:40Z
CONTRIBUTOR
resolved
In response to issue #4313 , I removed the cgi module import and added a parse_header function nested inside get_encoding_from_headers in utils.py. I have run the tests both before and after making these changes. The test_util cases all passed before and they still do now. Please let me know about any suggestions to this code.
{ "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/4442/reactions" }
https://api.github.com/repos/psf/requests/issues/4442/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4442.diff", "html_url": "https://github.com/psf/requests/pull/4442", "merged_at": "2018-01-04T22:32:40Z", "patch_url": "https://github.com/psf/requests/pull/4442.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4442" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4442?src=pr&el=h1) Report\n> Merging [#4442](https://codecov.io/gh/requests/requests/pull/4442?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/24092b11d74af0a766d9cc616622f38adb0044b9?src=pr&el=desc) will **increase** coverage by `1.14%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4442/graphs/tree.svg?token=mZGswIiXLa&height=150&src=pr&width=650)](https://codecov.io/gh/requests/requests/pull/4442?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4442 +/- ##\n==========================================\n+ Coverage 89% 90.14% +1.14% \n==========================================\n Files 18 15 -3 \n Lines 2065 1543 -522 \n==========================================\n- Hits 1838 1391 -447 \n+ Misses 227 152 -75\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4442?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/compat.py](https://codecov.io/gh/requests/requests/pull/4442/diff?src=pr&el=tree#diff-cmVxdWVzdHMvY29tcGF0LnB5) | | |\n| [tests/testserver/\\_\\_init\\_\\_.py](https://codecov.io/gh/requests/requests/pull/4442/diff?src=pr&el=tree#diff-dGVzdHMvdGVzdHNlcnZlci9fX2luaXRfXy5weQ==) | | |\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/4442/diff?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.67% <0%> (+0.22%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4442?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4442?src=pr&el=footer). Last update [24092b1...19cfec2](https://codecov.io/gh/requests/requests/pull/4442?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@sigmavirus24 Thoughts on this? I figured since the since we are only worrying about parsing content-type headers, we should focus the function on that format. ", "@sigmavirus24 Ok, I pushed some changes with your suggestions, it's looking better for sure. ", "@SethMichaelLarson Good suggestions, I pushed some changes. ", "Besides my two last comments this looks good to me. I'll leave this review for @sigmavirus24 now. :)\r\n ", "Thanks for your patience @DemetriosBairaktaris ! This looks excellent!" ]
https://api.github.com/repos/psf/requests/issues/4441
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4441/labels{/name}
https://api.github.com/repos/psf/requests/issues/4441/comments
https://api.github.com/repos/psf/requests/issues/4441/events
https://github.com/psf/requests/issues/4441
285,262,801
MDU6SXNzdWUyODUyNjI4MDE=
4,441
README does not render properly on PyPI
{ "avatar_url": "https://avatars.githubusercontent.com/u/10340167?v=4", "events_url": "https://api.github.com/users/johnthagen/events{/privacy}", "followers_url": "https://api.github.com/users/johnthagen/followers", "following_url": "https://api.github.com/users/johnthagen/following{/other_user}", "gists_url": "https://api.github.com/users/johnthagen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/johnthagen", "id": 10340167, "login": "johnthagen", "node_id": "MDQ6VXNlcjEwMzQwMTY3", "organizations_url": "https://api.github.com/users/johnthagen/orgs", "received_events_url": "https://api.github.com/users/johnthagen/received_events", "repos_url": "https://api.github.com/users/johnthagen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/johnthagen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/johnthagen/subscriptions", "type": "User", "url": "https://api.github.com/users/johnthagen", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-12-31T15:24:28Z
2021-09-08T03:00:33Z
2018-03-12T21:43:16Z
CONTRIBUTOR
resolved
# Summary Requests PyPI page does not render, making it much less useful. ## Expected Result Rendered RST to be shown on https://pypi.python.org/pypi/requests ## Actual Result Raw unrendered RST: ``` Requests: HTTP for Humans ========================= .. image:: https://img.shields.io/pypi/v/requests.svg :target: https://pypi.python.org/pypi/requests .. image:: https://img.shields.io/pypi/l/requests.svg :target: https://pypi.python.org/pypi/requests ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4441/reactions" }
https://api.github.com/repos/psf/requests/issues/4441/timeline
null
completed
null
null
false
[ "Could this be due to some invalid RST associated with line 110 of README.rst? I think it needs back-quotes, e.g.\r\n\r\n``.. _`Contributor Friendly`: https://github.com/requests/requests/issues?direction=desc&labels=Contributor+Friendly&page=1&sort=updated&state=open``\r\n\r\ninstead of the current:\r\n\r\n``.. _Contributor Friendly: https://github.com/requests/requests/issues?direction=desc&labels=Contributor+Friendly&page=1&sort=updated&state=open``", "@alexdarling that shouldn't be the problem. In fact our readme check is passing on CI. I suspect whatever the issue *was* is now fixed.", "will be fixed in the next release — pypi doesn't allow you to update existing releases any longer!" ]
https://api.github.com/repos/psf/requests/issues/4440
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4440/labels{/name}
https://api.github.com/repos/psf/requests/issues/4440/comments
https://api.github.com/repos/psf/requests/issues/4440/events
https://github.com/psf/requests/issues/4440
285,189,012
MDU6SXNzdWUyODUxODkwMTI=
4,440
Proxy doesn't work for https connections
{ "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
2
2017-12-30T07:22:53Z
2021-09-04T00:06:25Z
2017-12-30T07:39:41Z
NONE
resolved
Summary. The requests proxies do work for the **http** connections but not for **https** connections. I tried to find a solution to this problem but could not find any satisfied answer. Here is the sample test code: ```python import requests proxy = { 'http': 'http://user:pass@ip:http-port', 'https': 'http://user:pass@ip:https-port' } res = requests.get('https://somesite', proxies=proxy) print(res.text) ``` ## Expected Result It should return the page content by establishing a connection as it does in case of **http** request. ## Actual Result I got this error upon using https request: ```bash requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.google.com', port= 443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', error('Invalid response from tunnel request',))) ``` ## Reproduction Steps ```python import requests proxy = { 'http': 'http://user:pass@ip:http-port', 'https': 'http://user:pass@ip:https-port' } res = requests.get('https://somesite', proxies=proxy) print(res.text) ``` ## System Information I'm using this code on **Windows Operating System**.
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/4440/reactions" }
https://api.github.com/repos/psf/requests/issues/4440/timeline
null
completed
null
null
false
[ "It seems to work now, my bad !\r\nJust found the solution here [Socks Support](https://github.com/requests/requests/pull/478)", "+1 requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: /search?source=hp&ei=h45CXayCH_eVr7wPmoahuAU&q=inurl:id=1 (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, '远程主机强迫关闭了一个\r\n现有的连接。', None, 10054, None)))" ]
https://api.github.com/repos/psf/requests/issues/4439
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4439/labels{/name}
https://api.github.com/repos/psf/requests/issues/4439/comments
https://api.github.com/repos/psf/requests/issues/4439/events
https://github.com/psf/requests/pull/4439
284,874,004
MDExOlB1bGxSZXF1ZXN0MTYwMzU3NTEz
4,439
Fix broken link to Certifi
{ "avatar_url": "https://avatars.githubusercontent.com/u/11088651?v=4", "events_url": "https://api.github.com/users/nkonin/events{/privacy}", "followers_url": "https://api.github.com/users/nkonin/followers", "following_url": "https://api.github.com/users/nkonin/following{/other_user}", "gists_url": "https://api.github.com/users/nkonin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nkonin", "id": 11088651, "login": "nkonin", "node_id": "MDQ6VXNlcjExMDg4NjUx", "organizations_url": "https://api.github.com/users/nkonin/orgs", "received_events_url": "https://api.github.com/users/nkonin/received_events", "repos_url": "https://api.github.com/users/nkonin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nkonin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nkonin/subscriptions", "type": "User", "url": "https://api.github.com/users/nkonin", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2017-12-28T09:17:44Z
2021-09-03T00:11:14Z
2018-01-21T14:36:32Z
CONTRIBUTOR
resolved
certifi.io doesn't available at least since 07.11.2017 (https://github.com/certifi/certifi.io/issues/16)
{ "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/4439/reactions" }
https://api.github.com/repos/psf/requests/issues/4439/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4439.diff", "html_url": "https://github.com/psf/requests/pull/4439", "merged_at": "2018-01-21T14:36:32Z", "patch_url": "https://github.com/psf/requests/pull/4439.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4439" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4439?src=pr&el=h1) Report\n> Merging [#4439](https://codecov.io/gh/requests/requests/pull/4439?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/6a74c70a3ab00435281bf70f8be581a6f9e0419d?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4439/graphs/tree.svg?width=650&token=mZGswIiXLa&height=150&src=pr)](https://codecov.io/gh/requests/requests/pull/4439?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4439 +/- ##\n=======================================\n Coverage 90.14% 90.14% \n=======================================\n Files 15 15 \n Lines 1543 1543 \n=======================================\n Hits 1391 1391 \n Misses 152 152\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4439?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4439?src=pr&el=footer). Last update [6a74c70...d55b81b](https://codecov.io/gh/requests/requests/pull/4439?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@nkonin, would you mind rebasing this onto the current master branch? I think we should be set after that." ]
https://api.github.com/repos/psf/requests/issues/4438
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4438/labels{/name}
https://api.github.com/repos/psf/requests/issues/4438/comments
https://api.github.com/repos/psf/requests/issues/4438/events
https://github.com/psf/requests/issues/4438
284,508,727
MDU6SXNzdWUyODQ1MDg3Mjc=
4,438
requests Read timed out when handle two same header in http response
{ "avatar_url": "https://avatars.githubusercontent.com/u/7598892?v=4", "events_url": "https://api.github.com/users/beruhan/events{/privacy}", "followers_url": "https://api.github.com/users/beruhan/followers", "following_url": "https://api.github.com/users/beruhan/following{/other_user}", "gists_url": "https://api.github.com/users/beruhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/beruhan", "id": 7598892, "login": "beruhan", "node_id": "MDQ6VXNlcjc1OTg4OTI=", "organizations_url": "https://api.github.com/users/beruhan/orgs", "received_events_url": "https://api.github.com/users/beruhan/received_events", "repos_url": "https://api.github.com/users/beruhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/beruhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/beruhan/subscriptions", "type": "User", "url": "https://api.github.com/users/beruhan", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-12-26T07:28:36Z
2021-09-08T05:00:39Z
2017-12-26T07:32:20Z
NONE
resolved
I use requests's get method to request a url,I found It always timeout,I use wireshark capture the response, the server has response the data,but why requests's get method timeout?,the response as flows ``` GET /onvif/device_service HTTP/1.1 Host: 50.250.78.211 Connection: keep-alive Accept-Encoding: gzip, deflate Accept: */* User-Agent: python-requests/2.18.4 HTTP/1.1 401 Unauthorized Date: Tue, 26 Dec 2017 03:24:12 GMT Server: DNVRS-Webs Cache-Control: no-cache Content-Type: text/html Connection: keep-alive Keep-Alive: timeout=60, max=99 WWW-Authenticate: Digest realm="DVRNVRDVS", domain="::", qop="auth", nonce="6f43ba833ff06ae8b7b36bd2dfb9704c:1514258652870", opaque="", algorithm="MD5", stale="FALSE" WWW-Authenticate: Basic realm="DVRNVRDVS" ``` test urls:http://50.250.78.211/onvif/device_service
{ "avatar_url": "https://avatars.githubusercontent.com/u/7598892?v=4", "events_url": "https://api.github.com/users/beruhan/events{/privacy}", "followers_url": "https://api.github.com/users/beruhan/followers", "following_url": "https://api.github.com/users/beruhan/following{/other_user}", "gists_url": "https://api.github.com/users/beruhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/beruhan", "id": 7598892, "login": "beruhan", "node_id": "MDQ6VXNlcjc1OTg4OTI=", "organizations_url": "https://api.github.com/users/beruhan/orgs", "received_events_url": "https://api.github.com/users/beruhan/received_events", "repos_url": "https://api.github.com/users/beruhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/beruhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/beruhan/subscriptions", "type": "User", "url": "https://api.github.com/users/beruhan", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4438/reactions" }
https://api.github.com/repos/psf/requests/issues/4438/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.\r\n\r\n---\r\n\r\nI would point out that my browser and cURL both exhibit the same behaviour as requests. The reason is that the server doesn't provide a `Content-Length` header to indicate there is no actual body. As a result, all 3 user agents expect a body that is sent as a chunked response (i.e., as if the server had sent `Transfer-Encoding: chunked` as a header). As a result, Requests waits for any data to come and we eventually timeout." ]
https://api.github.com/repos/psf/requests/issues/4437
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4437/labels{/name}
https://api.github.com/repos/psf/requests/issues/4437/comments
https://api.github.com/repos/psf/requests/issues/4437/events
https://github.com/psf/requests/issues/4437
284,206,838
MDU6SXNzdWUyODQyMDY4Mzg=
4,437
Add bearer token to requests.auth?
{ "avatar_url": "https://avatars.githubusercontent.com/u/5485798?v=4", "events_url": "https://api.github.com/users/richtier/events{/privacy}", "followers_url": "https://api.github.com/users/richtier/followers", "following_url": "https://api.github.com/users/richtier/following{/other_user}", "gists_url": "https://api.github.com/users/richtier/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/richtier", "id": 5485798, "login": "richtier", "node_id": "MDQ6VXNlcjU0ODU3OTg=", "organizations_url": "https://api.github.com/users/richtier/orgs", "received_events_url": "https://api.github.com/users/richtier/received_events", "repos_url": "https://api.github.com/users/richtier/repos", "site_admin": false, "starred_url": "https://api.github.com/users/richtier/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/richtier/subscriptions", "type": "User", "url": "https://api.github.com/users/richtier", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2017-12-22T16:49:08Z
2021-08-30T00:06:22Z
2018-03-27T19:53:26Z
NONE
resolved
in `request.auth` there is `HTTPBasicAuth` , `HTTPProxyAuth`, and `HTTPDigestAuth`, but no `HTTPBearerAuth` - for bearer authentication. It would look something like this: ``` class HTTPBearerAuth(requests.auth.AuthBase): def __init__(self, token): self.token = token def __eq__(self, other): return self.token == getattr(other, 'token', None) def __ne__(self, other): return not self == other def __call__(self, r): r.headers['Authorization'] = 'Bearer ' + self.token return r ``` Is there a reason to not add bearer auth to the codebase?
{ "avatar_url": "https://avatars.githubusercontent.com/u/5485798?v=4", "events_url": "https://api.github.com/users/richtier/events{/privacy}", "followers_url": "https://api.github.com/users/richtier/followers", "following_url": "https://api.github.com/users/richtier/following{/other_user}", "gists_url": "https://api.github.com/users/richtier/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/richtier", "id": 5485798, "login": "richtier", "node_id": "MDQ6VXNlcjU0ODU3OTg=", "organizations_url": "https://api.github.com/users/richtier/orgs", "received_events_url": "https://api.github.com/users/richtier/received_events", "repos_url": "https://api.github.com/users/richtier/repos", "site_admin": false, "starred_url": "https://api.github.com/users/richtier/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/richtier/subscriptions", "type": "User", "url": "https://api.github.com/users/richtier", "user_view_type": "public" }
{ "+1": 16, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 16, "url": "https://api.github.com/repos/psf/requests/issues/4437/reactions" }
https://api.github.com/repos/psf/requests/issues/4437/timeline
null
completed
null
null
false
[ "Hi @richtier thanks for opening this.\r\n\r\n> Is there a reason to not add bearer auth to the codebase?\r\n\r\nThe main reasons are the following:\r\n\r\n1. because Bearer authentication is so terribly simple that it can be implemented as above easily (or even more simply, really)\r\n2. because we're under a fairly strict feature-freeze and this would constitute a break of that freeze\r\n3. this can be easily shipped via the [requests-toolbelt](/requests/toolbelt) for people who don't want to implement this simply", "@sigmavirus24 good reasons :+1: ", "@sigmavirus24, yes, it is simple but will be used in many projects. In my experience - it is most popular auth method.\r\n1. But why I need to manually migrate that part of code from project to project and violate DRY principle?\r\n2. Can you add/plan it to the next feature-freeze?\r\n3. As I don't use (and currently don't plan to use) [requests-toolbelt](https://github.com/requests/toolbelt) - why I should install it, if all similar auth types are in requests?\r\n\r\nThanks in advance.\r\n", "> In my experience - it is most popular auth method.\r\n\r\nYour experience doesn't match mine. Anecdotal data is useless.\r\n\r\n> Can you add/plan it to the next feature-freeze?\r\n\r\nNo. This project is in perpetual feature-freeze. There is a high bar for new features, this does not even come close to it.\r\n\r\n> As I don't use (and currently don't plan to use) requests-toolbelt - why I should install it, if all similar auth types are in requests?\r\n\r\nThere are 2 auth-types natively supported by Requests:\r\n\r\n- HTTP Digest Authentication\r\n- HTTP Basic Authentication\r\n\r\nThere are a myriad of libraries for other authentication types (oauth, kerberos, ntlm, and so many more). The toolbelt, includes other auth mechanisms that are helpers for more basic concerns.", "Please reconsider this decision. \r\n\r\nIt's about having a consistent API and symmetric API. \r\n\r\nLike e.g. my thinking was:\r\n\r\n1. I need bearer auth\r\n2. let's look at requests.readthedocs.io. Ok understood: authentication looks like `requests.get(url, auth=<auth-type>(...))`\r\n3. search for Bearer on that page.\r\n4. Search again for Bearer on that page. \r\n5. Last resort: Google: https://www.google.com/search?q=python+requests+bearer\r\n6. tying to understand https://stackoverflow.com/questions/45868120/python-post-request-with-bearer-token?rq=1\r\n7. \"why is this so much more complicated????\"\r\n\r\nWhich means, by omitting bearer authentication, cause it is so simple, you in fact made bearer authentication much more complicated than other authentication schemes. Unfortunately.\r\n ", "> Which means, by omitting bearer authentication, cause it is so simple, you in fact made bearer authentication much more complicated than other authentication schemes.\r\n\r\nI guess that makes OAuth impossible? This logic makes no sense. BasicAuth and DigestAuth are the two most common auth types (or were over 10 years ago). Given that most of the auth handlers just update headers and you can do that yourself here, I don't understand why this is more complicated to you. The toolbelt exists for just such \"dead-simple and borderline popular\" options so that folks don't have to reimplement it themselves but no one has sent an implementation and I don't care enough to do it myself.\r\n\r\nAlso, the library is in feature-freeze. So new features are not accepted no matter how complicated you think this is or how common one person thinks this is. \r\n\r\nIf you want a library that will accept any old feature request without regard to the long-term quality of the software itself, it's maintainability, or the effect all of that has on the maintainer(s) still working on the project, maybe find a different HTTP client. There's tonnes at this point, some might even be of better quality.\r\n\r\nI no longer represent this project though, so take all of this for whatever little you already value my opinion (given that you have thumbs-downed my comments for explaining rationale and thought it was appropriate to revive an issue that's been closed and dormant for 2 years).", "> > Which means, by omitting bearer authentication, cause it is so simple, you in fact made bearer authentication much more complicated than other authentication schemes.\r\n> \r\n> I guess that makes OAuth impossible? This logic makes no sense. BasicAuth and DigestAuth are the two most common auth types (or were over 10 years ago). Given that most of the auth handlers just update headers and you can do that yourself here, I don't understand why this is more complicated to you.\r\n\r\nI'm not talking about the complexity of the authentication mechanism, but of the python API here. By that I think using OAuth is easier that Bearer for inexperienced users right now.\r\n\r\n> The toolbelt exists for just such \"dead-simple and borderline popular\" options so that folks don't have to reimplement it themselves but no one has sent an implementation and I don't care enough to do it myself.\r\n\r\nThank you for the hint!\r\n\r\n> \r\n> Also, the library is in feature-freeze. So new features are not accepted no matter how complicated you think this is or how common one person thinks this is.\r\n\r\nThat's indeed unfortunate. \r\n\r\n\r\n> If you want a library that will accept any old feature request without regard to the long-term quality of the software itself, it's maintainability, or the effect all of that has on the maintainer(s) still working on the project, maybe find a different HTTP client. There's tonnes at this point, some might even be of better quality.\r\n> \r\n> I no longer represent this project though, so take all of this for whatever little you already value my opinion\r\n\r\nWell. Obviously, my intention was not to offend you, but provide some input why I think Bearer should be reconsidered. \r\n\r\n> ... thought it was appropriate to revive an issue that's been closed and dormant for 2 years.\r\n\r\nI for one would not be offend by someone commenting on older issues. \r\n\r\n\r\n\r\n" ]
https://api.github.com/repos/psf/requests/issues/4436
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4436/labels{/name}
https://api.github.com/repos/psf/requests/issues/4436/comments
https://api.github.com/repos/psf/requests/issues/4436/events
https://github.com/psf/requests/issues/4436
283,844,573
MDU6SXNzdWUyODM4NDQ1NzM=
4,436
SSLError: HTTPSConnectionPool(host='www.recruit.com.hk', port=443): Max retries exceeded with url: /jobseeker/JobDetail.aspx?jobOrder=L04146652 (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
{ "avatar_url": "https://avatars.githubusercontent.com/u/8072787?v=4", "events_url": "https://api.github.com/users/cecilialee/events{/privacy}", "followers_url": "https://api.github.com/users/cecilialee/followers", "following_url": "https://api.github.com/users/cecilialee/following{/other_user}", "gists_url": "https://api.github.com/users/cecilialee/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/cecilialee", "id": 8072787, "login": "cecilialee", "node_id": "MDQ6VXNlcjgwNzI3ODc=", "organizations_url": "https://api.github.com/users/cecilialee/orgs", "received_events_url": "https://api.github.com/users/cecilialee/received_events", "repos_url": "https://api.github.com/users/cecilialee/repos", "site_admin": false, "starred_url": "https://api.github.com/users/cecilialee/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cecilialee/subscriptions", "type": "User", "url": "https://api.github.com/users/cecilialee", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-12-21T10:54:11Z
2021-09-08T05:00:40Z
2017-12-25T12:13:21Z
NONE
resolved
I'm making a very simple `get()` request but it throws the SSL error. The error message is very long and after searching around, I can't find anything that's helpful. Please help :( ## Expected Result No exception. ## Actual Result ``` SSLError: HTTPSConnectionPool(host='www.recruit.com.hk', port=443): Max retries exceeded with url: /jobseeker/JobDetail.aspx?jobOrder=L04146652 (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) ``` ## Reproduction Steps The link that I'm requesting is a turnstile. It will jump immediately to another link, which is `https://www.recruit.com.hk/jobseeker/JobDetail.aspx?jobOrder=L04146652`. ```python import requests requests.get('https://www.indeed.hk/rc/clk?jk=ab794b2879313f04&fccid=a659206a7e1afa15') ``` ``` Traceback (most recent call last): File "<input>", line 1, in <module> File "/Users/cecilialee/anaconda/envs/py2/lib/python2.7/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/Users/cecilialee/anaconda/envs/py2/lib/python2.7/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/Users/cecilialee/anaconda/envs/py2/lib/python2.7/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/Users/cecilialee/anaconda/envs/py2/lib/python2.7/site-packages/requests/sessions.py", line 640, in send history = [resp for resp in gen] if allow_redirects else [] File "/Users/cecilialee/anaconda/envs/py2/lib/python2.7/site-packages/requests/sessions.py", line 218, in resolve_redirects **adapter_kwargs File "/Users/cecilialee/anaconda/envs/py2/lib/python2.7/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/Users/cecilialee/anaconda/envs/py2/lib/python2.7/site-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) SSLError: HTTPSConnectionPool(host='www.recruit.com.hk', port=443): Max retries exceeded with url: /jobseeker/JobDetail.aspx?jobOrder=L04146652 (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) ``` ## System Information Python 2.7.14 $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "1.8.1" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "16.0.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "100020bf", "version": "17.0.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020cf" }, "urllib3": { "version": "1.22" }, "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/4436/reactions" }
https://api.github.com/repos/psf/requests/issues/4436/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." ]
https://api.github.com/repos/psf/requests/issues/4435
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4435/labels{/name}
https://api.github.com/repos/psf/requests/issues/4435/comments
https://api.github.com/repos/psf/requests/issues/4435/events
https://github.com/psf/requests/issues/4435
283,787,171
MDU6SXNzdWUyODM3ODcxNzE=
4,435
request blocked when i try to request an offline server
{ "avatar_url": "https://avatars.githubusercontent.com/u/10654221?v=4", "events_url": "https://api.github.com/users/ignite-404/events{/privacy}", "followers_url": "https://api.github.com/users/ignite-404/followers", "following_url": "https://api.github.com/users/ignite-404/following{/other_user}", "gists_url": "https://api.github.com/users/ignite-404/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ignite-404", "id": 10654221, "login": "ignite-404", "node_id": "MDQ6VXNlcjEwNjU0MjIx", "organizations_url": "https://api.github.com/users/ignite-404/orgs", "received_events_url": "https://api.github.com/users/ignite-404/received_events", "repos_url": "https://api.github.com/users/ignite-404/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ignite-404/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ignite-404/subscriptions", "type": "User", "url": "https://api.github.com/users/ignite-404", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-12-21T06:42:48Z
2021-09-08T05:00:40Z
2017-12-25T12:11:23Z
NONE
resolved
i wrote a program with requests to wake up my site. when i deploy my site,the server can't response. then i saw the requests blocked forever , can't continue next requst again. i have no log,just an appearance
{ "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": 3, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 3, "url": "https://api.github.com/repos/psf/requests/issues/4435/reactions" }
https://api.github.com/repos/psf/requests/issues/4435/timeline
null
completed
null
null
false
[ "Please provide us with the output of\r\n\r\n```\r\npython -m requests.help\r\n```\r\n\r\nIf that is unavailable on your version of Requests please provide some basic information about your system (Python version, operating system, etc)." ]
https://api.github.com/repos/psf/requests/issues/4434
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4434/labels{/name}
https://api.github.com/repos/psf/requests/issues/4434/comments
https://api.github.com/repos/psf/requests/issues/4434/events
https://github.com/psf/requests/issues/4434
283,584,461
MDU6SXNzdWUyODM1ODQ0NjE=
4,434
iOS issue 'No child processes'
{ "avatar_url": "https://avatars.githubusercontent.com/u/13103826?v=4", "events_url": "https://api.github.com/users/mucke5/events{/privacy}", "followers_url": "https://api.github.com/users/mucke5/followers", "following_url": "https://api.github.com/users/mucke5/following{/other_user}", "gists_url": "https://api.github.com/users/mucke5/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mucke5", "id": 13103826, "login": "mucke5", "node_id": "MDQ6VXNlcjEzMTAzODI2", "organizations_url": "https://api.github.com/users/mucke5/orgs", "received_events_url": "https://api.github.com/users/mucke5/received_events", "repos_url": "https://api.github.com/users/mucke5/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mucke5/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mucke5/subscriptions", "type": "User", "url": "https://api.github.com/users/mucke5", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2017-12-20T14:41:42Z
2021-09-08T04:00:43Z
2018-01-30T13:54:14Z
NONE
resolved
I am using Kodi and got the following error. Could you advise me how to solve the issue? System: iOS 9.3.3 | Kodi 17.6 (arm64) File "/var/mobile/Library/Preferences/Kodi/addons/script.module.requests/lib/requests/__init__.py", line 97, in <module> from . import utils File "/var/mobile/Library/Preferences/Kodi/addons/script.module.requests/lib/requests/utils.py", line 42, in <module> if platform.system() == 'Windows': File "/Users/Shared/jenkins/workspace/IOS-ARM64/tools/depends/xbmc-depends/iphoneos8.1_arm64-target/lib/python2.7/platform.py", line 1263, in system File "/Users/Shared/jenkins/workspace/IOS-ARM64/tools/depends/xbmc-depends/iphoneos8.1_arm64-target/lib/python2.7/platform.py", line 1230, in uname File "/Users/Shared/jenkins/workspace/IOS-ARM64/tools/depends/xbmc-depends/iphoneos8.1_arm64-target/lib/python2.7/platform.py", line 965, in _syscmd_uname IOError: (10, 'No child processes')
{ "avatar_url": "https://avatars.githubusercontent.com/u/13103826?v=4", "events_url": "https://api.github.com/users/mucke5/events{/privacy}", "followers_url": "https://api.github.com/users/mucke5/followers", "following_url": "https://api.github.com/users/mucke5/following{/other_user}", "gists_url": "https://api.github.com/users/mucke5/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mucke5", "id": 13103826, "login": "mucke5", "node_id": "MDQ6VXNlcjEzMTAzODI2", "organizations_url": "https://api.github.com/users/mucke5/orgs", "received_events_url": "https://api.github.com/users/mucke5/received_events", "repos_url": "https://api.github.com/users/mucke5/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mucke5/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mucke5/subscriptions", "type": "User", "url": "https://api.github.com/users/mucke5", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4434/reactions" }
https://api.github.com/repos/psf/requests/issues/4434/timeline
null
completed
null
null
false
[ "This is an odd error. At the moment we're not compatible with iOS and that was never really a target that we defined as wanting to be compatible with. It seems that Kodi doesn't allow python to spawn subprocesses in order to determine the system name. As such, when we try to make decisions based on the Operating System, we fail out. I don't think there's presently an ideal way of fixing this.", "I tried some approaches from here: https://www.bountysource.com/issues/51501895-kodi-17-5-ios-2-18-4-failing-for-youtube-addon\r\n\r\nI can open the broken Addon 'Backup' immediately after installing:\r\n1- Release v2.13.0\r\n2- Release v2.18.4 with replaced code [if platform.system() == 'Windows'] to [if 'win32' in sys.platform]\r\n\r\nRestart Kodi leads to a crash. Therefore I need to delete the folder [script.module.requests] manually to use Kodi again. So these are only temporary solutions.\r\n\r\nIs that a possible fix to make decisions based on the Operating System?\r\nhttps://github.com/analogue/mythbox/blob/master/resources/src/mythbox/platform.py#L31", "I believe we previously used `'win32' in sys.platform` and it led to unexpected and wildly undesirable side-effects which is why we switched to `platform.system()`. I would need to double-check, but again, since we can't test on Kodi we can't properly support it and it's highly likely this will just regress again.", "I finally changed `sys.platform == 'win32'` to `xbmc.getCondVisibility('sys.platform.windows')` in the current 'branch: master'.\r\n---\r\nhttps://trac.kodi.tv/ticket/12098\r\nhttp://kodi.wiki/view/List_of_boolean_conditions" ]
https://api.github.com/repos/psf/requests/issues/4433
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4433/labels{/name}
https://api.github.com/repos/psf/requests/issues/4433/comments
https://api.github.com/repos/psf/requests/issues/4433/events
https://github.com/psf/requests/issues/4433
283,152,291
MDU6SXNzdWUyODMxNTIyOTE=
4,433
How to use this library and Android for picture transmission
{ "avatar_url": "https://avatars.githubusercontent.com/u/17872637?v=4", "events_url": "https://api.github.com/users/alanMachineLeraning/events{/privacy}", "followers_url": "https://api.github.com/users/alanMachineLeraning/followers", "following_url": "https://api.github.com/users/alanMachineLeraning/following{/other_user}", "gists_url": "https://api.github.com/users/alanMachineLeraning/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alanMachineLeraning", "id": 17872637, "login": "alanMachineLeraning", "node_id": "MDQ6VXNlcjE3ODcyNjM3", "organizations_url": "https://api.github.com/users/alanMachineLeraning/orgs", "received_events_url": "https://api.github.com/users/alanMachineLeraning/received_events", "repos_url": "https://api.github.com/users/alanMachineLeraning/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alanMachineLeraning/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alanMachineLeraning/subscriptions", "type": "User", "url": "https://api.github.com/users/alanMachineLeraning", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2017-12-19T09:11:10Z
2021-09-08T05:00:42Z
2017-12-19T13:28:17Z
NONE
resolved
Summary. ## Expected Result What you expected. ## Actual Result What happened instead. ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ``` <paste here> ``` 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/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/4433/reactions" }
https://api.github.com/repos/psf/requests/issues/4433/timeline
null
completed
null
null
false
[ " What do you mean by 'picture transmission'?", "This is not a forum for questions and answers. The place to ask questions for technical help is [StackOverflow](https://stackoverflow.com). Please redirect your discussion there." ]
https://api.github.com/repos/psf/requests/issues/4432
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4432/labels{/name}
https://api.github.com/repos/psf/requests/issues/4432/comments
https://api.github.com/repos/psf/requests/issues/4432/events
https://github.com/psf/requests/issues/4432
282,964,791
MDU6SXNzdWUyODI5NjQ3OTE=
4,432
Just a question
{ "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
2
2017-12-18T17:45:53Z
2021-09-08T05:00:41Z
2017-12-19T13:28:23Z
NONE
resolved
How i can avoid url encoding into a post parameter? like: username=not encoded data&password=not encoded data&login=True i tried with: `config={'encode_uri': False}` but it doen't work anymore
{ "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/4432/reactions" }
https://api.github.com/repos/psf/requests/issues/4432/timeline
null
completed
null
null
false
[ "Why don't you want the parameter to be URL encoded? Every server should be able to decode this.", "This is not a forum for questions and answers. The place to ask questions for technical help is [StackOverflow](https://stackoverflow.com). Please redirect your discussion there." ]
https://api.github.com/repos/psf/requests/issues/4431
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4431/labels{/name}
https://api.github.com/repos/psf/requests/issues/4431/comments
https://api.github.com/repos/psf/requests/issues/4431/events
https://github.com/psf/requests/issues/4431
282,828,604
MDU6SXNzdWUyODI4Mjg2MDQ=
4,431
Requests shouldn't send IP Address as SNI.
{ "avatar_url": "https://avatars.githubusercontent.com/u/4143339?v=4", "events_url": "https://api.github.com/users/jicahoo/events{/privacy}", "followers_url": "https://api.github.com/users/jicahoo/followers", "following_url": "https://api.github.com/users/jicahoo/following{/other_user}", "gists_url": "https://api.github.com/users/jicahoo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jicahoo", "id": 4143339, "login": "jicahoo", "node_id": "MDQ6VXNlcjQxNDMzMzk=", "organizations_url": "https://api.github.com/users/jicahoo/orgs", "received_events_url": "https://api.github.com/users/jicahoo/received_events", "repos_url": "https://api.github.com/users/jicahoo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jicahoo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jicahoo/subscriptions", "type": "User", "url": "https://api.github.com/users/jicahoo", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-12-18T10:22:25Z
2021-09-08T05:00:41Z
2017-12-20T07:05:59Z
NONE
resolved
Summary. According to RFC 6066, https://tools.ietf.org/html/rfc6066#section-3, ` Literal IPv4 and IPv6 addresses are not permitted in "HostName".` However, when I send requests like resp = s.get('https://192.168.1.140', verify=False), requests will put 192.168.1.140 in SNI. ## Expected Result Not send SNI when URL are based on literal IP address. ## Actual Result In wireshark, I saw the IP address was put in SNI. ## Reproduction Steps 1. Prepare a HTTPS server at port 4443. 2. Use tcpdump `sudo tcpdump -X -S -s 0 -i lo -w wireshark.log` to capture the packets. 4. Use below script ```python import requests s = requests.Session() resp = s.get('https://127.0.0.1:4443', verify=False) ``` 5. Load wireshare.log to wireshark. You will see the SNI is in SSL request. Please let me know if need more info. Thanks
{ "avatar_url": "https://avatars.githubusercontent.com/u/4143339?v=4", "events_url": "https://api.github.com/users/jicahoo/events{/privacy}", "followers_url": "https://api.github.com/users/jicahoo/followers", "following_url": "https://api.github.com/users/jicahoo/following{/other_user}", "gists_url": "https://api.github.com/users/jicahoo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jicahoo", "id": 4143339, "login": "jicahoo", "node_id": "MDQ6VXNlcjQxNDMzMzk=", "organizations_url": "https://api.github.com/users/jicahoo/orgs", "received_events_url": "https://api.github.com/users/jicahoo/received_events", "repos_url": "https://api.github.com/users/jicahoo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jicahoo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jicahoo/subscriptions", "type": "User", "url": "https://api.github.com/users/jicahoo", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4431/reactions" }
https://api.github.com/repos/psf/requests/issues/4431/timeline
null
completed
null
null
false
[ "I am trying to build a test https server following the guide in https://anvileight.uk/blog/2016/03/20/simple-http-server-with-python/. For now, I haven't succeeded. ", "You can try to run below Python script and capture network packets using tcpdump.\r\nThe IP Address 140.211.11.105 is got from apache.org. I am not sure if it will work for you.\r\n```\r\nC:\\windows\\system32>ping apache.org\r\n\r\nPinging apache.org [140.211.11.105] with 32 bytes of data:\r\n...\r\n\r\n```\r\n\r\n```python\r\nimport requests\r\ns = requests.Session()\r\nurl = 'https://140.211.11.105'\r\nresp = s.get(url, verify=False)\r\nprint(resp.url)\r\nprint(resp.request.url)\r\nprint(resp.content)\r\n````\r\n\r\nThen I got below result in wireshark:\r\n![sni_ip_address](https://user-images.githubusercontent.com/4143339/34105809-bdd5222e-e430-11e7-9aa7-77d61df768c6.png)\r\n", "Closed it. It should be a urllib3 bug. https://github.com/shazow/urllib3/issues/1298" ]
https://api.github.com/repos/psf/requests/issues/4430
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4430/labels{/name}
https://api.github.com/repos/psf/requests/issues/4430/comments
https://api.github.com/repos/psf/requests/issues/4430/events
https://github.com/psf/requests/issues/4430
282,547,293
MDU6SXNzdWUyODI1NDcyOTM=
4,430
Cookies lost during multiple redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/885164?v=4", "events_url": "https://api.github.com/users/batzel/events{/privacy}", "followers_url": "https://api.github.com/users/batzel/followers", "following_url": "https://api.github.com/users/batzel/following{/other_user}", "gists_url": "https://api.github.com/users/batzel/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/batzel", "id": 885164, "login": "batzel", "node_id": "MDQ6VXNlcjg4NTE2NA==", "organizations_url": "https://api.github.com/users/batzel/orgs", "received_events_url": "https://api.github.com/users/batzel/received_events", "repos_url": "https://api.github.com/users/batzel/repos", "site_admin": false, "starred_url": "https://api.github.com/users/batzel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/batzel/subscriptions", "type": "User", "url": "https://api.github.com/users/batzel", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-12-15T21:04:02Z
2021-09-08T05:00:42Z
2017-12-16T07:45:20Z
NONE
resolved
Cookies are lost when set by sites returning redirects. Example: r=requests.get('http://hostA/url1') where url gives multiple redirects, possibly multiple sites. e.g. hostA/url1 -> 302 -> hostB/url2 -> 302 -> HostC/url3 Expectation: r.cookies would have all the cookies set by hostA, hostB, and hostC Actual Result: r.cookies contains only the cookies set by the hostC. The others are lost. Further example from real-world scenario: $ python3 Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> r=requests.get('redactedurl') >>> r.history [<Response [302]>, <Response [302]>, <Response [302]>, <Response [302]>] >>> len(r.cookies) 1 >>> ----- >>> r=requests.get('redactedurl', allow_redirects=False) >>> r.cookies <RequestsCookieJar[]> >>> c=r.cookies >>> r.status_code 302 >>> r=requests.get(r.headers.get('location'), allow_redirects=False, cookies=c) >>> r.status_code 302 >>> c.update(r.cookies) >>> r=requests.get(r.headers.get('location'), allow_redirects=False, cookies=c) ... >>> r.status_code 200 >>> c.update(r.cookies) >>> len(c) 3 ## System Information ``` $ python3 -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.1.4" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.1" }, "platform": { "release": "17.3.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "1010007f", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4430/reactions" }
https://api.github.com/repos/psf/requests/issues/4430/timeline
null
completed
null
null
false
[ "`r.cookies` contains only the cookies set by the most recent response. Use a `Session` and collect the cookies from `Session.cookies`." ]
https://api.github.com/repos/psf/requests/issues/4429
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4429/labels{/name}
https://api.github.com/repos/psf/requests/issues/4429/comments
https://api.github.com/repos/psf/requests/issues/4429/events
https://github.com/psf/requests/issues/4429
282,290,005
MDU6SXNzdWUyODIyOTAwMDU=
4,429
What's the meaning of the homepage image?
{ "avatar_url": "https://avatars.githubusercontent.com/u/16239566?v=4", "events_url": "https://api.github.com/users/lightning-zgc/events{/privacy}", "followers_url": "https://api.github.com/users/lightning-zgc/followers", "following_url": "https://api.github.com/users/lightning-zgc/following{/other_user}", "gists_url": "https://api.github.com/users/lightning-zgc/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lightning-zgc", "id": 16239566, "login": "lightning-zgc", "node_id": "MDQ6VXNlcjE2MjM5NTY2", "organizations_url": "https://api.github.com/users/lightning-zgc/orgs", "received_events_url": "https://api.github.com/users/lightning-zgc/received_events", "repos_url": "https://api.github.com/users/lightning-zgc/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lightning-zgc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lightning-zgc/subscriptions", "type": "User", "url": "https://api.github.com/users/lightning-zgc", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2017-12-15T01:11:02Z
2021-09-08T05:00:37Z
2018-01-07T21:33:08Z
NONE
resolved
What's the meaning of this: ![68747470733a2f2f6661726d352e737461746963666c69636b722e636f6d2f343331372f33353139383338363337345f313933396166336465365f6b5f642e6a7067](https://user-images.githubusercontent.com/16239566/34022048-f8ea84be-e177-11e7-863b-c8ee5f79fab4.jpeg)
{ "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/4429/reactions" }
https://api.github.com/repos/psf/requests/issues/4429/timeline
null
completed
null
null
false
[ "A butterfly at the waterline?", "Hey @lightning-zgc, the photos you see throughout the Requests docs are taken by Kenneth Reitz. You'll find things like this in most of the documentation for projects he started, and it's mostly there for aesthetic purposes. Hopefully that helps answer your question!\r\n\r\nFor future reference, we prefer to keep the issue tracker limited to tickets around defects in Requests. Email or social media may be a better avenue for questions like these." ]
https://api.github.com/repos/psf/requests/issues/4428
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4428/labels{/name}
https://api.github.com/repos/psf/requests/issues/4428/comments
https://api.github.com/repos/psf/requests/issues/4428/events
https://github.com/psf/requests/pull/4428
281,610,897
MDExOlB1bGxSZXF1ZXN0MTU3OTkzNjk4
4,428
Reuse session SSLContexts for same TLS settings
{ "avatar_url": "https://avatars.githubusercontent.com/u/34075110?v=4", "events_url": "https://api.github.com/users/jmcackles/events{/privacy}", "followers_url": "https://api.github.com/users/jmcackles/followers", "following_url": "https://api.github.com/users/jmcackles/following{/other_user}", "gists_url": "https://api.github.com/users/jmcackles/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jmcackles", "id": 34075110, "login": "jmcackles", "node_id": "MDQ6VXNlcjM0MDc1MTEw", "organizations_url": "https://api.github.com/users/jmcackles/orgs", "received_events_url": "https://api.github.com/users/jmcackles/received_events", "repos_url": "https://api.github.com/users/jmcackles/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jmcackles/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmcackles/subscriptions", "type": "User", "url": "https://api.github.com/users/jmcackles", "user_view_type": "public" }
[]
closed
false
null
[]
{ "closed_at": null, "closed_issues": 29, "created_at": "2024-05-19T18:29:04Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/34", "id": 11073254, "labels_url": "https://api.github.com/repos/psf/requests/milestones/34/labels", "node_id": "MI_kwDOABTKOs4AqPbm", "number": 34, "open_issues": 0, "state": "open", "title": "Bankruptcy", "updated_at": "2024-05-20T14:37:16Z", "url": "https://api.github.com/repos/psf/requests/milestones/34" }
4
2017-12-13T03:09:31Z
2024-05-20T14:35:40Z
2024-05-20T14:35:40Z
NONE
null
Creates SSLContext objects in HTTPAdapter and uses a single SSLContext for connections with the same TLS settings (ca_cert_dir, ca_certs, cert_file, and key_file). This is another try for https://github.com/requests/requests/issues/4322
{ "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/4428/reactions" }
https://api.github.com/repos/psf/requests/issues/4428/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4428.diff", "html_url": "https://github.com/psf/requests/pull/4428", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4428.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4428" }
true
[ "My best guess is that the failure is related to https://bugs.python.org/issue9949, but I'm really not sure. The test is failing because using a relative path and absolute path to the same cert file creates 2 different SSLContexts in the windows tests. I'm not sure if this is an important case, but I had added a test for it.", "# [Codecov](https://codecov.io/gh/requests/requests/pull/4428?src=pr&el=h1) Report\n> Merging [#4428](https://codecov.io/gh/requests/requests/pull/4428?src=pr&el=desc) into [proposed/3.0.0](https://codecov.io/gh/requests/requests/commit/78bf3ee6e662d724df106e76a79e5902a96b1528?src=pr&el=desc) will **increase** coverage by `1.51%`.\n> The diff coverage is `100%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4428/graphs/tree.svg?width=650&height=150&src=pr&token=mZGswIiXLa)](https://codecov.io/gh/requests/requests/pull/4428?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## proposed/3.0.0 #4428 +/- ##\n==================================================\n+ Coverage 89.06% 90.57% +1.51% \n==================================================\n Files 18 15 -3 \n Lines 2057 1570 -487 \n==================================================\n- Hits 1832 1422 -410 \n+ Misses 225 148 -77\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4428?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4428/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `93.69% <100%> (+0.42%)` | :arrow_up: |\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4428/diff?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | | |\n| [tests/testserver/\\_\\_init\\_\\_.py](https://codecov.io/gh/requests/requests/pull/4428/diff?src=pr&el=tree#diff-dGVzdHMvdGVzdHNlcnZlci9fX2luaXRfXy5weQ==) | | |\n| [requests/compat.py](https://codecov.io/gh/requests/requests/pull/4428/diff?src=pr&el=tree#diff-cmVxdWVzdHMvY29tcGF0LnB5) | | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4428?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4428?src=pr&el=footer). Last update [78bf3ee...90e5239](https://codecov.io/gh/requests/requests/pull/4428?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "I was able to look on Windows and it was clearer, the test was failing because of letter case issues, which is fixed now, I'm sorry about that. I think symlinks are still an issue for Windows, but I haven't added another test case or anything to fix it. ", "In an effort to clean up the issue tracker to only have issues that are still relevant to the project we've done a quick pass and decided this issue may no longer be relevant for a variety of potential reasons, including:\r\n\r\n* Applies to a much older version, unclear whether the issue still applies.\r\n* Change requires a backwards incompatible release and it's unclear if the benefits are worth the migration effort from the community.\r\n* There isn't a clear demand from the community on the change landing in Requests.\r\n\r\nIf you think the issue should remain open, please comment so below or open a new issue and link back to the original issue. Again, thank you for opening the issue and for the discussion, it's much appreciated." ]
https://api.github.com/repos/psf/requests/issues/4427
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4427/labels{/name}
https://api.github.com/repos/psf/requests/issues/4427/comments
https://api.github.com/repos/psf/requests/issues/4427/events
https://github.com/psf/requests/pull/4427
281,417,905
MDExOlB1bGxSZXF1ZXN0MTU3ODUyNzUx
4,427
Use hostname not netloc
{ "avatar_url": "https://avatars.githubusercontent.com/u/839885?v=4", "events_url": "https://api.github.com/users/ddormer/events{/privacy}", "followers_url": "https://api.github.com/users/ddormer/followers", "following_url": "https://api.github.com/users/ddormer/following{/other_user}", "gists_url": "https://api.github.com/users/ddormer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ddormer", "id": 839885, "login": "ddormer", "node_id": "MDQ6VXNlcjgzOTg4NQ==", "organizations_url": "https://api.github.com/users/ddormer/orgs", "received_events_url": "https://api.github.com/users/ddormer/received_events", "repos_url": "https://api.github.com/users/ddormer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ddormer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ddormer/subscriptions", "type": "User", "url": "https://api.github.com/users/ddormer", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2017-12-12T15:08:10Z
2021-09-04T00:06:33Z
2018-01-16T14:07:27Z
CONTRIBUTOR
resolved
Fixes #4275 and fixes #4158 by passing only the hostname/IP to urllib's `proxy_bypass` function which was timing out further down in `socket.gethostbyname` when passed a hostname or IP that contained authentication credentials. While fixing the parameter passed to `proxy_bypass`, I also took the chance to replace other uses of `netloc` with `hostname` in the `should_bypass_function`.
{ "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/4427/reactions" }
https://api.github.com/repos/psf/requests/issues/4427/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4427.diff", "html_url": "https://github.com/psf/requests/pull/4427", "merged_at": "2018-01-16T14:07:26Z", "patch_url": "https://github.com/psf/requests/pull/4427.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4427" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4427?src=pr&el=h1) Report\n> Merging [#4427](https://codecov.io/gh/requests/requests/pull/4427?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/020f96577f8f44d06acc1ab699a7638653d91bd0?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4427/graphs/tree.svg?src=pr&width=650&token=mZGswIiXLa&height=150)](https://codecov.io/gh/requests/requests/pull/4427?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4427 +/- ##\n=======================================\n Coverage 90.14% 90.14% \n=======================================\n Files 15 15 \n Lines 1543 1543 \n=======================================\n Hits 1391 1391 \n Misses 152 152\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4427?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4427?src=pr&el=footer). Last update [020f965...2255c34](https://codecov.io/gh/requests/requests/pull/4427?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@nateprewitt Thanks for the review! Below I've listed the changes I made before I squashed my commits.\r\n\r\n- Check if the port exists before adding it to prevent `host:None`.\r\n- Use `{0}` to support Python 2.6.\r\n- Updated the HISTORY.rst.", "@ddormer Can you rebase this so it's up-to-date with master? ", "@sigmavirus24 Thanks for reviewing this, I've rebased so it's up to date with master." ]
https://api.github.com/repos/psf/requests/issues/4426
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4426/labels{/name}
https://api.github.com/repos/psf/requests/issues/4426/comments
https://api.github.com/repos/psf/requests/issues/4426/events
https://github.com/psf/requests/issues/4426
281,267,677
MDU6SXNzdWUyODEyNjc2Nzc=
4,426
Making a post to a server on localhost is slow
{ "avatar_url": "https://avatars.githubusercontent.com/u/191903?v=4", "events_url": "https://api.github.com/users/JesseAldridge/events{/privacy}", "followers_url": "https://api.github.com/users/JesseAldridge/followers", "following_url": "https://api.github.com/users/JesseAldridge/following{/other_user}", "gists_url": "https://api.github.com/users/JesseAldridge/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JesseAldridge", "id": 191903, "login": "JesseAldridge", "node_id": "MDQ6VXNlcjE5MTkwMw==", "organizations_url": "https://api.github.com/users/JesseAldridge/orgs", "received_events_url": "https://api.github.com/users/JesseAldridge/received_events", "repos_url": "https://api.github.com/users/JesseAldridge/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JesseAldridge/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JesseAldridge/subscriptions", "type": "User", "url": "https://api.github.com/users/JesseAldridge", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2017-12-12T06:01:20Z
2021-09-08T05:00:41Z
2017-12-12T06:11:09Z
NONE
resolved
Question posted here: https://stackoverflow.com/questions/47766158/why-is-python-requests-to-localhost-slow Basically I have a trival server running locally. When I use requests to do a post to it it takes a few seconds to respond. ## Expected Result A sub-second response ## Actual Result A pause of a few seconds before a response ## Reproduction Steps See code shared on https://stackoverflow.com/questions/47766158/why-is-python-requests-to-localhost-slow ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "1.8.1" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.10" }, "platform": { "release": "17.2.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "1010005f", "version": "17.0.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "20000000" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/191903?v=4", "events_url": "https://api.github.com/users/JesseAldridge/events{/privacy}", "followers_url": "https://api.github.com/users/JesseAldridge/followers", "following_url": "https://api.github.com/users/JesseAldridge/following{/other_user}", "gists_url": "https://api.github.com/users/JesseAldridge/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JesseAldridge", "id": 191903, "login": "JesseAldridge", "node_id": "MDQ6VXNlcjE5MTkwMw==", "organizations_url": "https://api.github.com/users/JesseAldridge/orgs", "received_events_url": "https://api.github.com/users/JesseAldridge/received_events", "repos_url": "https://api.github.com/users/JesseAldridge/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JesseAldridge/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JesseAldridge/subscriptions", "type": "User", "url": "https://api.github.com/users/JesseAldridge", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4426/reactions" }
https://api.github.com/repos/psf/requests/issues/4426/timeline
null
completed
null
null
false
[ "Ah nevermind. Issue resolved instantly. Got to love Stackoverflow.", "I want to know why this happens.\r\nCan anyone help?\r\n\r\nI was able to make a **100x** speedup changing `\"localhost\"` to `\"127.0.0.1\"`.", "@cprogrammer1994 we use DNS in the case when we're not given an IP Address. localhost is plenty fast for me, but my `/etc/hosts` isn't a disaster as was described in the StackOverflow comment above. I suggest you read that question and perhaps fix up your developer environment.", "@sigmavirus24 thanks for the fast reply! My hosts file contains a single row (I am on windows). Unfortunately I have a lot of virtual network interfaces that could cause the problem.\r\n\r\n- Running `ptime nslookup localhost` takes `0.05` to `0.15` seconds\r\n- It takes exactly 1 second to run a `request.get(...)` using `\"localhost\"`", "It is clearly not a `requests` bug!\r\n\r\nThe following snippet is slow too:\r\n\r\n```py\r\nimport urllib.request\r\nurllib.request.urlopen('http://localhost:80').read()\r\n```" ]
https://api.github.com/repos/psf/requests/issues/4425
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4425/labels{/name}
https://api.github.com/repos/psf/requests/issues/4425/comments
https://api.github.com/repos/psf/requests/issues/4425/events
https://github.com/psf/requests/issues/4425
281,148,349
MDU6SXNzdWUyODExNDgzNDk=
4,425
Address deleting cookies when domain-less defaults are used.
{ "avatar_url": "https://avatars.githubusercontent.com/u/204779?v=4", "events_url": "https://api.github.com/users/jvanasco/events{/privacy}", "followers_url": "https://api.github.com/users/jvanasco/followers", "following_url": "https://api.github.com/users/jvanasco/following{/other_user}", "gists_url": "https://api.github.com/users/jvanasco/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jvanasco", "id": 204779, "login": "jvanasco", "node_id": "MDQ6VXNlcjIwNDc3OQ==", "organizations_url": "https://api.github.com/users/jvanasco/orgs", "received_events_url": "https://api.github.com/users/jvanasco/received_events", "repos_url": "https://api.github.com/users/jvanasco/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jvanasco/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jvanasco/subscriptions", "type": "User", "url": "https://api.github.com/users/jvanasco", "user_view_type": "public" }
[]
open
false
null
[]
null
4
2017-12-11T20:00:10Z
2017-12-12T23:00:17Z
null
CONTRIBUTOR
null
I found a few variations of this "implementation detail" in other reports, but I believe this particular use case is worth addressing. If a URL is retrieved with either a dict or unqualified cookie jar, the deletions are ignored. # use a dict resp = requests.get(url, cookies={'cookie1': 'value'},) or # use a cookiejar session1 = requests.Session() session1.cookies = requests.cookies.RequestsCookieJar() session1.cookies.set('foo', 'bar') resp1 = requests.get(url) This can create endless redirect loops if the server's response to a resource/url combination is to set a "delete cookie", which requests can not handle. Aside from failing tests and puzzled developers, this can trigger abuse flags with 3rd party api services. ## Expected Result If the server sends a cookie deletion value, it should be respected and not sent to the server. ## Actual Result passing a 'cookies=" dict to `requests.get()` creates a wrapped session with the default cookiejar. the current implementation just deletes any matching cookie for the domain, which fails because the cookie was set as a default (not for that domain). ## Potential Way To Fix A potential fix is to extend the RequestsCookieJar to use a blacklist when domain-less defaults are provided. When a SetCookie deletion is encountered and the cookiejar contains domain-less cookies: * delete the domain cookie (if it exists) * and populate the blacklist. When a request is made, filter the defaults against active blacklist values. When a SetCookie update is made, remove it from the blacklist (or update the blacklist's to note it as invalid until the cookie's expiry date) ## Reproduction Steps ```python import requests # cookies not unset session1 = requests.Session() session1.cookies = requests.cookies.RequestsCookieJar() session1.cookies.set('foo', 'bar') r_set = session1.get("http://httpbin.org/cookies/set?bar=foo") print(r_set.json()) r_del = session1.get("http://httpbin.org/cookies/delete?foo=bar") print(r_del.json()) r_check = session1.get("http://httpbin.org/cookies") print(r_check.json()) # cookies unset because domain matches session2 = requests.Session() session2.cookies = requests.cookies.RequestsCookieJar() session2.cookies.set('foo', 'bar', domain='httpbin.org', path='/') rr_set = session2.get("http://httpbin.org/cookies/set?bar=foo") print(rr_set.json()) rr_del = session2.get("http://httpbin.org/cookies/delete?foo=bar") print(rr_del.json()) rr_check = session2.get("http://httpbin.org/cookies") print(rr_check.json()) ``` ## System Information "version": "2.18.4"
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/4425/reactions" }
https://api.github.com/repos/psf/requests/issues/4425/timeline
null
null
null
null
false
[ "Thanks for this @jvanasco \r\n\r\nI had started hacking on a branch that would make the domain and path required with our cookie jar and probably provide a better interface to all of this in general. Sadly, I think that got lost in the suffle and I'd forgotten it. The API design change needs to be made for v3.0 to make this more tenable.", "Making the domain and path required would be much easier than the blacklist idea I was stubbing out (nowhere near a PR, just some tests on the general logic working before I posted here).\r\n\r\nIf that is required, IMHO, it would make sense to deprecate the 'cookies' argument to `requests.get()` (lose the docs, print a warning) and change the docs around cookiejars and `Session()`to note the impending change. \r\n\r\nOur unit tests just tossed a dict of cookies into `requests.get()`, because that's what the docs did. It took an embarrassing amount of time to realize I had successfully fixed an edge case we added a test for, and the problem was in the test/requests. Then it took looking at the code and a history of tickets to realize that was a bad idea and requests didn't do all the wonderfully brilliant things I expected it to (because it does all those wonderfully brilliant things everywhere else).", "@jvanasco I completely agree our behaviour is far from wonderfully brilliant like the rest of the project. That said, I think there's a difference between the following:\r\n\r\n```\r\nrequests.request(METHOD, url, cookies=key_value_pair_cookies)\r\n```\r\n\r\nAnd\r\n\r\n```\r\nsession.cookies.set(key, value)\r\n```\r\n\r\nThe first is a convenience that I think we can *reasonably* keep around. Underneath the functional API is a Session. If we have the session treat that dictionary as calling `.set(key, value, domain=parsed_domain, path=parsed_path)` we can probably then simplify our handling of cookies and the cookie-jar will respect deletions. I think that's a potentially far better solution than deprecating it altogether.\r\n\r\nThe second is just *wrong*. ;)", "You are correct - parsing the cookie domain/path out of the submitted url would be a much better idea than trashing it, but you'll still end up with issues over the potential of a leading dot in the domain (and ugh, the path, but let's not go there yet). This can be infuriating to debug if a problem pops up from it.\r\n\r\nFor example, consider making a request to `example.com` with a `foo` cookie:\r\n\r\n requests.get('http://example.com/path/to/url', cookies={'foo': 'bar'})\r\n\r\nlet's also assume the path is just set for the root `/` (because it gets even more complicated otherwise)\r\n\r\nThe server might be configured to send the SetCookie header for `foo` with any of three options for the domain:\r\n\r\n* domain = None\r\n* domain = 'example.com'\r\n* domain = '.example.com'\r\n\r\nThe RFCs and browser behavior on all this were switching around for a few years too on what no domain should imply, or the behavior of the leading dot. While everything is settled right now, there are still a lot of legacy clients/servers out there, and the current requests codebase doesn't seem to standardize on anything.\r\n\r\nSo it could be represented by two ways of setting cookies in the jar. \r\n\r\n jar.set('foo', 'bar', domain='example.com')\r\n jar.set('foo', 'bar', domain='.example.com')\r\n\r\nIf the server sends an update/clearout for the cookie value, it's possible that requests will have guessed wrong. While `requests` sends some data to the underlying `cookielib` functionality from the standard library over the initial dot or domain being set, these are treated as unique cookies and must be deleted/updated independently.\r\n\r\nWe just updated/unified all our python and js cookie libraries. I had the \"pleasure\" of reconciling a bunch of issues around how differently libraries & browsers were handling the leading domain dot differently. (sidenote: My lazy solution on the server side was to migrate everything to specifying the domain with a leading dot, but also killing cookies with both leading dot and not. i hate cookies now. )\r\n" ]
https://api.github.com/repos/psf/requests/issues/4424
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4424/labels{/name}
https://api.github.com/repos/psf/requests/issues/4424/comments
https://api.github.com/repos/psf/requests/issues/4424/events
https://github.com/psf/requests/pull/4424
281,066,500
MDExOlB1bGxSZXF1ZXN0MTU3NTk5NDQx
4,424
Fix: Removed incorrect plural of 'status'
{ "avatar_url": "https://avatars.githubusercontent.com/u/8420509?v=4", "events_url": "https://api.github.com/users/SHSauler/events{/privacy}", "followers_url": "https://api.github.com/users/SHSauler/followers", "following_url": "https://api.github.com/users/SHSauler/following{/other_user}", "gists_url": "https://api.github.com/users/SHSauler/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SHSauler", "id": 8420509, "login": "SHSauler", "node_id": "MDQ6VXNlcjg0MjA1MDk=", "organizations_url": "https://api.github.com/users/SHSauler/orgs", "received_events_url": "https://api.github.com/users/SHSauler/received_events", "repos_url": "https://api.github.com/users/SHSauler/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SHSauler/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SHSauler/subscriptions", "type": "User", "url": "https://api.github.com/users/SHSauler", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2017-12-11T15:51:45Z
2021-09-04T00:06:36Z
2017-12-12T13:03:17Z
NONE
resolved
The plural of `status` is `statuses` or `statūs`. Please disregard if it's here for a particular reason. https://en.wiktionary.org/wiki/status#English https://en.wiktionary.org/wiki/status#Etymology_2_2
{ "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/4424/reactions" }
https://api.github.com/repos/psf/requests/issues/4424/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4424.diff", "html_url": "https://github.com/psf/requests/pull/4424", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4424.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4424" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4424?src=pr&el=h1) Report\n> Merging [#4424](https://codecov.io/gh/requests/requests/pull/4424?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/24092b11d74af0a766d9cc616622f38adb0044b9?src=pr&el=desc) will **increase** coverage by `1.07%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4424/graphs/tree.svg?width=650&src=pr&token=mZGswIiXLa&height=150)](https://codecov.io/gh/requests/requests/pull/4424?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4424 +/- ##\n==========================================\n+ Coverage 89% 90.08% +1.07% \n==========================================\n Files 18 15 -3 \n Lines 2065 1543 -522 \n==========================================\n- Hits 1838 1390 -448 \n+ Misses 227 153 -74\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4424?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/status\\_codes.py](https://codecov.io/gh/requests/requests/pull/4424/diff?src=pr&el=tree#diff-cmVxdWVzdHMvc3RhdHVzX2NvZGVzLnB5) | `100% <ø> (ø)` | :arrow_up: |\n| [requests/compat.py](https://codecov.io/gh/requests/requests/pull/4424/diff?src=pr&el=tree#diff-cmVxdWVzdHMvY29tcGF0LnB5) | | |\n| [tests/testserver/\\_\\_init\\_\\_.py](https://codecov.io/gh/requests/requests/pull/4424/diff?src=pr&el=tree#diff-dGVzdHMvdGVzdHNlcnZlci9fX2luaXRfXy5weQ==) | | |\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4424/diff?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4424?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4424?src=pr&el=footer). Last update [24092b1...07bfaf8](https://codecov.io/gh/requests/requests/pull/4424?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Doesn't this break backwards compatibility? I'm doubtful someone uses those values though.", "Hi there @SHSauler! Thanks for sending your first pull request to Requests. We really appreciate your contribution. In this case, I don't think we can actually accept this pull request. In this case, there are a few reasons why:\r\n\r\n1. As @SethMichaelLarson mentioned, it breaks backwards compatibility. There may not be many people using it, but our API is stable and frozen which makes this a hard change to accept.\r\n\r\n2. These aliases pre-date me, but I believe that they're actually in use in the wider internet (which is probably why they were added in the first place)\r\n\r\n3. I think there are other places where we use \"stati\" and \"statuses\" interchangeably so it's not unusual for this.\r\n\r\n4. The internet is a weird place. There's a header spelt \"Referer\" (instead of \"Referrer\") which is standard and so misspellings can be both common and de facto (or de jure) standards.\r\n\r\nAll that aside, the you're entirely correct about the proper pluralization of status. Sadly, fixing it here is not probably. We *could* probably fix this for v3.0 though. There's already a branch where we're hacking on changes for that version so if you want to resubmit this there, we can definitely dig more into reasons 2, 3, and 4 and decide if they block that change there.\r\n\r\nThanks again 🎉 ", "Thank you for your time to review this. I completely understand your reasoning." ]
https://api.github.com/repos/psf/requests/issues/4423
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4423/labels{/name}
https://api.github.com/repos/psf/requests/issues/4423/comments
https://api.github.com/repos/psf/requests/issues/4423/events
https://github.com/psf/requests/issues/4423
280,873,561
MDU6SXNzdWUyODA4NzM1NjE=
4,423
urllib3 Which file is in it ThankYou
{ "avatar_url": "https://avatars.githubusercontent.com/u/21980348?v=4", "events_url": "https://api.github.com/users/apple-han/events{/privacy}", "followers_url": "https://api.github.com/users/apple-han/followers", "following_url": "https://api.github.com/users/apple-han/following{/other_user}", "gists_url": "https://api.github.com/users/apple-han/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/apple-han", "id": 21980348, "login": "apple-han", "node_id": "MDQ6VXNlcjIxOTgwMzQ4", "organizations_url": "https://api.github.com/users/apple-han/orgs", "received_events_url": "https://api.github.com/users/apple-han/received_events", "repos_url": "https://api.github.com/users/apple-han/repos", "site_admin": false, "starred_url": "https://api.github.com/users/apple-han/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/apple-han/subscriptions", "type": "User", "url": "https://api.github.com/users/apple-han", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2017-12-11T02:12:02Z
2021-09-08T05:00:44Z
2017-12-11T13:09:43Z
NONE
resolved
Summary. ## Expected Result What you expected. ## Actual Result What happened instead. ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ``` <paste here> ``` 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/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/4423/reactions" }
https://api.github.com/repos/psf/requests/issues/4423/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/4422
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4422/labels{/name}
https://api.github.com/repos/psf/requests/issues/4422/comments
https://api.github.com/repos/psf/requests/issues/4422/events
https://github.com/psf/requests/issues/4422
280,870,542
MDU6SXNzdWUyODA4NzA1NDI=
4,422
python requests post to url query parameter requires special character
{ "avatar_url": "https://avatars.githubusercontent.com/u/4407747?v=4", "events_url": "https://api.github.com/users/methodmenon/events{/privacy}", "followers_url": "https://api.github.com/users/methodmenon/followers", "following_url": "https://api.github.com/users/methodmenon/following{/other_user}", "gists_url": "https://api.github.com/users/methodmenon/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/methodmenon", "id": 4407747, "login": "methodmenon", "node_id": "MDQ6VXNlcjQ0MDc3NDc=", "organizations_url": "https://api.github.com/users/methodmenon/orgs", "received_events_url": "https://api.github.com/users/methodmenon/received_events", "repos_url": "https://api.github.com/users/methodmenon/repos", "site_admin": false, "starred_url": "https://api.github.com/users/methodmenon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/methodmenon/subscriptions", "type": "User", "url": "https://api.github.com/users/methodmenon", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-12-11T01:47:38Z
2021-09-08T05:00:43Z
2017-12-11T13:14:08Z
NONE
resolved
Summary. I am using python requests to submit a post request to a specific url. This url has a query parameter that contains the actual filepath of the file I am uplaoding, with the actual colon (':') and backslashes('\') (it will not accept %3A, or %5C). I have no idea what to do. Here is my code: ``` with requests.Session() as s: payload_10_vo_params = { 'hidInputControlValues': this_hidInputControlValues10, 'hidFormNames': this_hidFormNames10, 'hidToken': this_hidToken10, 'hidFileNm': r"C:\fakepath\{}".format(this_FileName), 'hidFileSourceId': '', 'ReUploadInd': '' } payload10_mpe_vo = MultipartEncoder( [ ('hidLoanTranSaveFlag', 'TRUE'), ('hidUpfrontMIPct', ''), ('radLeadRequestOptBtnImportRetNum', 'LUPL'), ('txtCorrCompId', ''), ('cboLeadRequestFileTypCd', 'DU32'), ('txtLeadRequestSelectFile', (this_FileName, open(this_FileName, 'rb'), 'application/octet-stream')), ('txaLoanTranComments', ''), ], boundary=ct_disp_bndry_10_final_str) headers10 = { "Accept": "application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*", "Accept-Language": "en-US", "User-Agent": "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/7.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Tablet PC 2.0)", "UA-CPU": "AMD64", "Content-Type": "multipart/form-data; boundary={}".format(ct_disp_bndry_10_final_str), "Referer": "referer string", "Host": "host string"} resp10 = s.post(url10, headers=headers10, params=payload_10_vo_params, data=payload10_mpe_vo) ``` POST request from fiddler: ``` POST /SRVCorrBP/LeadMgmt/Application/Lead/LeadSubmitNew.jsp?hidInputControlValues=�DU32�Y�LUPL�C%3A%5CFAKEPATH%5CMAYRA%20CORTEZ.FNM�&hidFormNames=�frmLoanTran~TRUE~�&hidToken=1508961847871LSXG_EDTLeadSummary&hidFileNm=C:\fakepath\filename&hidFileSourceId=&ReUploadInd= ``` This is what I get instead: ``` /SRVCorrBP/LeadMgmt/Application/Lead/LeadSubmitNew.jsp?hidInputControlValues=%C2%A7DU32%C2%A7Y%C2%A7LUPL%C2%A7C%3A%5CFAKEPATH%5CBOPPPMVO.FNM%C2%A7&hidFormNames=%C2%A7frmLoanTran~TRUE~%C2%A7&hidToken=1512952710233LSXG_EDTLeadSummary&hidFileNm=C%3A%5Cfakepath%5Cfilename&hidFileSourceId=&ReUploadInd= ``` As you can see, the `hidFileNm` parameter is supposed to be `hidFileNm=hidFileNm=C:\fakepath\filename` But my request is posting as: `hidFileNm=C%3A%5Cfakepath%5Cfilename`
{ "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/4422/reactions" }
https://api.github.com/repos/psf/requests/issues/4422/timeline
null
completed
null
null
false
[ "Here's the problem, if your server won't accept a request that follows the RFC, there's little that we can actually do to fix this in Requests. Since Requests is doing the right thing here, I suggest you contact the server owner to fix their specification incompatible server. To get this working in the interim, I suggest you handle the query parameters yourself. This likely means building the URL yourself and not relying on Requests for this. For more help with that, please use [StackOverflow](https://stackoverflow.com/questions/tagged/python-requests) as this is not a question and answer forum." ]
https://api.github.com/repos/psf/requests/issues/4421
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4421/labels{/name}
https://api.github.com/repos/psf/requests/issues/4421/comments
https://api.github.com/repos/psf/requests/issues/4421/events
https://github.com/psf/requests/pull/4421
280,845,822
MDExOlB1bGxSZXF1ZXN0MTU3NDUwMzk5
4,421
Reuse session SSLContexts for same TLS settings
{ "avatar_url": "https://avatars.githubusercontent.com/u/34075110?v=4", "events_url": "https://api.github.com/users/jmcackles/events{/privacy}", "followers_url": "https://api.github.com/users/jmcackles/followers", "following_url": "https://api.github.com/users/jmcackles/following{/other_user}", "gists_url": "https://api.github.com/users/jmcackles/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jmcackles", "id": 34075110, "login": "jmcackles", "node_id": "MDQ6VXNlcjM0MDc1MTEw", "organizations_url": "https://api.github.com/users/jmcackles/orgs", "received_events_url": "https://api.github.com/users/jmcackles/received_events", "repos_url": "https://api.github.com/users/jmcackles/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jmcackles/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmcackles/subscriptions", "type": "User", "url": "https://api.github.com/users/jmcackles", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2017-12-10T21:17:12Z
2021-09-04T00:06:37Z
2017-12-10T21:31:04Z
NONE
resolved
Creates SSLContext objects in HTTPAdapter and uses a single SSLContext for connections with the same TLS settings (ca_cert_dir, ca_certs, cert_file, and key_file). This is for https://github.com/requests/requests/issues/4322.
{ "avatar_url": "https://avatars.githubusercontent.com/u/34075110?v=4", "events_url": "https://api.github.com/users/jmcackles/events{/privacy}", "followers_url": "https://api.github.com/users/jmcackles/followers", "following_url": "https://api.github.com/users/jmcackles/following{/other_user}", "gists_url": "https://api.github.com/users/jmcackles/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jmcackles", "id": 34075110, "login": "jmcackles", "node_id": "MDQ6VXNlcjM0MDc1MTEw", "organizations_url": "https://api.github.com/users/jmcackles/orgs", "received_events_url": "https://api.github.com/users/jmcackles/received_events", "repos_url": "https://api.github.com/users/jmcackles/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jmcackles/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmcackles/subscriptions", "type": "User", "url": "https://api.github.com/users/jmcackles", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4421/reactions" }
https://api.github.com/repos/psf/requests/issues/4421/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4421.diff", "html_url": "https://github.com/psf/requests/pull/4421", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4421.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4421" }
true
[]
https://api.github.com/repos/psf/requests/issues/4420
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4420/labels{/name}
https://api.github.com/repos/psf/requests/issues/4420/comments
https://api.github.com/repos/psf/requests/issues/4420/events
https://github.com/psf/requests/issues/4420
280,738,054
MDU6SXNzdWUyODA3MzgwNTQ=
4,420
headers not retained when a custom authentication method is used with request.session
{ "avatar_url": "https://avatars.githubusercontent.com/u/5459596?v=4", "events_url": "https://api.github.com/users/johaven/events{/privacy}", "followers_url": "https://api.github.com/users/johaven/followers", "following_url": "https://api.github.com/users/johaven/following{/other_user}", "gists_url": "https://api.github.com/users/johaven/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/johaven", "id": 5459596, "login": "johaven", "node_id": "MDQ6VXNlcjU0NTk1OTY=", "organizations_url": "https://api.github.com/users/johaven/orgs", "received_events_url": "https://api.github.com/users/johaven/received_events", "repos_url": "https://api.github.com/users/johaven/repos", "site_admin": false, "starred_url": "https://api.github.com/users/johaven/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/johaven/subscriptions", "type": "User", "url": "https://api.github.com/users/johaven", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-12-09T17:36:24Z
2021-09-08T05:00:44Z
2017-12-09T19:01:07Z
NONE
resolved
## standard request ```python r = requests.post(url, auth=JWTAuth('token'), timeout=self.connect_timeout, verify=self.sslcheck, proxies=self.proxies) ``` ## standard request headers on server side ``` Host: 127.0.0.1:5000 Connection: keep-alive Accept-Encoding: gzip, deflate Accept: */* User-Agent: python-requests/2.18.4 Content-Length: 39 Content-Type: application/json ``` ## session request ```python self.session.auth = JWTAuth('token') r = self.session.post(url, json=json, allow_redirects=False, stream=False, timeout=(self.connect_timeout, read_timeout)) ``` ## session request headers on server side ``` Host: 127.0.0.1:5000 Accept-Encoding: identity Content-Length: 81 Authorization: Bearer .... ``` In this case no headers are kept ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.10" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "9081df" }, "urllib3": { "version": "1.22" }, "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/4420/reactions" }
https://api.github.com/repos/psf/requests/issues/4420/timeline
null
completed
null
null
false
[ "After a little more digging ... \r\nWhen custom authentification is used with session, no headers is kept.\r\n```python\r\nclass JWTAuth(AuthBase):\r\n \"\"\"Attaches HTTP Pizza Authentication to the given Request object.\"\"\"\r\n def __init__(self, token):\r\n # setup any auth-related data here\r\n self.token = token\r\n\r\n def __call__(self, r):\r\n # modify and return the request\r\n r.headers = {'Authorization': 'Bearer %s' % self.token}\r\n return r\r\n```\r\n```python\r\nself.session = requests.session()\r\nself.session.auth = JWTAuth('token')\r\n```", "@johaven your custom authentication class is replacing all existing headers with a single `Authorization` header. You'll need to change the code to call something like `r.headers['Authorization'] = 'Bearer %s' % self.token` or use the dictonary's `update` method. You can use our documentation on custom auth [here](http://docs.python-requests.org/en/master/user/advanced/#custom-authentication).\r\n\r\nSince this isn't a defect in Requests, I'm going to close this out.", "Indeed, I do not pay attention to the fact that in the example all the headers are overwritten by the authorization.\r\nThank you for your answer." ]
https://api.github.com/repos/psf/requests/issues/4419
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4419/labels{/name}
https://api.github.com/repos/psf/requests/issues/4419/comments
https://api.github.com/repos/psf/requests/issues/4419/events
https://github.com/psf/requests/issues/4419
280,731,458
MDU6SXNzdWUyODA3MzE0NTg=
4,419
requests.exceptions.ProxyError: HTTPSConnectionPool: Failed to establish a new connection
{ "avatar_url": "https://avatars.githubusercontent.com/u/13938550?v=4", "events_url": "https://api.github.com/users/vThinkBeyondVM/events{/privacy}", "followers_url": "https://api.github.com/users/vThinkBeyondVM/followers", "following_url": "https://api.github.com/users/vThinkBeyondVM/following{/other_user}", "gists_url": "https://api.github.com/users/vThinkBeyondVM/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vThinkBeyondVM", "id": 13938550, "login": "vThinkBeyondVM", "node_id": "MDQ6VXNlcjEzOTM4NTUw", "organizations_url": "https://api.github.com/users/vThinkBeyondVM/orgs", "received_events_url": "https://api.github.com/users/vThinkBeyondVM/received_events", "repos_url": "https://api.github.com/users/vThinkBeyondVM/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vThinkBeyondVM/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vThinkBeyondVM/subscriptions", "type": "User", "url": "https://api.github.com/users/vThinkBeyondVM", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2017-12-09T16:10:55Z
2021-09-05T00:06:55Z
2017-12-10T01:06:37Z
NONE
resolved
Last week I started exploring requests library for invoking REST APIs, it was working fine, I was able to make calls as expected but today when I run the same python script, it fails with below error. Please help. My OS: Ubuntu 16.04 Python: Python 2.7.12 requests library version: 2.18.1 Traceback (most recent call last): File "restfilters.py", line 15, in <module> vcsession = vcrest.get_vc_session(vcip,"Administrator","password") File "/home/vmware/vcrest.py", line 19, in get_vc_session s.post('https://'+vcip+'/rest/com/vmware/cis/session',auth=(username,password)) File "/home/vmware/.local/lib/python2.7/site-packages/requests/sessions.py", line 549, in post return self.request('POST', url, data=data, json=json, **kwargs) File "/home/vmware/.local/lib/python2.7/site-packages/requests/sessions.py", line 502, in request resp = self.send(prep, **send_kwargs) File "/home/vmware/.local/lib/python2.7/site-packages/requests/sessions.py", line 612, in send r = adapter.send(request, **kwargs) File "/home/vmware/.local/lib/python2.7/site-packages/requests/adapters.py", line 502, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='10.192.64.32', port=443): Max retries exceeded with url: /rest/com/vmware/cis/session (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fa16ac2c7d0>: Failed to establish a new connection: [Errno 113] No route to host',)))
{ "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/4419/reactions" }
https://api.github.com/repos/psf/requests/issues/4419/timeline
null
completed
null
null
false
[ "We literally cannot connect to the proxy you've configured. It's unreachable. This is a network configuration error, not a requests error.", "Ok @sigmavirus24 , I did check network connectivity between the server I am invoking the REST API and the VM from where I am running python script, it was pinging fine but it is giving same error as reported. I am not getting how to go ahead for troubleshooting this further. Earlier same setup worked fine. Any help would be really appreciated. ", "@vThinkBeyondVM The problem exists in that there is a proxy sitting somewhere between Requests and the server you wish to connect to. We cannot connect to the proxy. You have configured the proxy. If you need help debugging that further, please ask your specific questions on [StackOverflow](https://stackoverflow.com/questions/tagged/python-requests) since this is not a defect (or bug) in Requests.", "raise ProxyError(e, request=request)\r\nrequests.exceptions.ProxyError: HTTPSConnectionPool(host='www.instagram.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetErr" ]
https://api.github.com/repos/psf/requests/issues/4418
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4418/labels{/name}
https://api.github.com/repos/psf/requests/issues/4418/comments
https://api.github.com/repos/psf/requests/issues/4418/events
https://github.com/psf/requests/issues/4418
279,351,136
MDU6SXNzdWUyNzkzNTExMzY=
4,418
Add a new argument to a request that allows people to always keep the same method after a redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/6144562?v=4", "events_url": "https://api.github.com/users/jakegt1/events{/privacy}", "followers_url": "https://api.github.com/users/jakegt1/followers", "following_url": "https://api.github.com/users/jakegt1/following{/other_user}", "gists_url": "https://api.github.com/users/jakegt1/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jakegt1", "id": 6144562, "login": "jakegt1", "node_id": "MDQ6VXNlcjYxNDQ1NjI=", "organizations_url": "https://api.github.com/users/jakegt1/orgs", "received_events_url": "https://api.github.com/users/jakegt1/received_events", "repos_url": "https://api.github.com/users/jakegt1/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jakegt1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jakegt1/subscriptions", "type": "User", "url": "https://api.github.com/users/jakegt1", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2017-12-05T12:06:07Z
2021-09-08T05:00:45Z
2017-12-07T20:07:38Z
NONE
resolved
Hi, i'm sorry if this is written incorrectly - unsure if feature requests are really allowed, so if they're not just simply delete the issue. A small annoyance i've found which isn't a problem specifically with requests is when a webserver uses a 302/301 redirect when they should be using a 307 or a 308. This happens a lot with common webservers as more and more websites have http -> https redirects. This can be a problem when doing anything that isn't a GET request, as request's resolve_redirects code will change the request method when the webserver isn't using the correct http status code (or is trying to preserver backwards compatibility. My suggestion is to add an argument to a request that allows people to not rebuild the method in the case of redirects. I have written the code (and test) for it if anybody is interested to look at it.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4418/reactions" }
https://api.github.com/repos/psf/requests/issues/4418/timeline
null
completed
null
null
false
[ "Thanks, but Requests isn’t accepting additional keyword arguments at this time. Disabling redirect resolution or overriding some of the methods on `Session` that handle redirects can get you what you want. ", "I do know it's fixable via disabling redirect resolution, it's just a bit of a pain to work with. \r\n\r\nThanks though, wasn't sure what was allowed to be added and what wasn't.." ]
https://api.github.com/repos/psf/requests/issues/4417
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4417/labels{/name}
https://api.github.com/repos/psf/requests/issues/4417/comments
https://api.github.com/repos/psf/requests/issues/4417/events
https://github.com/psf/requests/issues/4417
279,346,734
MDU6SXNzdWUyNzkzNDY3MzQ=
4,417
chardet is licensed under LGPL
{ "avatar_url": "https://avatars.githubusercontent.com/u/3287067?v=4", "events_url": "https://api.github.com/users/asieira/events{/privacy}", "followers_url": "https://api.github.com/users/asieira/followers", "following_url": "https://api.github.com/users/asieira/following{/other_user}", "gists_url": "https://api.github.com/users/asieira/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/asieira", "id": 3287067, "login": "asieira", "node_id": "MDQ6VXNlcjMyODcwNjc=", "organizations_url": "https://api.github.com/users/asieira/orgs", "received_events_url": "https://api.github.com/users/asieira/received_events", "repos_url": "https://api.github.com/users/asieira/repos", "site_admin": false, "starred_url": "https://api.github.com/users/asieira/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/asieira/subscriptions", "type": "User", "url": "https://api.github.com/users/asieira", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2017-12-05T11:49:59Z
2021-09-03T00:10:48Z
2017-12-06T02:12:03Z
CONTRIBUTOR
resolved
`chardet` is a dependency of `requests` and is licensed under the LGPL 2.1. Aren't GPL and LGPL components incompatible with the Apache 2.0 license used by `requests`, as per https://www.apache.org/legal/resolved.html#category-x and https://www.apache.org/licenses/GPL-compatibility.html?
{ "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/4417/reactions" }
https://api.github.com/repos/psf/requests/issues/4417/timeline
null
completed
null
null
false
[ "@asieira it really depends on how you interpret the language.\r\n\r\nFirst, you're linking to a section titled: `Which licenses may NOT be included within Apache products?` I believe that means projects developed specifically by the ASF not under the Apache License.\r\n\r\nLGPL might cause license issues if we were modifying chardet and including that in Requests. That would affect our licensing.", "FWIW, in case anyone else finds this closed issue, https://github.com/psf/requests/issues/4848#issuecomment-544558645 lists an MIT licensed alternative to `chardet`." ]
https://api.github.com/repos/psf/requests/issues/4416
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4416/labels{/name}
https://api.github.com/repos/psf/requests/issues/4416/comments
https://api.github.com/repos/psf/requests/issues/4416/events
https://github.com/psf/requests/issues/4416
279,309,126
MDU6SXNzdWUyNzkzMDkxMjY=
4,416
Requests doesn't respect socket default timeout ( socket.setdefaulttimeout() )
{ "avatar_url": "https://avatars.githubusercontent.com/u/533295?v=4", "events_url": "https://api.github.com/users/farin/events{/privacy}", "followers_url": "https://api.github.com/users/farin/followers", "following_url": "https://api.github.com/users/farin/following{/other_user}", "gists_url": "https://api.github.com/users/farin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/farin", "id": 533295, "login": "farin", "node_id": "MDQ6VXNlcjUzMzI5NQ==", "organizations_url": "https://api.github.com/users/farin/orgs", "received_events_url": "https://api.github.com/users/farin/received_events", "repos_url": "https://api.github.com/users/farin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/farin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/farin/subscriptions", "type": "User", "url": "https://api.github.com/users/farin", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-12-05T09:47:05Z
2021-09-08T05:00:45Z
2017-12-07T20:06:36Z
NONE
resolved
urllib3 and Requests has different semantic when handling unspecified timeout (which means no keyword arg given) ## Actual Result **urllib3** - when timeout is None -> no timeout - when timeout is not given -> internal _Default objects is used which leads to `socket.getdefaulttimeout()` see https://github.com/shazow/urllib3/blob/master/urllib3/connectionpool.py#L373 **requests** both None and not specified timeout is handled in same way. urllib3 `Timeout` object is created with None values -> no timeout at all while `socket.getdefaulttimeout()` is ignored. see https://github.com/requests/requests/blob/master/requests/adapters.py#L431 timeout arg is always passed into underlaying urllib3 ## Expected Result I think it should be better handle it same as urllib3. When timeout is not specified on request level then don't replace it with infinite timeout but just pass unspecified to timeout to urllib3 ## System Information reported on requests version 2.18.4
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 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/4416/reactions" }
https://api.github.com/repos/psf/requests/issues/4416/timeline
null
completed
null
null
false
[ "Thanks, this is a known issue and should be resolved in 3.0." ]
https://api.github.com/repos/psf/requests/issues/4415
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4415/labels{/name}
https://api.github.com/repos/psf/requests/issues/4415/comments
https://api.github.com/repos/psf/requests/issues/4415/events
https://github.com/psf/requests/issues/4415
278,845,105
MDU6SXNzdWUyNzg4NDUxMDU=
4,415
Requests seems to either ignore or not notice rare transport errors
{ "avatar_url": "https://avatars.githubusercontent.com/u/1025646?v=4", "events_url": "https://api.github.com/users/szborows/events{/privacy}", "followers_url": "https://api.github.com/users/szborows/followers", "following_url": "https://api.github.com/users/szborows/following{/other_user}", "gists_url": "https://api.github.com/users/szborows/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/szborows", "id": 1025646, "login": "szborows", "node_id": "MDQ6VXNlcjEwMjU2NDY=", "organizations_url": "https://api.github.com/users/szborows/orgs", "received_events_url": "https://api.github.com/users/szborows/received_events", "repos_url": "https://api.github.com/users/szborows/repos", "site_admin": false, "starred_url": "https://api.github.com/users/szborows/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/szborows/subscriptions", "type": "User", "url": "https://api.github.com/users/szborows", "user_view_type": "public" }
[]
closed
false
null
[]
{ "closed_at": null, "closed_issues": 29, "created_at": "2024-05-19T18:29:04Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/34", "id": 11073254, "labels_url": "https://api.github.com/repos/psf/requests/milestones/34/labels", "node_id": "MI_kwDOABTKOs4AqPbm", "number": 34, "open_issues": 0, "state": "open", "title": "Bankruptcy", "updated_at": "2024-05-20T14:37:16Z", "url": "https://api.github.com/repos/psf/requests/milestones/34" }
10
2017-12-04T01:32:43Z
2024-05-20T14:36:55Z
2024-05-20T14:36:55Z
NONE
null
So I was playing around with blockade and small piece of code that was using request library. I was researching something completely different but I have noticed some anomaly that seems to be originated somewhere in the library or libraries it uses. In essence, 1-2% of requests made when blockade disrupts the network end up with status code 200 and no exceptions, but content is only partial. Blockade is a tool to test various network conditions. It's on GitHub too. Maybe the bug is in request or maybe it lies somewhere lower. Or maybe it's my configuration that leads to such results. I successfully tried to uncover this bug on several machines (both physical laptops and VMs in the cloud). I asked colleague from my floor to reproduce this and he succeeded. Replacing requests code with `urllib.request.urlopen` results in exceptions being thrown for these 1-2% of cases. I'll be glad if someone else can confirm this or let me know that I did something wrong and should go home. ## Expected Result Exception raised. ## Actual Result Exception is not raised. Response content is cut. Following is output from freshly deployed VM in private cloud. Hash starting with `e4b` is proper one. ``` INFO | request #33: http://file_server/files/1MB.bin INFO | request #33: downloaded 1.0MB in 55.45s. code: 200, hsh: e4b7f62da691604a692844e93304de6b INFO | 172.17.0.1 - - [04/Dec/2017:01:20:16 +0000] "POST /dl HTTP/1.1" 200 0 "-" "curl/7.52.1" INFO | request #34: http://file_server/files/1MB.bin INFO | request #34: downloaded 1.0MB in 50.31s. code: 200, hsh: e4b7f62da691604a692844e93304de6b INFO | 172.17.0.1 - - [04/Dec/2017:01:21:11 +0000] "POST /dl HTTP/1.1" 200 0 "-" "curl/7.52.1" INFO | request #35: http://file_server/files/1MB.bin INFO | request #35: downloaded 0.1509552001953125MB in 69.74s. code: 200, hsh: afb64be8e2fe70f73f9d6e37d39478bf INFO | 172.17.0.1 - - [04/Dec/2017:01:22:25 +0000] "POST /dl HTTP/1.1" 200 0 "-" "curl/7.52.1" INFO | request #36: http://file_server/files/1MB.bin INFO | request #36: downloaded 1.0MB in 55.48s. code: 200, hsh: e4b7f62da691604a692844e93304de6b INFO | 172.17.0.1 - - [04/Dec/2017:01:23:25 +0000] "POST /dl HTTP/1.1" 200 0 "-" "curl/7.52.1" INFO | request #37: http://file_server/files/1MB.bin INFO | request #37: downloaded 1.0MB in 62.19s. code: 200, hsh: e4b7f62da691604a692844e93304de6b ``` ## Reproduction Steps 1. Clone my repo: `szborows/blockade-example`. 2. Install blockade (I've tested both 0.3.1 and 0.4.0): `pip install blockade` 3. Build docker image: `./build` and pull nginx: `docker pull nginx:1.11-alpine` 4. Start blockade: `blockade up`. It should confirm with two containers up 5. I open separate console to see output from backend container in real time: `docker logs -f blockadeexample_backend` 6. Customize and run the script. You can disable tcpdump at start etc. To start script execute `./run` 7. If you don't observe any anomalies in the logs after several runs (each does 100 iterations), then try to change `30` in `test_flaky` to something bigger. On some machines in cloud I needed to increase this to 40 to observe the failure sooner. ## System Information Python version is: 3.6-alpine. Requests version: 2.18.4. Blockade version: 0.4.0. Edit: Adding detailed info from my local container. ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.0" }, "platform": { "release": "4.8.0-1-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020af" }, "urllib3": { "version": "1.22" }, "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/4415/reactions" }
https://api.github.com/repos/psf/requests/issues/4415/timeline
null
completed
null
null
false
[ "Those log messages have no context or meaning. Please explain what you're trying to communicate with them. Further, please provide the actual requests code that you're using. As far as I can tell, requests isn't in use from those logs.", "I think code speaks for itself:\r\nhttps://github.com/szborows/blockade-example/blob/master/backend/backend.py#L29\r\n\r\nthis is just downloading file that is 1MB in size and checking md5 hash. AFAIK hash should be the same all of the times.", "What exceptions does urlopen throw in the error case?", "I have observed following two. I have also tested `urllib3`'s connection pool and it was raising `urllib3.exceptions.ProtocolError`, but I don't have stacktrace.\r\n\r\n```\r\nERROR:aiohttp.server:Error handling request\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.6/site-packages/aiohttp/web_server.py\", line 62, in handle_request\r\n resp = yield from self._handler(request)\r\n File \"/usr/local/lib/python3.6/site-packages/aiohttp/web.py\", line 270, in _handle\r\n resp = yield from handler(request)\r\n File \"/app/backend.py\", line 27, in handle_download\r\n data = response.read()\r\n File \"/usr/local/lib/python3.6/http/client.py\", line 462, in read\r\n s = self._safe_read(self.length)\r\n File \"/usr/local/lib/python3.6/http/client.py\", line 614, in _safe_read\r\n raise IncompleteRead(b''.join(s), amt)\r\nhttp.client.IncompleteRead: IncompleteRead(85432 bytes read, 963144 more expected)\r\n```\r\n\r\n```\r\nERROR:aiohttp.server:Error handling request\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.6/site-packages/aiohttp/web_server.py\", line 62, in handle_request\r\n resp = yield from self._handler(request)\r\n File \"/usr/local/lib/python3.6/site-packages/aiohttp/web.py\", line 270, in _handle\r\n resp = yield from handler(request)\r\n File \"/app/backend.py\", line 26, in handle_download\r\n response = urllib.request.urlopen(post_data['url'])\r\n File \"/usr/local/lib/python3.6/urllib/request.py\", line 223, in urlopen\r\n return opener.open(url, data, timeout)\r\n File \"/usr/local/lib/python3.6/urllib/request.py\", line 526, in open\r\n response = self._open(req, data)\r\n File \"/usr/local/lib/python3.6/urllib/request.py\", line 544, in _open\r\n '_open', req)\r\n File \"/usr/local/lib/python3.6/urllib/request.py\", line 504, in _call_chain\r\n result = func(*args)\r\n File \"/usr/local/lib/python3.6/urllib/request.py\", line 1346, in http_open\r\n return self.do_open(http.client.HTTPConnection, req)\r\n File \"/usr/local/lib/python3.6/urllib/request.py\", line 1321, in do_open\r\n r = h.getresponse()\r\n File \"/usr/local/lib/python3.6/http/client.py\", line 1331, in getresponse\r\n response.begin()\r\n File \"/usr/local/lib/python3.6/http/client.py\", line 297, in begin\r\n version, status, reason = self._read_status()\r\n File \"/usr/local/lib/python3.6/http/client.py\", line 266, in _read_status\r\n raise RemoteDisconnected(\"Remote end closed connection without\"\r\nhttp.client.RemoteDisconnected: Remote end closed connection without response\r\n```", "Both of those errors are not swallowed or ignored by Requests, so it’s hard to believe that we’re ignoring them in this case. ", "@Lukasa have you tried reproducing this? I believe that somebody else must confirm this..", "Hi, \r\n\r\nI think i found a solution and created pull requests for urllib3 -> https://github.com/urllib3/urllib3/pull/1911 \r\nAfter it will be merged ( I hope ) , requests should raise MaxRetries error as it should , because they are setting max_retries = 0 to retry object of urllib3 by default - > this should be discussed if better not to leave default urllib3 value which is 3 , or pass 1.", "More info - > https://bugs.python.org/issue3566 , https://hg.python.org/cpython/rev/eba80326ba53 , https://bugs.python.org/issue41345", "Requests is an API for make easy HTTP/HTTPS Requests, it still depends on urlib3 and urlib depends on sockets and it from the OS...\r\n\r\nin order to handle this things, you have the aviabily to use Adapters.... :)", "In an effort to clean up the issue tracker to only have issues that are still relevant to the project we've done a quick pass and decided this issue may no longer be relevant for a variety of potential reasons, including:\r\n\r\n* Applies to a much older version, unclear whether the issue still applies.\r\n* Change requires a backwards incompatible release and it's unclear if the benefits are worth the migration effort from the community.\r\n* There isn't a clear demand from the community on the change landing in Requests.\r\n\r\nIf you think the issue should remain open, please comment so below or open a new issue and link back to the original issue. Again, thank you for opening the issue and for the discussion, it's much appreciated." ]
https://api.github.com/repos/psf/requests/issues/4414
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4414/labels{/name}
https://api.github.com/repos/psf/requests/issues/4414/comments
https://api.github.com/repos/psf/requests/issues/4414/events
https://github.com/psf/requests/issues/4414
278,840,668
MDU6SXNzdWUyNzg4NDA2Njg=
4,414
Cookie is not set in requests.Session when "Set-Cookie" header is received
{ "avatar_url": "https://avatars.githubusercontent.com/u/1923704?v=4", "events_url": "https://api.github.com/users/dmfigol/events{/privacy}", "followers_url": "https://api.github.com/users/dmfigol/followers", "following_url": "https://api.github.com/users/dmfigol/following{/other_user}", "gists_url": "https://api.github.com/users/dmfigol/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dmfigol", "id": 1923704, "login": "dmfigol", "node_id": "MDQ6VXNlcjE5MjM3MDQ=", "organizations_url": "https://api.github.com/users/dmfigol/orgs", "received_events_url": "https://api.github.com/users/dmfigol/received_events", "repos_url": "https://api.github.com/users/dmfigol/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dmfigol/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dmfigol/subscriptions", "type": "User", "url": "https://api.github.com/users/dmfigol", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2017-12-04T00:48:00Z
2018-07-25T15:19:18Z
2018-03-12T21:42:12Z
NONE
off-topic
**requests.Session** does not honor **Set-Cookie** header ## Expected Result The cookie should be set for the session. ## Actual Result Cookie is not set. ## Reproduction Steps ```python session = requests.Session() r = session.get(AUTH_URL, auth=(USERNAME,PASSWORD), verify=False) print(r.status_code) print(r.headers) print(r.content) print(session.cookies, r.cookies) r = session.get(GROUP_URL, verify=False) print(r.content) print(r.status_code) ########## OUTPUT ######### 200 {'Date': 'Mon, 04 Dec 2017 00:30:40 GMT', 'Content-Type': 'application/json', 'Content-Length': '7', 'Connection': 'keep-alive', 'Set-Cookie': 'X-JWT-ACCESS-TOKEN=<long-token>;Version=-1;Comment=;Domain=;Path=/;Secure', 'X-Kong-Upstream-Latency': '200', 'X-Kong-Proxy-Latency': '31', 'Via': 'kong/0.9.7'} b'success' <RequestsCookieJar[]> <RequestsCookieJar[]> ##### << here, cookies are NOT set b'{"message":"Unauthorized"}\n' 401 ``` ## Additional Information I see a bug in API: '**Content-Type**' for the response is '**application/json**', but the response itself is not a valid JSON (`b'success'`). I am going to contact API developers to fix this. I am not 100% sure it is related to my problem, but I thought you should know. ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "7", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "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/4414/reactions" }
https://api.github.com/repos/psf/requests/issues/4414/timeline
null
completed
null
null
false
[ "This is what you've provided as the value of `Set-Cookie`: `X-JWT-ACCESS-TOKEN=<long-token>;Version=-1;Comment=;Domain=;Path=/;Secure`. Judging by that value, it appears that there are a few things wrong with this string (presuming `<long-token>` is the only editing you did).\r\n\r\nThe header in this case is defined as 1 or more `av-pair`s where `cookiename=cookievalue` is the only required one. In this case, I presume the server intends for `X-JWT-ACCESS-TOKEN` to be the cookie name. With that in mind, everything afterward is optional. Further, an `av-pair` is defined as: `attr [\"=\" value]` where `attr` is the only required portion of this. That means if no value is provided they probably shouldn't send `=` but that probably parses fine... except that they send an empty Domain. If they don't specify their own domain attribute, I believe that we force it to be the host of the URL that was requested when we made the request. However, they specify it as empty. I think that's what is tripping up the standard library here.", "@sigmavirus24 thank you for your comments. Yes, I only replaced the token with `<long-token>`. I agree with you, that this API returns some strange values and I am going to contact API developers to get this fixed. Is there any way to check if the issue is indeed caused by an empty **Domain** av-pair and fix if needed? Browsers and Postman are able to set this cookie successfully.", "Closing due to inactivity — thank you very much for your patience ✨🍰✨", "I'm seeing the exact same thing, except I have provided the domain. Here are the headers returned with the jwt token shortened.\r\n\r\n```\r\n{'X-Application-Context': 'application:8080', 'correlation-id': '66279bda-8d55-4d80-80e9-7dd105c8daaf', 'Set-Cookie': 'X-AUTH-TOKEN=eyJ0eX.eyJzdWIiOiJ7XCJ0ZW.g-ZVOQ; Max-Age=43200; Expires=Sun, 06-May-2018 10:53:21 GMT; Domain=localhost; Path=/; HttpOnly, X-REFRESH-TOKEN=eyJiJ9.eyJzdWIiOiIxMTExMTExQ.4wg; Max-Age=43200; Expires=Sun, 06-May-2018 10:53:21 GMT; Domain=localhost; Path=/; HttpOnly', 'Date': 'Sat, 05 May 2018 22:53:21 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Transfer-Encoding': 'chunked'}\r\n```\r\n\r\nand the cookies are coming back. `<RequestsCookieJar[]> `", "I too am having this issue. Latest `requests`. Python 3.6.\r\n\r\n```\r\n# Session cookies\r\nINFO:root:<RequestsCookieJar[]>\r\n# Response cookies\r\nINFO:root:<RequestsCookieJar[]>\r\n# Response headers\r\nINFO:root:{'Content-Type': 'application/json', 'Content-Length': '7', 'Connection': 'keep-alive', 'Date': 'Fri, 01 Jun 2018 21:57:17 GMT', 'Set-Cookie': 'X-JWT-ACCESS-TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1YTU4Y2QzN2UwNWJiYTAwOGVmNjJiOTIiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjVhMzE1MTYwOTA5MGZiYTY5OGIyZjViNyJdLCJ0ZW5hbnRJZCI6IjVhMzE1MTlkZTA1YmJhMDA4ZWY2MWYwYSIsImV4cCI6MTUyNzg5MzgzNywidXNlcm5hbWUiOiJkZXZuZXR1c2VyIn0.VeP442Qt7iyAnQTNISQ8tuXzf1fWqAdDMdKrBJQsims;Version=1;Comment=;Domain=;Path=/;Max-Age=3600;Secure;HttpOnly', 'X-Kong-Upstream-Latency': '292', 'X-Kong-Proxy-Latency': '4', 'Via': 'kong/0.11.0', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'}\r\n```\r\n\r\nIt does work via Postman.\r\n\r\nDebug logs:\r\n```\r\nDEBUG:http.cookiejar:add_cookie_header\r\nDEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): X\r\n/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n InsecureRequestWarning)\r\nDEBUG:urllib3.connectionpool:X \"GET X HTTP/1.1\" 200 7\r\nDEBUG:http.cookiejar:extract_cookies: Content-Type: application/json\r\nContent-Length: 7\r\nConnection: keep-alive\r\nDate: Fri, 01 Jun 2018 22:48:34 GMT\r\nSet-Cookie: X-JWT-ACCESS-TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1YTU4Y2QzN2UwNWJiYTAwOGVmNjJiOTIiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjVhMzE1MTYwOTA5MGZiYTY5OGIyZjViNyJdLCJ0ZW5hbnRJZCI6IjVhMzE1MTlkZTA1YmJhMDA4ZWY2MWYwYSIsImV4cCI6MTUyNzg5NjkxNCwidXNlcm5hbWUiOiJkZXZuZXR1c2VyIn0.J5vECtvkjYc9Zwu85R51Lu_3Z4jv5buf8JuKKwXS2pw;Version=1;Comment=;Domain=;Path=/;Max-Age=3600;Secure;HttpOnly\r\nX-Kong-Upstream-Latency: 131\r\nX-Kong-Proxy-Latency: 4\r\nVia: kong/0.11.0\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains\r\n\r\n\r\nDEBUG:http.cookiejar: - checking cookie X-JWT-ACCESS-TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1YTU4Y2QzN2UwNWJiYTAwOGVmNjJiOTIiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjVhMzE1MTYwOTA5MGZiYTY5OGIyZjViNyJdLCJ0ZW5hbnRJZCI6IjVhMzE1MTlkZTA1YmJhMDA4ZWY2MWYwYSIsImV4cCI6MTUyNzg5NjkxNCwidXNlcm5hbWUiOiJkZXZuZXR1c2VyIn0.J5vECtvkjYc9Zwu85R51Lu_3Z4jv5buf8JuKKwXS2pw\r\nDEBUG:http.cookiejar: non-local domain . contains no embedded dot\r\nDEBUG:http.cookiejar:extract_cookies: Content-Type: application/json\r\nContent-Length: 7\r\nConnection: keep-alive\r\nDate: Fri, 01 Jun 2018 22:48:34 GMT\r\nSet-Cookie: X-JWT-ACCESS-TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1YTU4Y2QzN2UwNWJiYTAwOGVmNjJiOTIiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjVhMzE1MTYwOTA5MGZiYTY5OGIyZjViNyJdLCJ0ZW5hbnRJZCI6IjVhMzE1MTlkZTA1YmJhMDA4ZWY2MWYwYSIsImV4cCI6MTUyNzg5NjkxNCwidXNlcm5hbWUiOiJkZXZuZXR1c2VyIn0.J5vECtvkjYc9Zwu85R51Lu_3Z4jv5buf8JuKKwXS2pw;Version=1;Comment=;Domain=;Path=/;Max-Age=3600;Secure;HttpOnly\r\nX-Kong-Upstream-Latency: 131\r\nX-Kong-Proxy-Latency: 4\r\nVia: kong/0.11.0\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains\r\n\r\n\r\nDEBUG:http.cookiejar: - checking cookie X-JWT-ACCESS-TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1YTU4Y2QzN2UwNWJiYTAwOGVmNjJiOTIiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjVhMzE1MTYwOTA5MGZiYTY5OGIyZjViNyJdLCJ0ZW5hbnRJZCI6IjVhMzE1MTlkZTA1YmJhMDA4ZWY2MWYwYSIsImV4cCI6MTUyNzg5NjkxNCwidXNlcm5hbWUiOiJkZXZuZXR1c2VyIn0.J5vECtvkjYc9Zwu85R51Lu_3Z4jv5buf8JuKKwXS2pw\r\nDEBUG:http.cookiejar: non-local domain . contains no embedded dot\r\nINFO:root:<RequestsCookieJar[]>\r\nINFO:root:<RequestsCookieJar[]>\r\nINFO:root:{'Content-Type': 'application/json', 'Content-Length': '7', 'Connection': 'keep-alive', 'Date': 'Fri, 01 Jun 2018 22:48:34 GMT', 'Set-Cookie': 'X-JWT-ACCESS-TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1YTU4Y2QzN2UwNWJiYTAwOGVmNjJiOTIiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjVhMzE1MTYwOTA5MGZiYTY5OGIyZjViNyJdLCJ0ZW5hbnRJZCI6IjVhMzE1MTlkZTA1YmJhMDA4ZWY2MWYwYSIsImV4cCI6MTUyNzg5NjkxNCwidXNlcm5hbWUiOiJkZXZuZXR1c2VyIn0.J5vECtvkjYc9Zwu85R51Lu_3Z4jv5buf8JuKKwXS2pw;Version=1;Comment=;Domain=;Path=/;Max-Age=3600;Secure;HttpOnly', 'X-Kong-Upstream-Latency': '131', 'X-Kong-Proxy-Latency': '4', 'Via': 'kong/0.11.0', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'}\r\nINFO:root:success\r\nDEBUG:http.cookiejar:add_cookie_header\r\n/root/.local/share/virtualenvs/data-I7nS9QO2/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n InsecureRequestWarning)\r\nDEBUG:urllib3.connectionpool:X \"GET X HTTP/1.1\" 401 None\r\nDEBUG:http.cookiejar:extract_cookies: Date: Fri, 01 Jun 2018 22:48:34 GMT\r\nContent-Type: application/json; charset=utf-8\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nServer: kong/0.11.0\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains\r\n\r\n\r\nDEBUG:http.cookiejar:extract_cookies: Date: Fri, 01 Jun 2018 22:48:34 GMT\r\nContent-Type: application/json; charset=utf-8\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nServer: kong/0.11.0\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains\r\n\r\n```\r\n\r\nThe `Domain` appears to be failing this condition.\r\nhttps://github.com/python/cpython/blob/3.6/Lib/http/cookiejar.py#L1033\r\n\r\nIt's detected as not `Absent` despite a falsey value..what should the behavior be?\r\nhttps://github.com/python/cpython/blob/3.6/Lib/http/cookiejar.py#L1504\r\n\r\n@sigmavirus24 Given you seem to have some understanding here - is an empty `Domain` value considered invalid?\r\n\r\nEDIT: Looking at the [RFC](https://tools.ietf.org/html/rfc6265#section-4.1.2.3), an empty `Domain` value looks to be not completely defined. Is not providing a value the same as omitting the attribute, in which case it is still valid and should only be useful for the origin server? Or is it invalid and should be dropped?\r\n\r\nEDIT EDIT: According to the [RFC](https://tools.ietf.org/html/rfc6265#section-4.1.1) syntax specification, a `domain-value` being empty is invalid. This is a bug from the API.", "Experiencing the same issue. The `Set-Cookie` header successfully leads to the cookie's presence in `response.cookies` but does not lead to a cookie in the session's cookie jar. \r\n\r\nHeader is the following:\r\n```\r\n{\r\n \"Set-Cookie\": \"foo=bar; \"\r\n}\r\n```\r\n\r\nResponse.cookies is the following:\r\n```\r\n<RequestsCookieJar[<Cookie foo=bar for />]>\r\n```\r\n\r\nSession.cookies is the following:\r\n```\r\n<RequestsCookieJar[]>\r\n```\r\n\r\nVersion: 2.19.1", "Hi @Audace, it doesn't look like this is the same issue. The above is discussing cookies with empty `domain` values.\r\n\r\nFor your issue, we'll need more info and it should probably be opened as it's own ticket. A quick POC shows this should be working as expected though, so I'd suggest double checking your code first. Thanks!\r\n\r\n```python\r\nimport requests\r\n\r\ns = Requests.Session()\r\nresp = s.get('https://httpbin.org/cookies/set?foo=bar')\r\nprint(s.cookies)\r\n>>>\r\n<RequestsCookieJar[Cookie(version=0, name='foo', value='bar', port=None, port_specified=False, domain='httpbin.org', domain_specified=False, domain_initial_dot=False, path='/', path_specified=True, secure=True, expires=None, discard=True, comment=None, comment_url=None, rest={}, rfc2109=False)]>\r\n```\r\n\r\n", "Hi @nateprewitt,\r\n\r\nI'm facing the same issue when trying to mock the response. Following example reproduces it:\r\n\r\n```python\r\nimport requests\r\nimport responses\r\n\r\nsession = requests.Session()\r\nheaders = {'Set-Cookie': 'foo=bar'}\r\n\r\nwith responses.RequestsMock() as rsps:\r\n rsps.add(\r\n responses.GET, 'https://google.com', headers=headers)\r\n r = session.get('https://google.com')\r\n\r\n\r\nprint(r.cookies)\r\n>>> <RequestsCookieJar[<Cookie foo=bar for />]>\r\n\r\nprint(session.cookies)\r\n>>> <RequestsCookieJar[]>\r\n```\r\n\r\n```bash\r\n$ python --version\r\nPython 3.7.0\r\n\r\n$ pip freeze \r\nresponses==0.9.0\r\nrequests==2.19.1\r\n```\r\n", "Hi @mathewcohle, as was said above, this isn't related to this issue. The issue you're describing appears to be related to `responses` and how it's mocking functionality works. I would suggest following up over there." ]
https://api.github.com/repos/psf/requests/issues/4413
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4413/labels{/name}
https://api.github.com/repos/psf/requests/issues/4413/comments
https://api.github.com/repos/psf/requests/issues/4413/events
https://github.com/psf/requests/issues/4413
278,150,353
MDU6SXNzdWUyNzgxNTAzNTM=
4,413
Timeout not working for "requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))"
{ "avatar_url": "https://avatars.githubusercontent.com/u/26564456?v=4", "events_url": "https://api.github.com/users/hingston/events{/privacy}", "followers_url": "https://api.github.com/users/hingston/followers", "following_url": "https://api.github.com/users/hingston/following{/other_user}", "gists_url": "https://api.github.com/users/hingston/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hingston", "id": 26564456, "login": "hingston", "node_id": "MDQ6VXNlcjI2NTY0NDU2", "organizations_url": "https://api.github.com/users/hingston/orgs", "received_events_url": "https://api.github.com/users/hingston/received_events", "repos_url": "https://api.github.com/users/hingston/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hingston/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hingston/subscriptions", "type": "User", "url": "https://api.github.com/users/hingston", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2017-11-30T14:59:42Z
2021-09-08T05:00:47Z
2017-11-30T15:18:11Z
NONE
resolved
I'm making calls to an API and multiple times a day requests hangs then throws `'Remote end closed connection without response'` after 1-2 minutes even with the timeout set to 3 seconds. ## Expected Result I would expect it to timeout after 3 seconds. ## Actual Result `Time elpased (hh:mm:ss.ms) 0:01:55.254653` ``` File "/home/vmagent/app/checker/views.py", line 127, in call_api return sessions[region].get(url, timeout=3) File "/env/lib/python3.6/site-packages/requests/sessions.py", line 521, in get return self.request('GET', url, **kwargs) File "/env/lib/python3.6/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/env/lib/python3.6/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/env/lib/python3.6/site-packages/requests/adapters.py", line 490, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',)) ``` ## Reproduction Steps ``` import datetime import traceback from requests import session, Timeout from checker.forms import REGIONS sessions = {} for r in REGIONS: sessions[r] = session() sessions[r].headers.update({'X-API-KEY': 'API-KEY-#####'}) def call_api(url, region): start_time = datetime.datetime.now() try: return sessions[region].get(url, timeout=3) except Timeout: time_elapsed = datetime.datetime.now() - start_time print('Time elpased (hh:mm:ss.ms) {}'.format(time_elapsed)) return 408 # Timeout except: time_elapsed = datetime.datetime.now() - start_time print('Time elpased (hh:mm:ss.ms) {}'.format(time_elapsed)) traceback.print_exc() return 520 # Unknown error ``` ## System Information ``` pip==9.0.1 mysqlclient==1.3.12 Django==2.0rc1 django-db-geventpool==1.21 django-removewww==0.1.2 gevent==1.2.2 gunicorn==19.7.1 psycopg2==2.7.3.2 python-dateutil==2.6.1 pytz==2017.3 regex==2017.11.9 requests-toolbelt==0.8.0 requests[security] six==1.11.0 wheel==0.30.0 ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.1.4" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "1010007f", "version": "17.4.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "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/4413/reactions" }
https://api.github.com/repos/psf/requests/issues/4413/timeline
null
completed
null
null
false
[ "I think there's a misunderstanding here that would be clarified by reviewing our [documentation](http://docs.python-requests.org/en/master/user/quickstart/#timeouts)\r\n\r\nSpecifically our Note (emphasis mine):\r\n\r\n> `timeout` is **not a time limit on the entire response** download; rather, an exception is raised if the server has not issued a response for timeout seconds (more precisely, if no bytes have been received on the underlying socket for `timeout` seconds). If no timeout is specified explicitly, requests do not time out.\r\n\r\nIn other words, the server is tricking your socket into thinking that it's getting data once every ~3 seconds (and connecting takes < 3 seconds) so this is why you see a ConnectionError after almost 2 minutes. If you want a time limit on the entire response (also known as a wall timeout) you'll need to use a different approach that works for your target operating system. There are packages on PyPI that accomplish this through many different means based on the target operating system.\r\n\r\nCheers,\r\nIan\r\n\r\nP.S.\r\n\r\nThis topic has been covered in depth in many other issues. Please review those in the future before opening new issues.", "What is the best way for searching for these issues? I've been Google searching this error message for the past 2 days and haven't found anything relating to what you've told me.", "GitHub's issue search is pretty good. Here's what I looked for: https://github.com/requests/requests/issues?utf8=%E2%9C%93&q=is%3Aissue+timeout+wall", "For reference https://github.com/requests/requests/issues/3099 pops up in that search which has back references to many other issues discussing this as well.", "And there's more discussion of packages on https://github.com/requests/toolbelt/issues/51" ]
https://api.github.com/repos/psf/requests/issues/4412
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4412/labels{/name}
https://api.github.com/repos/psf/requests/issues/4412/comments
https://api.github.com/repos/psf/requests/issues/4412/events
https://github.com/psf/requests/issues/4412
278,027,613
MDU6SXNzdWUyNzgwMjc2MTM=
4,412
TypeError: open() got an unexpected keyword argument 'buffering'
{ "avatar_url": "https://avatars.githubusercontent.com/u/10855384?v=4", "events_url": "https://api.github.com/users/StephenSeanGleason/events{/privacy}", "followers_url": "https://api.github.com/users/StephenSeanGleason/followers", "following_url": "https://api.github.com/users/StephenSeanGleason/following{/other_user}", "gists_url": "https://api.github.com/users/StephenSeanGleason/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/StephenSeanGleason", "id": 10855384, "login": "StephenSeanGleason", "node_id": "MDQ6VXNlcjEwODU1Mzg0", "organizations_url": "https://api.github.com/users/StephenSeanGleason/orgs", "received_events_url": "https://api.github.com/users/StephenSeanGleason/received_events", "repos_url": "https://api.github.com/users/StephenSeanGleason/repos", "site_admin": false, "starred_url": "https://api.github.com/users/StephenSeanGleason/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/StephenSeanGleason/subscriptions", "type": "User", "url": "https://api.github.com/users/StephenSeanGleason", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-30T07:52:28Z
2021-09-08T05:00:47Z
2017-11-30T13:06:57Z
NONE
resolved
when I run my code I get the following error. Traceback (most recent call last): File "C:/Users/stephen/AppData/Local/Programs/Python/Python35/chatbot.py", line 97, in <module> with bz2.open("C:/RC_{}".format(timeframe.split('-')[0],timeframe), buffering=1000) as f: TypeError: open() got an unexpected keyword argument 'buffering' CODE IS NEAR BOTTOM AND UNDER #################### SYMBOLS THAT GETS ERROR MESSAGE. ANY HELP WOULD BE GREATLY APPRECIATED. THANKS. import sqlite3 import json import bz2 from datetime import datetime timeframe = '2017-10' sql_transaction = [] connection = sqlite3.connect('{}.db'.format(timeframe)) c = connection.cursor() def create_table(): c.execute("""CREATE TABLE IF NOT EXISTS parent_reply (parent_id TEXT PRIMARY KEY, comment_id TEXT UNIQUE, parent TEXT, comment TEXT, subreddit TEXT, unix INT, score INT)""") def format_data(data): data = data.replace('\n',' newlinechar ').replace('\r',' newlinechar ').replace('"',"'") return data def transaction_bldr(sql): global sql_transaction sql_transaction.append(sql) if len(sql_transaction) > 1000: c.execute('BEGIN TRANSACTION') for s in sql_transaction: try: c.execute(s) except: pass connection.commit() sql_transaction = [] def sql_insert_replace_comment(commentid,parentid,parent,comment,subreddit,time,score): try: sql = """UPDATE parent_reply SET parent_id = ?, comment_id = ?, parent = ?, comment = ?, subreddit = ?, unix = ?, score = ? WHERE parent_id =?;""".format(parentid, commentid, parent, comment, subreddit, int(time), score, parentid) transaction_bldr(sql) except Exception as e: print('s0 insertion',str(e)) def sql_insert_has_parent(commentid,parentid,parent,comment,subreddit,time,score): try: sql = """INSERT INTO parent_reply (parent_id, comment_id, parent, comment, subreddit, unix, score) VALUES ("{}","{}","{}","{}","{}",{},{});""".format(parentid, commentid, parent, comment, subreddit, int(time), score) transaction_bldr(sql) except Exception as e: print('s0 insertion',str(e)) def sql_insert_no_parent(commentid,parentid,comment,subreddit,time,score): try: sql = """INSERT INTO parent_reply (parent_id, comment_id, comment, subreddit, unix, score) VALUES ("{}","{}","{}","{}",{},{});""".format(parentid, commentid, comment, subreddit, int(time), score) transaction_bldr(sql) except Exception as e: print('s0 insertion',str(e)) def acceptable(data): if len(data.split(' ')) > 50 or len(data) < 1: return False elif len(data) > 1000: return False elif data == '[deleted]': return False elif data == '[removed]': return False else: return True def find_parent(pid): try: sql = "SELECT comment FROM parent_reply WHERE comment_id = '{}' LIMIT 1".format(pid) c.execute(sql) result = c.fetchone() if result !=None: return result[0] else: return False except Exception as e: #print(str(e)) return false def find_existing_score(pid): try: sql = "SELECT score FROM parent_reply WHERE parent_id = '{}' LIMIT 1".format(pid) c.execute(sql) result = c.fetchone() if result != None: return result[0] else: return False except Exception as e: #print(str(e)) return False if __name__ == '__main__': create_table() row_counter = 0 paired_rows = 0 ########################## with bz2.open("C:/RC_{}".format(timeframe.split('-')[0],timeframe), buffering=1000) as f: for row in f: row_counter += 1 parent_id = row['parent_id'] body = format_data(row['body']) created_utc = row['created_utc'] score = row['score'] comment_id = row['name'] subreddit = row['subreddit'] parent_data = find_parent(parent_id) if score >=2: existing_comment_score = find_existing_score(parent_id) if existing_comment_score: if score > existing_comment_score: if acceptable(body): sql_insert_replace_comment(comment_id,parent_id,parent_data,body,subreddit,created_utc,score) else: if acceptable(body): if parent_data: sql_insert_has_parent(comment_id,parent_id,parent_data,body,subreddit,created_utc,score) paired_rows += 1 else: sql_insert_no_parent(comment_id,parent_id,body,subreddit,created_utc,score) if row_counter % 100000 == 0: print('Total Rows Read: {}, Paired Rows: {}, Time: {}'.format(row_counter, paired_rows, str(datetime.now())))
{ "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/4412/reactions" }
https://api.github.com/repos/psf/requests/issues/4412/timeline
null
completed
null
null
false
[ "This seems to have nothing to do with Requests. If you want help with your code, please open a question on StackOverflow." ]
https://api.github.com/repos/psf/requests/issues/4411
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4411/labels{/name}
https://api.github.com/repos/psf/requests/issues/4411/comments
https://api.github.com/repos/psf/requests/issues/4411/events
https://github.com/psf/requests/issues/4411
277,828,012
MDU6SXNzdWUyNzc4MjgwMTI=
4,411
PATCH request with form-data file has wrong content-length
{ "avatar_url": "https://avatars.githubusercontent.com/u/19964270?v=4", "events_url": "https://api.github.com/users/adam-j-turner/events{/privacy}", "followers_url": "https://api.github.com/users/adam-j-turner/followers", "following_url": "https://api.github.com/users/adam-j-turner/following{/other_user}", "gists_url": "https://api.github.com/users/adam-j-turner/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/adam-j-turner", "id": 19964270, "login": "adam-j-turner", "node_id": "MDQ6VXNlcjE5OTY0Mjcw", "organizations_url": "https://api.github.com/users/adam-j-turner/orgs", "received_events_url": "https://api.github.com/users/adam-j-turner/received_events", "repos_url": "https://api.github.com/users/adam-j-turner/repos", "site_admin": false, "starred_url": "https://api.github.com/users/adam-j-turner/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/adam-j-turner/subscriptions", "type": "User", "url": "https://api.github.com/users/adam-j-turner", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-29T16:50:44Z
2021-09-08T05:00:49Z
2017-11-29T17:34:11Z
NONE
resolved
I have a script that submits either a POST or PATCH request with a particular binary file. It fails when using PATCH but is successful using POST. Testing with Postman gives expected results. ## Expected Result Post & Patch with same content-length ## Actual Result Patch method has much smaller content-length (not sure if being calculated wrong or if the body is malformed) ## Reproduction Steps ```python import requests testFile = open('testfile.png', 'rb') postResp = requests.post( "https://httpbin.org/post", files = {'file': testFile} ) patchResp = requests.patch( "https://httpbin.org/patch", files = {'file': testFile} ) print("Post content length:" + postResp.headers['content-length']) print("Patch content length:" + patchResp.headers['content-length']) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "7", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "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/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/4411/reactions" }
https://api.github.com/repos/psf/requests/issues/4411/timeline
null
completed
null
null
false
[ "Requests consumes the file on the first request which means that the file object is at the end of the file and there's nothing for us to send in the second request. You either need to reopen it or `seek(0, 0)`. Cheers!" ]
https://api.github.com/repos/psf/requests/issues/4410
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4410/labels{/name}
https://api.github.com/repos/psf/requests/issues/4410/comments
https://api.github.com/repos/psf/requests/issues/4410/events
https://github.com/psf/requests/pull/4410
277,768,680
MDExOlB1bGxSZXF1ZXN0MTU1MzUwMzI3
4,410
Add SHA-256 and SHA-512 digest auth algorithms
{ "avatar_url": "https://avatars.githubusercontent.com/u/438131?v=4", "events_url": "https://api.github.com/users/linuxlizard/events{/privacy}", "followers_url": "https://api.github.com/users/linuxlizard/followers", "following_url": "https://api.github.com/users/linuxlizard/following{/other_user}", "gists_url": "https://api.github.com/users/linuxlizard/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/linuxlizard", "id": 438131, "login": "linuxlizard", "node_id": "MDQ6VXNlcjQzODEzMQ==", "organizations_url": "https://api.github.com/users/linuxlizard/orgs", "received_events_url": "https://api.github.com/users/linuxlizard/received_events", "repos_url": "https://api.github.com/users/linuxlizard/repos", "site_admin": false, "starred_url": "https://api.github.com/users/linuxlizard/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/linuxlizard/subscriptions", "type": "User", "url": "https://api.github.com/users/linuxlizard", "user_view_type": "public" }
[]
closed
true
null
[]
null
15
2017-11-29T14:12:38Z
2021-09-03T00:10:58Z
2018-05-16T14:06:58Z
CONTRIBUTOR
resolved
Added SHA-256 and SHA-512 auth algorithms to requests/auth.py Added test code to test_requests.py Requires SHA-256 and SHA-512 in the httpbin test framework.
{ "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/4410/reactions" }
https://api.github.com/repos/psf/requests/issues/4410/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4410.diff", "html_url": "https://github.com/psf/requests/pull/4410", "merged_at": "2018-05-16T14:06:58Z", "patch_url": "https://github.com/psf/requests/pull/4410.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4410" }
true
[ "Seems like the digest stuff is 404ing: mind taking a look?", "Can do.\r\n\r\nDoes need the most recent httpbin with SHA-256 and SHA-512 support.", "@Lukasa @linuxlizard, the changes were merged in httpbin but I don't believe we cut a release. I think that may be a prerequisite for pytest-httpbin working here.\r\n\r\nI pinged Ian but didn't get a response and wasn't sure what SOP was for httpbin releases/deployments.", "Should I move my testing to tests/test_lowlevel.py ? Would be more of a learning curve for me, take a bit longer.", "@linuxlizard, I don't believe there's any reason we need to move down to low level tests here. We just need to get your changes from httpbin into pytest-httpbin.", "@sigmavirus24, do we have enough in httpbin to warrant a release so we can get these tests working?", "Has there been any movement on this? It's a pretty simple fix but it's killing our router testing. Thanks!", "@linuxlizard I believe we’re still waiting on an httpbin release for the tests to be able to run. @sigmavirus24 is there anything we’re waiting on to cut 0.6.3?", "@nateprewitt I think there's a new httpbin release that's been out for ~1 week.", "@sigmavirus24 yep, this looks fixed. I think the blocker is just appveyor now.", "Those are some truly bizarre test failures, but I wonder if they'd be solved by rebasing.", "They occur at the tip of master too but aren’t consistent failures. I tried to debug last night without success. I’ll take another look on the plane.", "Going to close and re-open this to trigger a new merged build with master", "# [Codecov](https://codecov.io/gh/requests/requests/pull/4410?src=pr&el=h1) Report\n> Merging [#4410](https://codecov.io/gh/requests/requests/pull/4410?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/80e2637a8396c930b8e985e933738136e9ee9c35?src=pr&el=desc) will **increase** coverage by `0.32%`.\n> The diff coverage is `100%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4410/graphs/tree.svg?token=mZGswIiXLa&src=pr&height=150&width=650)](https://codecov.io/gh/requests/requests/pull/4410?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4410 +/- ##\n==========================================\n+ Coverage 66.21% 66.53% +0.32% \n==========================================\n Files 15 15 \n Lines 1548 1560 +12 \n==========================================\n+ Hits 1025 1038 +13 \n+ Misses 523 522 -1\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4410?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/auth.py](https://codecov.io/gh/requests/requests/pull/4410/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYXV0aC5weQ==) | `68.96% <100%> (+2.91%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4410?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4410?src=pr&el=footer). Last update [80e2637...371ee7c](https://codecov.io/gh/requests/requests/pull/4410?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Thanks again @linuxlizard!" ]
https://api.github.com/repos/psf/requests/issues/4409
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4409/labels{/name}
https://api.github.com/repos/psf/requests/issues/4409/comments
https://api.github.com/repos/psf/requests/issues/4409/events
https://github.com/psf/requests/pull/4409
277,633,711
MDExOlB1bGxSZXF1ZXN0MTU1MjUyMzY3
4,409
Use single default ssl_context in HTTPAdapter connection pool manager
{ "avatar_url": "https://avatars.githubusercontent.com/u/34075110?v=4", "events_url": "https://api.github.com/users/jmcackles/events{/privacy}", "followers_url": "https://api.github.com/users/jmcackles/followers", "following_url": "https://api.github.com/users/jmcackles/following{/other_user}", "gists_url": "https://api.github.com/users/jmcackles/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jmcackles", "id": 34075110, "login": "jmcackles", "node_id": "MDQ6VXNlcjM0MDc1MTEw", "organizations_url": "https://api.github.com/users/jmcackles/orgs", "received_events_url": "https://api.github.com/users/jmcackles/received_events", "repos_url": "https://api.github.com/users/jmcackles/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jmcackles/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmcackles/subscriptions", "type": "User", "url": "https://api.github.com/users/jmcackles", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2017-11-29T05:24:49Z
2021-09-04T00:06:37Z
2017-12-10T21:07:08Z
NONE
resolved
Creates default SSLContext object for each HTTPAdapter that is expected to be used for https requests. There are just a few small changes for: - Adding a default SSLContext object only to the https HTTPAdapter in each session (not the http one) - Creating the default object using the same urllib3 function that would be used to create a default SSLContext for each connection - Adding ssl_context to poolmanager's connection_pool_kw to get passed down to all connections - Pickling HTTPAdapter with the new attribute - Breaking up the HTTPAdapter's send method a little (this is not related, I was just there anyway. I'm happy to undo that if it's not wanted. There are separate functions for getting the timeout and sending chunked now.) Any feedback is welcome! This is for https://github.com/requests/requests/issues/4322
{ "avatar_url": "https://avatars.githubusercontent.com/u/34075110?v=4", "events_url": "https://api.github.com/users/jmcackles/events{/privacy}", "followers_url": "https://api.github.com/users/jmcackles/followers", "following_url": "https://api.github.com/users/jmcackles/following{/other_user}", "gists_url": "https://api.github.com/users/jmcackles/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jmcackles", "id": 34075110, "login": "jmcackles", "node_id": "MDQ6VXNlcjM0MDc1MTEw", "organizations_url": "https://api.github.com/users/jmcackles/orgs", "received_events_url": "https://api.github.com/users/jmcackles/received_events", "repos_url": "https://api.github.com/users/jmcackles/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jmcackles/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmcackles/subscriptions", "type": "User", "url": "https://api.github.com/users/jmcackles", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4409/reactions" }
https://api.github.com/repos/psf/requests/issues/4409/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4409.diff", "html_url": "https://github.com/psf/requests/pull/4409", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4409.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4409" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4409?src=pr&el=h1) Report\n> Merging [#4409](https://codecov.io/gh/requests/requests/pull/4409?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/24092b11d74af0a766d9cc616622f38adb0044b9?src=pr&el=desc) will **increase** coverage by `0.06%`.\n> The diff coverage is `92.15%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4409/graphs/tree.svg?height=150&src=pr&token=mZGswIiXLa&width=650)](https://codecov.io/gh/requests/requests/pull/4409?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4409 +/- ##\n==========================================\n+ Coverage 89% 89.07% +0.06% \n==========================================\n Files 18 18 \n Lines 2065 2077 +12 \n==========================================\n+ Hits 1838 1850 +12 \n Misses 227 227\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4409?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4409?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `95.55% <100%> (ø)` | :arrow_up: |\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4409?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `93.47% <92%> (+0.35%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4409?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4409?src=pr&el=footer). Last update [24092b1...0614a3a](https://codecov.io/gh/requests/requests/pull/4409?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "It’d be great to separate out the unrelated refactoring and supply it in a separate patch, please. \r\n\r\nA single SSLContext per adapter is not right, I’m afraid. An adapter can and will run across many different requests with different TLS settings. To get this to work properly you will need to transfer all TLS settings from Requests onto the adapter. You will also need to make this patch against the 3.0 branch, as it will break backwards compat. ", "Thank you for the fast response! I apologize for not looking at this close enough-- I can close this PR and make a new one against update-3.0 (?).\r\n\r\nI think if I'm understanding right, it should still be OK to have one SSLContext per adapter, but make sure if 'verify' or 'cert' arguments are truthy for the 'cert_verify' method, I set conn.ssl_context = None there to avoid modifying the adapter's SSLContext. Does that seem pretty reasonable, or do you mind pointing me where I should be looking for any other TLS settings? (Sorry to bug, I appreciate the time to answer).", "I think if the goal is to have the minimal number of contexts, we need to key off the various bits of TLS configuration and create the contexts lazily." ]
https://api.github.com/repos/psf/requests/issues/4408
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4408/labels{/name}
https://api.github.com/repos/psf/requests/issues/4408/comments
https://api.github.com/repos/psf/requests/issues/4408/events
https://github.com/psf/requests/issues/4408
277,624,952
MDU6SXNzdWUyNzc2MjQ5NTI=
4,408
GeocoderServiceError: [Errno 65] No route to host
{ "avatar_url": "https://avatars.githubusercontent.com/u/31523022?v=4", "events_url": "https://api.github.com/users/peaponte/events{/privacy}", "followers_url": "https://api.github.com/users/peaponte/followers", "following_url": "https://api.github.com/users/peaponte/following{/other_user}", "gists_url": "https://api.github.com/users/peaponte/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/peaponte", "id": 31523022, "login": "peaponte", "node_id": "MDQ6VXNlcjMxNTIzMDIy", "organizations_url": "https://api.github.com/users/peaponte/orgs", "received_events_url": "https://api.github.com/users/peaponte/received_events", "repos_url": "https://api.github.com/users/peaponte/repos", "site_admin": false, "starred_url": "https://api.github.com/users/peaponte/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/peaponte/subscriptions", "type": "User", "url": "https://api.github.com/users/peaponte", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-29T04:21:29Z
2021-09-08T05:00:49Z
2017-11-29T17:35:14Z
NONE
resolved
Summary. I wanted to create a new column called coordinates that use nom.geocode using information from an already existing column. But whenever I execute df1["Coordinates"]=df1["Address"].apply(nom.geocode) I get the following error: --------------------------------------------------------------------------- OSError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in do_open(self, http_class, req, **http_conn_args) 1317 h.request(req.get_method(), req.selector, req.data, headers, -> 1318 encode_chunked=req.has_header('Transfer-encoding')) 1319 except OSError as err: # timeout error /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked) 1238 """Send a complete request to the server.""" -> 1239 self._send_request(method, url, body, headers, encode_chunked) 1240 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked) 1284 body = _encode(body, 'body') -> 1285 self.endheaders(body, encode_chunked=encode_chunked) 1286 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked) 1233 raise CannotSendHeader() -> 1234 self._send_output(message_body, encode_chunked=encode_chunked) 1235 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in _send_output(self, message_body, encode_chunked) 1025 del self._buffer[:] -> 1026 self.send(msg) 1027 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in send(self, data) 963 if self.auto_open: --> 964 self.connect() 965 else: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in connect(self) 1391 -> 1392 super().connect() 1393 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in connect(self) 935 self.sock = self._create_connection( --> 936 (self.host,self.port), self.timeout, self.source_address) 937 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py in create_connection(address, timeout, source_address) 721 if err is not None: --> 722 raise err 723 else: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py in create_connection(address, timeout, source_address) 712 sock.bind(source_address) --> 713 sock.connect(sa) 714 return sock OSError: [Errno 65] No route to host During handling of the above exception, another exception occurred: URLError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/geopy/geocoders/base.py in _call_geocoder(self, url, timeout, raw, requester, deserializer, **kwargs) 142 try: --> 143 page = requester(req, timeout=(timeout or self.timeout), **kwargs) 144 except Exception as error: # pylint: disable=W0703 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context) 222 opener = _opener --> 223 return opener.open(url, data, timeout) 224 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout) 525 --> 526 response = self._open(req, data) 527 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in _open(self, req, data) 543 result = self._call_chain(self.handle_open, protocol, protocol + --> 544 '_open', req) 545 if result: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args) 503 func = getattr(handler, meth_name) --> 504 result = func(*args) 505 if result is not None: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in https_open(self, req) 1360 return self.do_open(http.client.HTTPSConnection, req, -> 1361 context=self._context, check_hostname=self._check_hostname) 1362 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in do_open(self, http_class, req, **http_conn_args) 1319 except OSError as err: # timeout error -> 1320 raise URLError(err) 1321 r = h.getresponse() URLError: <urlopen error [Errno 65] No route to host> During handling of the above exception, another exception occurred: GeocoderServiceError Traceback (most recent call last) <ipython-input-57-f36dadc4f72c> in <module>() ----> 1 df1["Coordinates"]=df1["Address"].apply(nom.geocode) /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/series.py in apply(self, func, convert_dtype, args, **kwds) 2508 else: 2509 values = self.asobject -> 2510 mapped = lib.map_infer(values, f, convert=convert_dtype) 2511 2512 if len(mapped) and isinstance(mapped[0], Series): pandas/_libs/src/inference.pyx in pandas._libs.lib.map_infer() /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/geopy/geocoders/osm.py in geocode(self, query, exactly_one, timeout, addressdetails, language, geometry) 191 logger.debug("%s.geocode: %s", self.__class__.__name__, url) 192 return self._parse_json( --> 193 self._call_geocoder(url, timeout=timeout), exactly_one 194 ) 195 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/geopy/geocoders/base.py in _call_geocoder(self, url, timeout, raw, requester, deserializer, **kwargs) 169 if "timed out" in message: 170 raise GeocoderTimedOut('Service timed out') --> 171 raise GeocoderServiceError(message) 172 173 if hasattr(page, 'getcode'): GeocoderServiceError: [Errno 65] No route to host Im on a mac using python3
{ "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/4408/reactions" }
https://api.github.com/repos/psf/requests/issues/4408/timeline
null
completed
null
null
false
[ "This has nothing to do with the requests library. geocoders is using the standard library `urllib.request` module, not the `requests` module." ]
https://api.github.com/repos/psf/requests/issues/4407
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4407/labels{/name}
https://api.github.com/repos/psf/requests/issues/4407/comments
https://api.github.com/repos/psf/requests/issues/4407/events
https://github.com/psf/requests/issues/4407
277,615,304
MDU6SXNzdWUyNzc2MTUzMDQ=
4,407
If it possible to let requests stop (but don't raise Exception) when it get to the max redirection limit?
{ "avatar_url": "https://avatars.githubusercontent.com/u/24400940?v=4", "events_url": "https://api.github.com/users/Humbertzhang/events{/privacy}", "followers_url": "https://api.github.com/users/Humbertzhang/followers", "following_url": "https://api.github.com/users/Humbertzhang/following{/other_user}", "gists_url": "https://api.github.com/users/Humbertzhang/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Humbertzhang", "id": 24400940, "login": "Humbertzhang", "node_id": "MDQ6VXNlcjI0NDAwOTQw", "organizations_url": "https://api.github.com/users/Humbertzhang/orgs", "received_events_url": "https://api.github.com/users/Humbertzhang/received_events", "repos_url": "https://api.github.com/users/Humbertzhang/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Humbertzhang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Humbertzhang/subscriptions", "type": "User", "url": "https://api.github.com/users/Humbertzhang", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-29T03:14:06Z
2021-09-08T05:00:48Z
2017-11-29T17:38:57Z
NONE
resolved
When I use **requests**, I find that you can't let **requests** stop when redirected a fixed times. But I think someone(like me) will need headers or something else among those redirections. ## Expected Result If I set a flag to let requests.session stop when it comes to the max redirection limit, and then, It won't raise a **TooManyRedirects**, but will stop and let you could get the headers or anything in this request. ## Actual Result It will raise a **TooManyRedirects** Exception. ## Reproduction Steps It will work like that: ```python import requests session = reqeusts.Session() session.max_redirects = 3 session.stopflag = True # flag that will let redirects stop when it comes to max redirect time. r = session.get(will_redirect_many_times_url) # it will stop when redirect 3 times # And then I can get the infomation at this request. h = r.headers ``` Actually I modified my requests a little bit, I add that code: ```python if i == self.max_redirects: break ``` before: ```python if i >= self.max_redirects: raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects) ``` At `requests/session.py` at 113 lines and It will stop when comes to max redirect limit. ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "1.2.3" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.12" }, "platform": { "release": "4.4.0-98-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1000207f", "version": "0.15.1" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000207f" }, "urllib3": { "version": "1.22" }, "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/4407/reactions" }
https://api.github.com/repos/psf/requests/issues/4407/timeline
null
completed
null
null
false
[ "If you need the information from the most recent response you should do\r\n\r\n```py\r\ntry:\r\n r = session.get(...)\r\nexcept requests.exceptions.TooManyRedirects as exc:\r\n r = exc.response\r\n```\r\n\r\nbecause we include the most recent response on that exception. 🎉 \r\n\r\nWe're in a feature-freeze and we're only adding features that are absolutely necessary. This feature can be achieved in the above manner as well as a few other ways, so this feature really isn't necessary or entirely desirable to the 95% of our users." ]
https://api.github.com/repos/psf/requests/issues/4406
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4406/labels{/name}
https://api.github.com/repos/psf/requests/issues/4406/comments
https://api.github.com/repos/psf/requests/issues/4406/events
https://github.com/psf/requests/issues/4406
277,344,923
MDU6SXNzdWUyNzczNDQ5MjM=
4,406
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
{ "avatar_url": "https://avatars.githubusercontent.com/u/32579122?v=4", "events_url": "https://api.github.com/users/munaAchyuta/events{/privacy}", "followers_url": "https://api.github.com/users/munaAchyuta/followers", "following_url": "https://api.github.com/users/munaAchyuta/following{/other_user}", "gists_url": "https://api.github.com/users/munaAchyuta/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/munaAchyuta", "id": 32579122, "login": "munaAchyuta", "node_id": "MDQ6VXNlcjMyNTc5MTIy", "organizations_url": "https://api.github.com/users/munaAchyuta/orgs", "received_events_url": "https://api.github.com/users/munaAchyuta/received_events", "repos_url": "https://api.github.com/users/munaAchyuta/repos", "site_admin": false, "starred_url": "https://api.github.com/users/munaAchyuta/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/munaAchyuta/subscriptions", "type": "User", "url": "https://api.github.com/users/munaAchyuta", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-11-28T11:09:23Z
2021-09-08T05:00:47Z
2017-11-28T12:54:20Z
NONE
resolved
i am facing `requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)` issue. i am using python > v2.7.13 , requests > v2.7.0. my service is started with https using bottle-paste. i have created certificates using openssl. for server-side i am using **.pem** and from client-side i am using **.pkcs12**. and my service using **OpenSSL** . i am using **sslcontext** to start service `SSL.Context(SSL.SSLv23_METHOD).` and as you guys know requests module using ssl. **same service can hit from java , postman** with using client certificates( .pkcs12 ). not sure why is it failing here ? can any one help me here ??
{ "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/4406/reactions" }
https://api.github.com/repos/psf/requests/issues/4406/timeline
null
completed
null
null
false
[ "Python's ssl module does not support PKCS12 files. You have to extract the PKCS12 and dump the key and cert to disk. You may also need to dump the CA and intermediate chain.\r\n\r\nSomething like this should do the trick. ``cert.pem`` contains key, cert and maybe chain.\r\n\r\n```\r\n$ openssl pkcs12 -in file.p12 -out client.pem -chain -nodes\r\n```", "Thanks for that @tiran. I think this should help you understand why your having trouble @munaAchyuta. Cheers!", "Thanks @tiran for your solution. Yes it solved my issue. Thanks for responding." ]
https://api.github.com/repos/psf/requests/issues/4405
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4405/labels{/name}
https://api.github.com/repos/psf/requests/issues/4405/comments
https://api.github.com/repos/psf/requests/issues/4405/events
https://github.com/psf/requests/issues/4405
277,308,397
MDU6SXNzdWUyNzczMDgzOTc=
4,405
bad handshake: SysCallError(-1, 'Unexpected EOF')
{ "avatar_url": "https://avatars.githubusercontent.com/u/13550005?v=4", "events_url": "https://api.github.com/users/datar-ai/events{/privacy}", "followers_url": "https://api.github.com/users/datar-ai/followers", "following_url": "https://api.github.com/users/datar-ai/following{/other_user}", "gists_url": "https://api.github.com/users/datar-ai/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/datar-ai", "id": 13550005, "login": "datar-ai", "node_id": "MDQ6VXNlcjEzNTUwMDA1", "organizations_url": "https://api.github.com/users/datar-ai/orgs", "received_events_url": "https://api.github.com/users/datar-ai/received_events", "repos_url": "https://api.github.com/users/datar-ai/repos", "site_admin": false, "starred_url": "https://api.github.com/users/datar-ai/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/datar-ai/subscriptions", "type": "User", "url": "https://api.github.com/users/datar-ai", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2017-11-28T09:12:30Z
2021-09-08T05:00:51Z
2017-11-28T12:40:06Z
NONE
resolved
Summary. I try requests in site [https://www.digitimes.com.tw](https://www.digitimes.com.tw), but it failed. I had tried the other similar recommendations but not works solution. Please advise, thanks. The site SSL Server Test Report [(here)](https://www.ssllabs.com/ssltest/analyze.html?d=www.digitimes.com.tw) ## Expected Result Successful connect and get result expected. ## Actual Result ``` $ python test.py *** HTTPSConnectionPool(host='www.digitimes.com.tw', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) Traceback (most recent call last): File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 441, in wrap_socket cnx.do_handshake() File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1716, in do_handshake self._raise_ssl_error(self._ssl, result) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1449, in _raise_ssl_error raise SysCallError(-1, "Unexpected EOF") OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn conn.connect() File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/urllib3/connection.py", line 326, in connect ssl_context=context) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 448, in wrap_socket raise ssl.SSLError('bad handshake: %r' % e) ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/requests/adapters.py", line 440, in send timeout=timeout File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.digitimes.com.tw', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 51, in <module> r = requests.get("https://www.digitimes.com.tw") File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/Users/Roger/Virtualenv/BizMI/lib/python3.6/site-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='www.digitimes.com.tw', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))` ``` ## Reproduction Steps ```python import sys, traceback import ssl from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.ssl_ import create_urllib3_context from requests.packages.urllib3.poolmanager import PoolManager import requests # This is the 2.11 Requests cipher string, containing 3DES. 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 init_poolmanager(self, *args, **kwargs): context = create_urllib3_context(ciphers=CIPHERS) kwargs['ssl_context'] = context return super(DESAdapter, self).init_poolmanager(*args, **kwargs) def proxy_manager_for(self, *args, **kwargs): context = create_urllib3_context(ciphers=CIPHERS) kwargs['ssl_context'] = context return super(DESAdapter, self).proxy_manager_for(*args, **kwargs) class SSLAdapter(HTTPAdapter): '''An HTTPS Transport Adapter that uses an arbitrary SSL version.''' def __init__(self, ssl_version=None, **kwargs): self.ssl_version = ssl_version super(SSLAdapter, self).__init__(**kwargs) def init_poolmanager(self, connections, maxsize, block=False): self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize, block=block, ssl_version=self.ssl_version) # Main Function if __name__ == "__main__": try: s = requests.Session() s.mount("https://www.digitimes.com.tw", SSLAdapter(ssl_version=ssl.PROTOCOL_TLSv1)) r = requests.get("https://www.digitimes.com.tw") print(r.text) except Exception as e: print('*** ', e) traceback.print_exc(file=sys.stdout) sys.exit() ``` ## Openssl Test ``` $ openssl s_client -connect www.digitimes.com.tw:443 CONNECTED(00000003) 140735617835912:error:140790E5:SSL routines:ssl23_write:ssl handshake failure:s23_lib.c:177: --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 0 bytes and written 308 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : 0000 Session-ID: Session-ID-ctx: Master-Key: Key-Arg : None PSK identity: None PSK identity hint: None SRP username: None Start Time: 1511860095 Timeout : 300 (sec) Verify return code: 0 (ok) --- ``` ``` $ openssl s_client -tls1 -connect www.digitimes.com.tw:443CONNECTED(00000003) depth=0 OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.digitimes.com.tw verify error:num=20:unable to get local issuer certificate verify return:1 depth=0 OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.digitimes.com.tw verify error:num=21:unable to verify the first certificate verify return:1 --- Certificate chain 0 s:/OU=Domain Control Validated/OU=PositiveSSL Wildcard/CN=*.digitimes.com.tw i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA --- Server certificate -----BEGIN CERTIFICATE----- MIIFXjCCBEagAwIBAgIRALqqTCTEbaUa69+U7geazxUwDQYJKoZIhvcNAQELBQAw gZAxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTYwNAYD VQQDEy1DT01PRE8gUlNBIERvbWFpbiBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ2ZXIg Q0EwHhcNMTcwNTA0MDAwMDAwWhcNMTgwNTAzMjM1OTU5WjBfMSEwHwYDVQQLExhE b21haW4gQ29udHJvbCBWYWxpZGF0ZWQxHTAbBgNVBAsTFFBvc2l0aXZlU1NMIFdp bGRjYXJkMRswGQYDVQQDDBIqLmRpZ2l0aW1lcy5jb20udHcwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQC203XaoQxrqSjAXjdob2uQ6msnnXfBNufNiofI v5fmzH7FcHCfW5ER7FSHv7bp5lAviNj4Lcg/UTkmR6MdBJDJF3xP2YpYNug5ZxGo MuucSwh0J8d1YrqIOvcDtU8S2hnXaISuNn+HTd5n8xPI/mjHPI10DJzASq4fwzg9 0IMKU72JpHLH6oquJLXkrgugF3ILIKQhEAUsMtHYmw13iSVCVnyRPfcnInBo9soY 7pfqaUhxJ4p9prCtRXOvYnT0feQvxchNsyxUnii9/E/Ut0/sQd8Pni5912/X9Tk3 rFb5F2lOdCnXnAqE+yOXm9Mgk4XRbMotZE5eyrH9onwg7OujAgMBAAGjggHhMIIB 3TAfBgNVHSMEGDAWgBSQr2o6lFoL2JDqElZz30O0Oija5zAdBgNVHQ4EFgQU5Edj aePc5bmyT6s9KXgDjAPqkkAwDgYDVR0PAQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAw HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCME8GA1UdIARIMEYwOgYLKwYB BAGyMQECAgcwKzApBggrBgEFBQcCARYdaHR0cHM6Ly9zZWN1cmUuY29tb2RvLmNv bS9DUFMwCAYGZ4EMAQIBMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly9jcmwuY29t b2RvY2EuY29tL0NPTU9ET1JTQURvbWFpblZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJD QS5jcmwwgYUGCCsGAQUFBwEBBHkwdzBPBggrBgEFBQcwAoZDaHR0cDovL2NydC5j b21vZG9jYS5jb20vQ09NT0RPUlNBRG9tYWluVmFsaWRhdGlvblNlY3VyZVNlcnZl ckNBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMC8G A1UdEQQoMCaCEiouZGlnaXRpbWVzLmNvbS50d4IQZGlnaXRpbWVzLmNvbS50dzAN BgkqhkiG9w0BAQsFAAOCAQEAKvWwwiUFq1ZiK0dBh8w0HqGZ+lcoyFavU3xlQw+Z uJjia6qzwT4jGfdexeM1lOAPPPZOS2/gc6fz6MXQJmLN0B2iMOHo65H2KJnvR+Uy X/WMgiM6IKnw83c71kqZyjotf6DGTNOvxmfU48Ewc+jaJkCm2dzqejF6kzBtQNXS U2Inf1okmhcfEV5DaN+CQh71NcBabtsDTY2QFo+iKoj/Gi+7NdA4Az53fFgf2dOp IfDMtz5n/fL5f0JExs0+WWu7zDeepCqHkRSco0EBpkEIr9B439+dQ9MaeRkAFFcz JVbSLGRttz/lbgoljcUmPNbd8tK3039gHKCSO38ZZihIew== -----END CERTIFICATE----- subject=/OU=Domain Control Validated/OU=PositiveSSL Wildcard/CN=*.digitimes.com.tw issuer=/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA --- No client certificate CA names sent --- SSL handshake has read 1521 bytes and written 510 bytes --- New, TLSv1/SSLv3, Cipher is RC4-MD5 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1 Cipher : RC4-MD5 Session-ID: BA240000CAEE7F2860C3B98B84171478DF72EC936376BB52FB109907363FFBE8 Session-ID-ctx: Master-Key: 7D183B074FCFB5B412D272C248A15BA725CFF5C651F656DBA17DE2D4ACBFF726938A5DB92850C918E08591017450D65E Key-Arg : None PSK identity: None PSK identity hint: None SRP username: None Start Time: 1511860297 Timeout : 7200 (sec) Verify return code: 21 (unable to verify the first certificate) --- ^C ``` ## System Information ``` $ python -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.1.3" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.1" }, "platform": { "release": "17.2.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "1010007f", "version": "17.4.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ``` Env: MacOS 10.13.1 Python 3.6.1 requests==2.18.4 urllib3==1.22 openssl version OpenSSL 1.0.2m 2 Nov 2017
{ "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/4405/reactions" }
https://api.github.com/repos/psf/requests/issues/4405/timeline
null
completed
null
null
false
[ "I've been struggling with this same problem for a month or more, in my case is a SOAP call, but it should be the same handshake.\r\n\r\nIf i solve this i'll come straight away to post my solution.\r\n\r\nGood luck!", "![screenshot from 2017-11-28 06-19-36](https://user-images.githubusercontent.com/240830/33319940-250328f0-d406-11e7-83d1-3cae5c683078.png)\r\n\r\nThe SSLLabs report that you provided is rather dire. The server seems to accept a lot of outdated and broken ciphers so part of the problem is likely in Requests' cipher suite being too strong. It also appears that it doesn't send its full certificate chain so even if you do resolve the handshake problem, you may not be able to verify the certificate without their full chain.\r\n\r\nFrom your second `openssl` connection I see two things:\r\n\r\n```\r\nverify error:num=21:unable to verify the first certificate\r\n```\r\n\r\nand\r\n\r\n```\r\nSSL-Session:\r\n Protocol : TLSv1\r\n Cipher : RC4-MD5\r\n```\r\n\r\nWhat this is telling me is that either the server is deliberately choosing `RC4-MD5` *or* that is the *strongest* cipher it can support. Further, your local certificate bundle doesn't contain the full certificate chain. So openssl cannot verify the whole chain for you.\r\n\r\nIn short, this website has a *terrible* SSL stance and Requests is guilty only of using known good ciphers and doing its best to secure the connection.\r\n\r\nIf you want help using outdated and insecure SSL settings, I suggest you post a question on StackOverflow which is the official Q&A forum for the Requests project." ]
https://api.github.com/repos/psf/requests/issues/4404
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4404/labels{/name}
https://api.github.com/repos/psf/requests/issues/4404/comments
https://api.github.com/repos/psf/requests/issues/4404/events
https://github.com/psf/requests/pull/4404
277,297,592
MDExOlB1bGxSZXF1ZXN0MTU1MDA2NzM4
4,404
Empty file stream should be set to Content-Length:0
{ "avatar_url": "https://avatars.githubusercontent.com/u/19793192?v=4", "events_url": "https://api.github.com/users/dt3310321/events{/privacy}", "followers_url": "https://api.github.com/users/dt3310321/followers", "following_url": "https://api.github.com/users/dt3310321/following{/other_user}", "gists_url": "https://api.github.com/users/dt3310321/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dt3310321", "id": 19793192, "login": "dt3310321", "node_id": "MDQ6VXNlcjE5NzkzMTky", "organizations_url": "https://api.github.com/users/dt3310321/orgs", "received_events_url": "https://api.github.com/users/dt3310321/received_events", "repos_url": "https://api.github.com/users/dt3310321/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dt3310321/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dt3310321/subscriptions", "type": "User", "url": "https://api.github.com/users/dt3310321", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2017-11-28T08:30:51Z
2021-09-04T00:06:38Z
2017-11-29T21:18:55Z
NONE
resolved
I have trouble in uploading empty files to AWS S3 using requests, the point is that AWS S3 doesn't support Transfer-Encoding: chunked to upload files. Dealing with the file pointer(fp) which points to an empty file, requests set it to Transfer-Encoding: chunked. In fact, the length of empty file can be calculated by the function super_len() without raising exception, the length is zero, but requests treats it same with None(caused by exceptions)! ```python try: length = super_len(data) except (TypeError, AttributeError, UnsupportedOperation): length = None ``` I touched an empty file named empty.txt, and the result is 'Transfer-Encoding': 'chunked' instead of 'Content-Length': '0'. In this situation, i think the result should be 'Content-Length': '0', since the length of the file can be calculated! ```python >>> import requests >>> fp = open('empty.txt', 'rb') >>> r = requests.put('http://httpbin.org/put', data=fp) >>> r.request.headers {'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'User-Agent': 'python-requests/2.18.4'} >>> fp.close() '''
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4404/reactions" }
https://api.github.com/repos/psf/requests/issues/4404/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4404.diff", "html_url": "https://github.com/psf/requests/pull/4404", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4404.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4404" }
true
[ "The travis have failed, the trouble is shown in the snip code in super_len(), requests treate None(length can't be determined automatically) to zero. So, how can i get the header set to Content-Length:0, when the file is empty, but the total_length can be calculated out, the total_length is absolutely determined 0!\r\n\r\nDo you agree that return None to distinguish between None and zero!\r\n```\r\nif total_length is None:\r\n total_length = 0\r\n #return None\r\n```", "Sorry, this behaviour is intentional. Some file like objects return a length of zero but do, in fact, contain data. For example, Unix named pipes. That is why this behaviour was introduced. Any fix will need to continue to support that use-case. " ]
https://api.github.com/repos/psf/requests/issues/4403
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4403/labels{/name}
https://api.github.com/repos/psf/requests/issues/4403/comments
https://api.github.com/repos/psf/requests/issues/4403/events
https://github.com/psf/requests/issues/4403
277,250,100
MDU6SXNzdWUyNzcyNTAxMDA=
4,403
requests.get() always pumps out errors in my Spyder3.2.4
{ "avatar_url": "https://avatars.githubusercontent.com/u/9277924?v=4", "events_url": "https://api.github.com/users/gfkdcadet/events{/privacy}", "followers_url": "https://api.github.com/users/gfkdcadet/followers", "following_url": "https://api.github.com/users/gfkdcadet/following{/other_user}", "gists_url": "https://api.github.com/users/gfkdcadet/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gfkdcadet", "id": 9277924, "login": "gfkdcadet", "node_id": "MDQ6VXNlcjkyNzc5MjQ=", "organizations_url": "https://api.github.com/users/gfkdcadet/orgs", "received_events_url": "https://api.github.com/users/gfkdcadet/received_events", "repos_url": "https://api.github.com/users/gfkdcadet/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gfkdcadet/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gfkdcadet/subscriptions", "type": "User", "url": "https://api.github.com/users/gfkdcadet", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-11-28T03:53:37Z
2021-09-08T05:00:45Z
2017-11-28T04:00:52Z
NONE
resolved
Summary. I was trying to get data from a website by using requests module in my spyder3.2.4. I used requests.get() to realize the goal. It worked well. But, recentely, when I used requests.get(), spyder would pump out errors. Really confusing. What you expected. ## import requests r = requests.get(url) r.status_code 200 What happened instead. **AttributeError: module 'requests' has no attribute 'get'** ```python import requests ``` ## System Information $ python -m requests.help ``` <paste here> ``` 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/4403/reactions" }
https://api.github.com/repos/psf/requests/issues/4403/timeline
null
completed
null
null
false
[ "I have a screenshot of the problem. But I cannot upload it..... When I tried, it always told me that something went really wrong, and it cannnot process that file! \r\npity....\r\nhelp me..... The problem is abusing me .....", "@gfkdcadet, this is almost certainly an issue with you having a file name \"requests.py\" in your project that is causing namespace conflicts.\r\n\r\nIf not, please either open an issue on Stackoverflow or you can email me at the email in my profile. I'm going to close this out since it's not a defect with Requests.", "Sorry for my ignorance. Yes, as u said, it is the problem of the inproper file name \"requests.py\", which caused namespace conflicts.@nateprewitt" ]
https://api.github.com/repos/psf/requests/issues/4402
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4402/labels{/name}
https://api.github.com/repos/psf/requests/issues/4402/comments
https://api.github.com/repos/psf/requests/issues/4402/events
https://github.com/psf/requests/issues/4402
277,117,957
MDU6SXNzdWUyNzcxMTc5NTc=
4,402
Connection timeout doesn't work for chunk-encoded requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/3468064?v=4", "events_url": "https://api.github.com/users/isobit/events{/privacy}", "followers_url": "https://api.github.com/users/isobit/followers", "following_url": "https://api.github.com/users/isobit/following{/other_user}", "gists_url": "https://api.github.com/users/isobit/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/isobit", "id": 3468064, "login": "isobit", "node_id": "MDQ6VXNlcjM0NjgwNjQ=", "organizations_url": "https://api.github.com/users/isobit/orgs", "received_events_url": "https://api.github.com/users/isobit/received_events", "repos_url": "https://api.github.com/users/isobit/repos", "site_admin": false, "starred_url": "https://api.github.com/users/isobit/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/isobit/subscriptions", "type": "User", "url": "https://api.github.com/users/isobit", "user_view_type": "public" }
[]
closed
false
null
[]
null
4
2017-11-27T18:19:03Z
2024-05-19T19:00:10Z
2024-05-19T19:00:10Z
NONE
null
Original issue was #1422, but I was able to reproduce in 2.18.4. ## Expected Result Chunk-encoded requests timeout after the specified timeout if the server does not respond. ## Actual Result Request holds connection open and never times out. ## Reproduction Steps First, run a test server that accepts POST requests and waits 10 seconds before responding: ```python from http.server import BaseHTTPRequestHandler, HTTPServer import time class Handler(BaseHTTPRequestHandler): def do_POST(self): time.sleep(10) self.send_response(200) self.end_headers() if __name__ == '__main__': httpd = HTTPServer(('', 8000), Handler) print('Listening on :8000') httpd.serve_forever() ``` Then, in another REPL, verify timeout works for non-chunk-encoded requests: ```python import requests requests.post('http://localhost:8000', timeout=2.0, data='hello'.encode('utf-8')) ```` A timeout exception should be thrown. Then, verify timeout does not work for chunk-encoded requests: ```python def gen(): yield 'hello'.encode('utf-8') requests.post('http://localhost:8000', timeout=2.0, data=gen()) ``` A `<Response [200]>` will be returned, indicating that the timeout did not work properly (a timeout exception _should_ have been thrown instead). ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "4.4.0-43-Microsoft", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000207f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ``` ## Workaround Insert the following on [line 454 of requests/adapters.py](https://github.com/requests/requests/blob/master/requests/adapters.py#L454): ```python low_conn.timeout = timeout.connect_timeout ```
{ "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": 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/4402/reactions" }
https://api.github.com/repos/psf/requests/issues/4402/timeline
null
completed
null
null
false
[ "This would be resolved by moving to use urllib3's chunked encoding logic as well. I concur with @sigmavirus24's notes on another issue: if we can get some socket-level tests of our chunked handling, we can move to using urllib3's logic to resolve this issue.", "In the consequence of that bug, when using with sessions, the chunked request have a timeout from the http request previously executed on that connection (!) if any... I've spent some time to explain why sometimes timeout happened and sometimes not.", "@ddzialak comment is important: it's a nasty issue to debug.\r\n\r\nI assume this is fixed by #5128, merged but not released yet.\r\n@nateprewitt when can we expect a new maintenance release?\r\n", "Requests is now using urllib3's chunking API" ]
https://api.github.com/repos/psf/requests/issues/4401
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4401/labels{/name}
https://api.github.com/repos/psf/requests/issues/4401/comments
https://api.github.com/repos/psf/requests/issues/4401/events
https://github.com/psf/requests/issues/4401
276,971,584
MDU6SXNzdWUyNzY5NzE1ODQ=
4,401
Find cause of status code 0
{ "avatar_url": "https://avatars.githubusercontent.com/u/1812267?v=4", "events_url": "https://api.github.com/users/grillorafael/events{/privacy}", "followers_url": "https://api.github.com/users/grillorafael/followers", "following_url": "https://api.github.com/users/grillorafael/following{/other_user}", "gists_url": "https://api.github.com/users/grillorafael/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/grillorafael", "id": 1812267, "login": "grillorafael", "node_id": "MDQ6VXNlcjE4MTIyNjc=", "organizations_url": "https://api.github.com/users/grillorafael/orgs", "received_events_url": "https://api.github.com/users/grillorafael/received_events", "repos_url": "https://api.github.com/users/grillorafael/repos", "site_admin": false, "starred_url": "https://api.github.com/users/grillorafael/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/grillorafael/subscriptions", "type": "User", "url": "https://api.github.com/users/grillorafael", "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": "f7c6c7", "default": false, "description": null, "id": 167537670, "name": "Propose Close", "node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=", "url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close" }, { "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
6
2017-11-27T10:39:30Z
2021-09-08T05:00:52Z
2017-11-27T21:52:45Z
NONE
resolved
Hi All, I'm trying to debug why sometimes my requests fail (Doing some perf test through `locust.io`) but I can't find the cause. My nginx logs have no error attached and what I see is requests giving status code 0. I thought it could be timeout but I timed the request and I see <1sec. Is there a way for me to find out why I'm getting this behavior? I'm basically getting `status_code==0` but I can't find a reason to that. I'm using python 2.7 and locust to run the perf test
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4401/reactions" }
https://api.github.com/repos/psf/requests/issues/4401/timeline
null
completed
null
null
false
[ "I believe we pull the status code [here](https://github.com/requests/requests/blob/d1fb1a29ab949223d8d64797e0fcc9a7d2690483/requests/adapters.py#L267) which means fundamentally this is a urllib3 bug. Requests defaults the status code to `None` but has specific handling for [this case](https://github.com/requests/requests/blob/d1fb1a29ab949223d8d64797e0fcc9a7d2690483/requests/models.py#L820). That aside, is this a non-exceptional case? I've never seen a status code of 0 for a non-exceptional case.", "I see. And do you know any way for me to debug the reason why urllib3 is failing to do something?", "Looking at `response.raw` would be a good place to start. You didn't really answer my question though: Is the response object you're receiving coming from an exception that's been handled?", "I believe so.\r\n\r\nThis is the line:\r\nhttps://github.com/locustio/locust/blob/a4c377efc7914e8d90701d9226a5cd843859b790/locust/clients.py#L161", "Did you notice https://github.com/locustio/locust/blob/a4c377efc7914e8d90701d9226a5cd843859b790/locust/clients.py#L164 ?", "Closing as a downstream bug." ]
https://api.github.com/repos/psf/requests/issues/4400
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4400/labels{/name}
https://api.github.com/repos/psf/requests/issues/4400/comments
https://api.github.com/repos/psf/requests/issues/4400/events
https://github.com/psf/requests/issues/4400
276,888,106
MDU6SXNzdWUyNzY4ODgxMDY=
4,400
IndexError when handle http response
{ "avatar_url": "https://avatars.githubusercontent.com/u/7598892?v=4", "events_url": "https://api.github.com/users/beruhan/events{/privacy}", "followers_url": "https://api.github.com/users/beruhan/followers", "following_url": "https://api.github.com/users/beruhan/following{/other_user}", "gists_url": "https://api.github.com/users/beruhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/beruhan", "id": 7598892, "login": "beruhan", "node_id": "MDQ6VXNlcjc1OTg4OTI=", "organizations_url": "https://api.github.com/users/beruhan/orgs", "received_events_url": "https://api.github.com/users/beruhan/received_events", "repos_url": "https://api.github.com/users/beruhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/beruhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/beruhan/subscriptions", "type": "User", "url": "https://api.github.com/users/beruhan", "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
7
2017-11-27T03:06:41Z
2021-09-08T05:00:52Z
2017-11-27T21:51:47Z
NONE
resolved
I receive a http response like this, ``` HTTP/1.1 200 OK Content-Type: application/octet-stream Content-Length: 89606 Content-Disposition: attachment; filename="MB-500Ap_2009-01-12.cfg" Connection: close Brickcom-50xA OperationSetting.locale=auto HostName.name=cam ModuleInfo.DIDO_module=1 ModuleInfo.PIR_module=0 ModuleInfo.WLED=0 SensorFPSSetting.fps=0 ModuleInfo.AUTOIRIS_module=0 ModuleInfo.IRCUT_module=0 ModuleInfo.IRLED_module=0 ModuleInfo.lightsensor=0 ModuleInfo.EXPOSURE_module=0 ModuleInfo.MDNS_module=0 ModuleInfo.PTZ_module=1 ModuleInfo.MSN_module=0 ModuleInfo.WIFI_module=0 ModuleInfo.watchDog_module=0 ModuleInfo.sdcard_module=1 ModuleInfo.usbstorage_module=0 ModuleInfo.sambamount_module=0 ModuleInfo.QoS=0 ModuleInfo.shutter_speed=0 ModuleInfo.discovery_internet=1 ModuleInfo.POE_module= ModuleInfo.audio_record=1 ``` it throws exceptions.IndexError, but I use chrome visit the same url,It has not error
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4400/reactions" }
https://api.github.com/repos/psf/requests/issues/4400/timeline
null
completed
null
null
false
[ "Please provide the traceback for the IndexError you receive or a URL that we can use to reproduce this.", "We also need the output from `python -m requests.help` or failing that `python -c 'import requests; print(requests.__version__)'`", "`python -m requests.help` output is\r\n `{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"2.1.1\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"2.7.14\"\r\n },\r\n \"platform\": {\r\n \"release\": \"10\",\r\n \"system\": \"Windows\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010006f\",\r\n \"version\": \"17.3.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"100020bf\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n },\r\n \"using_pyopenssl\": true\r\n}`\r\ntraceback output is:\r\n```File \"C:\\Python27\\lib\\site-packages\\requests\\api.py\", line 72, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"C:\\Python27\\lib\\site-packages\\requests\\adapters.py\", line 440, in send\r\n timeout=timeout\r\n File \"C:\\Python27\\lib\\site-packages\\urllib3\\connectionpool.py\", line 617, in urlopen\r\n **response_kw)\r\n File \"C:\\Python27\\lib\\site-packages\\urllib3\\response.py\", line 456, in from_httplib\r\n headers = HTTPHeaderDict.from_httplib(headers)\r\n File \"C:\\Python27\\lib\\site-packages\\urllib3\\_collections.py\", line 312, in from_httplib\r\n```\r\n I can provide a test url, http://193.92.77.225/configfile.dump,username and password is admin,basic auth.thanks a lot!", "That's not a complete traceback. I don't see the IndexError in that output ", "I was able to reproduce this. It's a bug in how urllib3 handles headers that start with `' '` or `'\\t'` (which these headers do.", "All of the headers in this response start with `'\\t'` and so https://github.com/shazow/urllib3/blob/ead61e0fd4f386339d78baf766f9188832ddead3/urllib3/_collections.py#L312 fails because `headers` is `[]` and `headers[-1]` generates an IndexError. It's unclear to me what was being handled by that in https://github.com/shazow/urllib3/commit/ed15c4ab9d64e280ea38b5be24c61a0ae3dfbe81", "The headers in this response *may not* start with `\\t`. `\\t` is reserved explicitly for continuation lines, which these are not. This is simply a malformed HTTP response, and it's not really reasonable to try to parse it correctly." ]
https://api.github.com/repos/psf/requests/issues/4399
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4399/labels{/name}
https://api.github.com/repos/psf/requests/issues/4399/comments
https://api.github.com/repos/psf/requests/issues/4399/events
https://github.com/psf/requests/issues/4399
276,871,849
MDU6SXNzdWUyNzY4NzE4NDk=
4,399
pandas.read_html(url)
{ "avatar_url": "https://avatars.githubusercontent.com/u/33677455?v=4", "events_url": "https://api.github.com/users/zhongyutech/events{/privacy}", "followers_url": "https://api.github.com/users/zhongyutech/followers", "following_url": "https://api.github.com/users/zhongyutech/following{/other_user}", "gists_url": "https://api.github.com/users/zhongyutech/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhongyutech", "id": 33677455, "login": "zhongyutech", "node_id": "MDQ6VXNlcjMzNjc3NDU1", "organizations_url": "https://api.github.com/users/zhongyutech/orgs", "received_events_url": "https://api.github.com/users/zhongyutech/received_events", "repos_url": "https://api.github.com/users/zhongyutech/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhongyutech/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhongyutech/subscriptions", "type": "User", "url": "https://api.github.com/users/zhongyutech", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-27T00:33:54Z
2021-09-08T05:00:53Z
2017-11-27T00:37:24Z
NONE
resolved
Summary. ## Expected Result import pandas as pd for i in range(1,10): url="https://myip.ms/browse/sites/{0}/ipID/23.227.38.0/ipIDii/23.227.38.255/sort/2/asc/1/".format(i) dfs=pd.read_html(url) data=dfs[13] select_index=data.index[data.index%2==0] jg=data.iloc[select_index,:7] jg.to_excel("d:\{}.xls".format(i)) ## Actual Result don't need one by one,get all! What a wonder! I hope you can try
{ "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/4399/reactions" }
https://api.github.com/repos/psf/requests/issues/4399/timeline
null
completed
null
null
false
[ "I believe you've filed this against the wrong project. I don't see anything related to this project." ]
https://api.github.com/repos/psf/requests/issues/4398
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4398/labels{/name}
https://api.github.com/repos/psf/requests/issues/4398/comments
https://api.github.com/repos/psf/requests/issues/4398/events
https://github.com/psf/requests/issues/4398
276,847,495
MDU6SXNzdWUyNzY4NDc0OTU=
4,398
Could we set the request json's dump charset?
{ "avatar_url": "https://avatars.githubusercontent.com/u/5487535?v=4", "events_url": "https://api.github.com/users/hsiunien/events{/privacy}", "followers_url": "https://api.github.com/users/hsiunien/followers", "following_url": "https://api.github.com/users/hsiunien/following{/other_user}", "gists_url": "https://api.github.com/users/hsiunien/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hsiunien", "id": 5487535, "login": "hsiunien", "node_id": "MDQ6VXNlcjU0ODc1MzU=", "organizations_url": "https://api.github.com/users/hsiunien/orgs", "received_events_url": "https://api.github.com/users/hsiunien/received_events", "repos_url": "https://api.github.com/users/hsiunien/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hsiunien/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hsiunien/subscriptions", "type": "User", "url": "https://api.github.com/users/hsiunien", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-11-26T19:01:21Z
2021-09-08T03:00:31Z
2017-11-26T23:48:24Z
NONE
resolved
As you know, I use the requests post some data to the server, my JSON data is ``` {'name':'张三'} ``` ## Expected Result origin json data,like {'name':'张三'} But I catch the package, it translated into ## Actual Result ``` {'name':'\u5f20\u4e09'} ``` But the server couldn't recognize it. ## Reproduction Steps ```python import requests request.post('http://example.com/xxx',json={'name':'张三'}) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.2" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020df" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ``` I trace the source code, I found requests call the json.dumps in models.py at about line 454, ```python if not data and json is not None: # urllib3 requires a bytes-like body. Python 2's json.dumps # provides this natively, but Python 3 gives a Unicode string. content_type = 'application/json' body = complexjson.dumps(json) if not isinstance(body, bytes): body = body.encode('utf-8') is_stream = all([ hasattr(data, '__iter__'), not isinstance(data, (basestring, list, tuple, collections.Mapping)) ]) ``` the dumps haven't any parameter, so how could I set the parameter ensure_ascii?
{ "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/4398/reactions" }
https://api.github.com/repos/psf/requests/issues/4398/timeline
null
completed
null
null
false
[ "You can call `json.dumps` yourself to get that effect. We don't provide anything other than the 98% use case. This is an advanced use-case and we expect that you can do this yourself (including setting the `Content-Type`).\r\n\r\nCheers,\r\nIan", "@sigmavirus24 Could you please reconsider that? I am sure non-ascii data usage is well beyond 2%.\r\n\r\nI could write a patch if you guys agree: i see 2 possible solutions adding a parameter `json_unicode` (where json dumps would be called with `ensure_ascii=False`, or an extra `json_ensure_ascii`. ", "@schettino72 quoting myself:\r\n\r\n> This is an advanced use-case and we expect that you can do this yourself (including setting the Content-Type).\r\n\r\nIn other words:\r\n\r\n```py\r\nrequests.request(method, url, data=json.dumps(...).encode(...), headers={'Content-Type': ...})\r\n```\r\n\r\nThe API is in feature-freeze so we're not adding new keywords." ]
https://api.github.com/repos/psf/requests/issues/4397
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4397/labels{/name}
https://api.github.com/repos/psf/requests/issues/4397/comments
https://api.github.com/repos/psf/requests/issues/4397/events
https://github.com/psf/requests/issues/4397
276,559,358
MDU6SXNzdWUyNzY1NTkzNTg=
4,397
Sslv3 alert handshake failure with pyopenssl
{ "avatar_url": "https://avatars.githubusercontent.com/u/19307144?v=4", "events_url": "https://api.github.com/users/Kausapaq/events{/privacy}", "followers_url": "https://api.github.com/users/Kausapaq/followers", "following_url": "https://api.github.com/users/Kausapaq/following{/other_user}", "gists_url": "https://api.github.com/users/Kausapaq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Kausapaq", "id": 19307144, "login": "Kausapaq", "node_id": "MDQ6VXNlcjE5MzA3MTQ0", "organizations_url": "https://api.github.com/users/Kausapaq/orgs", "received_events_url": "https://api.github.com/users/Kausapaq/received_events", "repos_url": "https://api.github.com/users/Kausapaq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Kausapaq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Kausapaq/subscriptions", "type": "User", "url": "https://api.github.com/users/Kausapaq", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-11-24T09:30:34Z
2021-09-08T01:21:15Z
2017-11-27T20:38:57Z
NONE
resolved
I’m receiving a bad handshake error when attempting to make a post with requests. Here is my code: ``` import requests url = "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1/paymentrequests" r = requests.post(url=url, cert=("/path/to/client_cert.pem", "/path/to/private_key.pem"), verify= "/path/to/server_cert.pem") ``` I get the following exception: ``` File "/home/www-data/py2713env/lib/python2.7/site-packages/requests/api.py", line 112, in post return request('post', url, data=data, json=json, **kwargs) File "/home/www-data/py2713env/lib/python2.7/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/home/www-data/py2713env/lib/python2.7/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/home/www-data/py2713env/lib/python2.7/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/home/www-data/py2713env/lib/python2.7/site-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) SSLError: HTTPSConnectionPool(host='mss.swicpc.bankgirot.se', port=443): Max retries exceeded with url: /swish-cpcapi/api/v1/paymentrequests (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert handshake failure')],)",),)) ``` The error disappears if I remove pyopenssl from urllib3, by including this line of code before making the request: ``` from requests.packages.urllib3.contrib import pyopenssl pyopenssl.extract_from_urllib3() ``` So I'm guessing that there is a problem with the current pyopenssl version I'm using. System Information: $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.1.3" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.13" }, "platform": { "release": "3.13.0-042stab123.3", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010007f", "version": "17.4.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000106f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ``` Any suggestions on how to fix this problem with pyopenssl?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4397/reactions" }
https://api.github.com/repos/psf/requests/issues/4397/timeline
null
completed
null
null
false
[ "Your pyopenssl is using a much newer version of OpenSSL. This likely includes some extra fields in the TLS handshake that the server doesn't like very much. My recommendation is to remove pyopenssl from your environment.", "Thank you Lukasa! So, this error occurs because I’m using a TLS protocol which the server i’m trying to connect to does not support? Just want to make sure I understand you correctly (sorry I’m a noob).\r\n\r\nDo you think this problem can be circumvented using a HTTPAdapter to provide a custom SSLContext (with a different TLS protocol) to urllib3?\r\n\r\nI would like to keep pyopenssl in my environment because later on I need to use an encrypted client certificate. I know support for this can be added using requests HTTPAdapter (acc. to issue #1573). However this also requires pyopenssl according to my understanding.", "I doubt the problem is a protocol, more likely a cipher suite or extension. You do not need PyOpenSSL to handle an encrypted client certificate. " ]
https://api.github.com/repos/psf/requests/issues/4396
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4396/labels{/name}
https://api.github.com/repos/psf/requests/issues/4396/comments
https://api.github.com/repos/psf/requests/issues/4396/events
https://github.com/psf/requests/issues/4396
276,071,563
MDU6SXNzdWUyNzYwNzE1NjM=
4,396
HTTPDigestAuth Loosing Credentials in Redirect
{ "avatar_url": "https://avatars.githubusercontent.com/u/4992805?v=4", "events_url": "https://api.github.com/users/miili/events{/privacy}", "followers_url": "https://api.github.com/users/miili/followers", "following_url": "https://api.github.com/users/miili/following{/other_user}", "gists_url": "https://api.github.com/users/miili/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/miili", "id": 4992805, "login": "miili", "node_id": "MDQ6VXNlcjQ5OTI4MDU=", "organizations_url": "https://api.github.com/users/miili/orgs", "received_events_url": "https://api.github.com/users/miili/received_events", "repos_url": "https://api.github.com/users/miili/repos", "site_admin": false, "starred_url": "https://api.github.com/users/miili/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/miili/subscriptions", "type": "User", "url": "https://api.github.com/users/miili", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-11-22T13:42:11Z
2021-09-08T05:00:54Z
2017-11-24T15:30:11Z
NONE
resolved
Loosing credentials over redirect `https://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/N01E041.SRTMGL3.hgt.zip` Cannot send credentials to the website. ## Actual Result 401 - Unauthorized :angry: ## Reproduction Steps ```python import requests from requests.auth import HTTPDigestAuth cred = ('usr', 'pwd') s = requests.Session() s.auth = HTTPDigestAuth(*cred) r = s.get('https://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/N01E041.SRTMGL3.hgt.zip') >>> <Response 401> print(r.headers) >>> {'Server': 'nginx/1.10.2', 'Date': 'Wed, 22 Nov 2017 13:38:23 GMT', 'Content-Type': 'text/html; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '1; mode=block', 'X-Content-Type-Options': 'nosniff', 'WWW-Authenticate': 'Basic realm="Please enter your Earthdata Login credentials. If you do not have a Earthdata Login, create one at https://urs.earthdata.nasa.gov//users/new"', 'Cache-Control': 'no-cache', 'X-Request-Id': 'a40e5c15-2072-4ac2-832d-293db65a87d2', 'X-Runtime': '0.040991', 'Strict-Transport-Security': 'max-age=31536000'} ``` ## Solution ```python import requests from requests.auth import HTTPDigestAuth cred = ('usr', 'pwd') s = requests.Session() s.auth = HTTPDigestAuth(*cred) r = s.get('https://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/N01E041.SRTMGL3.hgt.zip') r = s.get(r.url, stream=True) with open('/tmp/file', 'wb') as f: for d in r.iter_content(): f.write(d) ``` ## System Information $ python3 -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "4.12.0-1-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1010007f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ```
{ "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/4396/reactions" }
https://api.github.com/repos/psf/requests/issues/4396/timeline
null
completed
null
null
false
[ "I am able to reproduce this problem with the master branch. In my case, the HTTP status code of the redirect is 307.\r\n\r\n@miili Could you also share the output for `r.history` after the 401?", "Oh, actually, my server didn't support HTTP Digest authentication. Looking at the headers of the response from the URL which you are trying to hit, I only see:\r\n```\r\nWWW-Authenticate: Basic realm=\"Please enter your Earthdata Login credentials. If you do not have a Earthdata Login, create one at https://urs.earthdata.nasa.gov//users/new\"\r\n```\r\nI maybe wrong, but it could be the case that the server only supports Basic Auth?", "@nehaljwani you're correct. `WWW-Authenticate: <type> [optional parameters]` indicates the kind of authentication that the server expects. In this case `type` is `Basic` meaning that using `HTTPDigestAuth` is inappropriate. If it wanted Digest Authentication it would look like `WWW-Authenticate: Digest realm=\"...\" [etc]`" ]
https://api.github.com/repos/psf/requests/issues/4395
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4395/labels{/name}
https://api.github.com/repos/psf/requests/issues/4395/comments
https://api.github.com/repos/psf/requests/issues/4395/events
https://github.com/psf/requests/issues/4395
275,975,253
MDU6SXNzdWUyNzU5NzUyNTM=
4,395
Get error "requests.exceptions.ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))"
{ "avatar_url": "https://avatars.githubusercontent.com/u/7599378?v=4", "events_url": "https://api.github.com/users/thanhmimi/events{/privacy}", "followers_url": "https://api.github.com/users/thanhmimi/followers", "following_url": "https://api.github.com/users/thanhmimi/following{/other_user}", "gists_url": "https://api.github.com/users/thanhmimi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/thanhmimi", "id": 7599378, "login": "thanhmimi", "node_id": "MDQ6VXNlcjc1OTkzNzg=", "organizations_url": "https://api.github.com/users/thanhmimi/orgs", "received_events_url": "https://api.github.com/users/thanhmimi/received_events", "repos_url": "https://api.github.com/users/thanhmimi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/thanhmimi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/thanhmimi/subscriptions", "type": "User", "url": "https://api.github.com/users/thanhmimi", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2017-11-22T08:00:38Z
2021-09-08T05:00:53Z
2017-11-27T13:04:16Z
NONE
resolved
Summary. With python 2.7.10, I got this error but it's ok with python 3.6. I tried to ask a co-worker to try my code with his computer, it's still work with python2.7.10. It's strange ## Expected Result ## Actual Result What happened instead. ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.1.3" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.10" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "9081df", "version": "0.13.1" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "9081df" }, "urllib3": { "version": "1.22" }, "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/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": 1, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/4395/reactions" }
https://api.github.com/repos/psf/requests/issues/4395/timeline
null
completed
null
null
false
[ "We need to know more about what’s happening here: can we get some sample code? All this means is that the remote server is closing the connection when we aren’t expecting it.", "This has gone 5 days without information necessary to investigate anything. As such, I'm closing this. If you have the chance to provide us with more information, we may be able to reopen this and help investigate." ]
https://api.github.com/repos/psf/requests/issues/4394
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4394/labels{/name}
https://api.github.com/repos/psf/requests/issues/4394/comments
https://api.github.com/repos/psf/requests/issues/4394/events
https://github.com/psf/requests/pull/4394
275,866,368
MDExOlB1bGxSZXF1ZXN0MTU0MDA2MTA4
4,394
Add documentation for available status codes
{ "avatar_url": "https://avatars.githubusercontent.com/u/842470?v=4", "events_url": "https://api.github.com/users/zaneb/events{/privacy}", "followers_url": "https://api.github.com/users/zaneb/followers", "following_url": "https://api.github.com/users/zaneb/following{/other_user}", "gists_url": "https://api.github.com/users/zaneb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zaneb", "id": 842470, "login": "zaneb", "node_id": "MDQ6VXNlcjg0MjQ3MA==", "organizations_url": "https://api.github.com/users/zaneb/orgs", "received_events_url": "https://api.github.com/users/zaneb/received_events", "repos_url": "https://api.github.com/users/zaneb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zaneb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zaneb/subscriptions", "type": "User", "url": "https://api.github.com/users/zaneb", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-21T21:31:13Z
2021-09-04T00:06:39Z
2017-11-23T20:19:13Z
CONTRIBUTOR
resolved
There was no way to determine what actual names were available outside of looking at the source code. They were not listed in the documentation or accessible through the interactive help. In addition, doing `pydoc requests.status_codes` displayed some pretty unhelpful information - the utf-8 encoding string was included in the module name, there was no description, and internal variables used for initialisation leaked into the module scope: DATA code = 511 codes = <lookup 'status_codes'> title = 'network_authentication' titles = ('network_authentication_required', 'network_auth', ... This change prevents the internal variables from leaking, adds a docstring (which has the side-effect of correcting the module name), and appends information on the allowed status code names to the docstring when the module is initialised. The improved module documentation is then used in the API documentation to provide another easy reference to the complete list of status codes.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4394/reactions" }
https://api.github.com/repos/psf/requests/issues/4394/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4394.diff", "html_url": "https://github.com/psf/requests/pull/4394", "merged_at": "2017-11-23T20:19:13Z", "patch_url": "https://github.com/psf/requests/pull/4394.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4394" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4394?src=pr&el=h1) Report\n> Merging [#4394](https://codecov.io/gh/requests/requests/pull/4394?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/e68ef0ecad271f335377804a747afe676d17024d?src=pr&el=desc) will **increase** coverage by `0.03%`.\n> The diff coverage is `100%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4394/graphs/tree.svg?token=mZGswIiXLa&src=pr&height=150&width=650)](https://codecov.io/gh/requests/requests/pull/4394?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4394 +/- ##\n==========================================\n+ Coverage 89.05% 89.08% +0.03% \n==========================================\n Files 18 18 \n Lines 2055 2062 +7 \n==========================================\n+ Hits 1830 1837 +7 \n Misses 225 225\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4394?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/status\\_codes.py](https://codecov.io/gh/requests/requests/pull/4394?src=pr&el=tree#diff-cmVxdWVzdHMvc3RhdHVzX2NvZGVzLnB5) | `100% <100%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4394?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4394?src=pr&el=footer). Last update [e68ef0e...c250701](https://codecov.io/gh/requests/requests/pull/4394?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n" ]
https://api.github.com/repos/psf/requests/issues/4393
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4393/labels{/name}
https://api.github.com/repos/psf/requests/issues/4393/comments
https://api.github.com/repos/psf/requests/issues/4393/events
https://github.com/psf/requests/issues/4393
275,842,771
MDU6SXNzdWUyNzU4NDI3NzE=
4,393
Quickstart guide is missing section on cookies.
{ "avatar_url": "https://avatars.githubusercontent.com/u/6380199?v=4", "events_url": "https://api.github.com/users/eliothxchan/events{/privacy}", "followers_url": "https://api.github.com/users/eliothxchan/followers", "following_url": "https://api.github.com/users/eliothxchan/following{/other_user}", "gists_url": "https://api.github.com/users/eliothxchan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/eliothxchan", "id": 6380199, "login": "eliothxchan", "node_id": "MDQ6VXNlcjYzODAxOTk=", "organizations_url": "https://api.github.com/users/eliothxchan/orgs", "received_events_url": "https://api.github.com/users/eliothxchan/received_events", "repos_url": "https://api.github.com/users/eliothxchan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/eliothxchan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eliothxchan/subscriptions", "type": "User", "url": "https://api.github.com/users/eliothxchan", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-11-21T20:05:17Z
2021-09-08T06:00:27Z
2017-11-21T20:14:26Z
NONE
resolved
The quickstart guide has a section for cookies in the table of contents, but there isn't actually anything there. http://docs.python-requests.org/en/master/user/quickstart/#cookies
{ "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/4393/reactions" }
https://api.github.com/repos/psf/requests/issues/4393/timeline
null
completed
null
null
false
[ "@eliotxchan, is this happening consistently on page refreshes and across different browsers? I can access that page fine on multiple devices.\r\n\r\nIf it still isn't showing up, there's either a network or browser issue somewhere on your end.", "Additionally, you can find the section on cookies here: https://github.com/requests/requests/blob/master/docs/user/quickstart.rst#cookies", "Was actually my ad blocker blocking that. Very odd." ]
https://api.github.com/repos/psf/requests/issues/4392
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4392/labels{/name}
https://api.github.com/repos/psf/requests/issues/4392/comments
https://api.github.com/repos/psf/requests/issues/4392/events
https://github.com/psf/requests/issues/4392
275,463,564
MDU6SXNzdWUyNzU0NjM1NjQ=
4,392
Streamed request with preset Host header sends two Host headers
{ "avatar_url": "https://avatars.githubusercontent.com/u/46775?v=4", "events_url": "https://api.github.com/users/mjpieters/events{/privacy}", "followers_url": "https://api.github.com/users/mjpieters/followers", "following_url": "https://api.github.com/users/mjpieters/following{/other_user}", "gists_url": "https://api.github.com/users/mjpieters/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mjpieters", "id": 46775, "login": "mjpieters", "node_id": "MDQ6VXNlcjQ2Nzc1", "organizations_url": "https://api.github.com/users/mjpieters/orgs", "received_events_url": "https://api.github.com/users/mjpieters/received_events", "repos_url": "https://api.github.com/users/mjpieters/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mjpieters/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mjpieters/subscriptions", "type": "User", "url": "https://api.github.com/users/mjpieters", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
false
null
[]
null
8
2017-11-20T19:04:03Z
2024-05-19T18:59:49Z
2024-05-19T18:59:48Z
CONTRIBUTOR
null
The following code sends **two** host headers: ```python import requests def gen(): yield b'binary data' requests.post( 'http://localhost:3000/', data=gen(), headers={'Host': 'example.com'} ) ``` (I tested with `nc -vvl 3000` on OS X). Headers received: ``` POST / HTTP/1.1 Host: localhost:3000 User-Agent: python-requests/2.18.1 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Host: example.com Transfer-Encoding: chunked ``` This is because when chunking a request, we don't tell the `httplib` / `http.client` library to skip the host header if one is already set. From the [`adapters.HTTPAdapter.send()` implementation](https://github.com/requests/requests/blob/9a8a826f226e6973d72914b4a4fc806e0b5036f4/requests/adapters.py#L456-L458): ```python low_conn.putrequest(request.method, url, skip_accept_encoding=True) ``` which leaves the [`skip_host` parameter](https://docs.python.org/3/library/http.client.html#http.client.HTTPConnection.putrequest) set to `False`. It probably should use `skip_host='host' in request.headers` here. ## System Information ``` >>> requests.help.main() { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.0.3" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "1010006f", "version": "17.3.0" }, "requests": { "version": "2.18.1" }, "system_ssl": { "version": "100020cf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ```
{ "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/4392/reactions" }
https://api.github.com/repos/psf/requests/issues/4392/timeline
null
completed
null
null
false
[ "Yep, this looks like a miss from #3637. Since we're not using urllib3's chunked request interface, we never got the change integrated in Requests.\r\n\r\nThe quick path here is to carry the host dedupe logic from urrlib3 into that try block. The better but likely more involved solution would be to try to use urllib3's chunked logic in Requests. This is something we've discussed before but probably out of scope for this issue.\r\n\r\n@requests/core I'm assuming the former option is the advisable one, but do you have different thoughts?", "I think we can probably use urllib3’s implementation: it’s present in all our supported versions of urllib3 I think.", "If we're going to swap in urllib3's chunked logic, we need better end-to-end (socket level) tests of our chunking behaviour to make sure we don't drastically change things.", "Does anyone know a work-around to avoid this double host header?\r\n\r\n<rant>I need to access a frustrating and honestly quite stupid API that I have no control over, which requires the host header to be some kind of information totally unrelated to the actual hostname. And it requires chunked encoding.</rant>", "Currently the best work-around you have is to not use `requests` and use `urllib3` directly.", "Any update on this?", "Linking #5391 back here as a potential fix as converting to urllib3's chunked functionality is unlikely to happen before a major version bump.", "Requests is now using urllib3's chunking API" ]
https://api.github.com/repos/psf/requests/issues/4391
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4391/labels{/name}
https://api.github.com/repos/psf/requests/issues/4391/comments
https://api.github.com/repos/psf/requests/issues/4391/events
https://github.com/psf/requests/issues/4391
275,422,135
MDU6SXNzdWUyNzU0MjIxMzU=
4,391
requests.session ignores second `verify` argument?
{ "avatar_url": "https://avatars.githubusercontent.com/u/769730?v=4", "events_url": "https://api.github.com/users/hjwp/events{/privacy}", "followers_url": "https://api.github.com/users/hjwp/followers", "following_url": "https://api.github.com/users/hjwp/following{/other_user}", "gists_url": "https://api.github.com/users/hjwp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hjwp", "id": 769730, "login": "hjwp", "node_id": "MDQ6VXNlcjc2OTczMA==", "organizations_url": "https://api.github.com/users/hjwp/orgs", "received_events_url": "https://api.github.com/users/hjwp/received_events", "repos_url": "https://api.github.com/users/hjwp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hjwp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hjwp/subscriptions", "type": "User", "url": "https://api.github.com/users/hjwp", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2017-11-20T16:44:42Z
2021-09-01T00:11:35Z
2018-01-23T15:50:43Z
NONE
resolved
Am doing some testing for HTTPS certificates, and am seeing some unexpected behaviour from the requests "session" object: ``` import requests # www.ottg.eu has a known invalid https certificate: requests.session().get('https://www.ottg.eu', verify=True) # raises error as expected session = requests.session() session.get('https://www.ottg.eu', verify=False) # as expected does not raise, prints InsecureRequestWarning, session.get('https://www.ottg.eu', verify=True) # unexpectedly, this seems to ignore the verify parameter, and it does not raise # it also still prints the InsecureRequestWarning ``` That doesn't seem right? tested against requests 2.18.4 on ubuntu 17.10
{ "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/4391/reactions" }
https://api.github.com/repos/psf/requests/issues/4391/timeline
null
completed
null
null
false
[ "(just repro'd in both python2 and python3, and on windows)", "maybe this is expected behaviour? because of connection pooling?", "(with apologies for the stream-of-consciousness) -- it definitely is because of connection pooling, isn't it. behaviour surprising but maybe not unexpected after all? i suppose a fix would be to somehow keep track of connections and changes in the `verify` argument? probably quite a heavyweight fix for an edge case...", "We started working on a fix for this but it took us down a deep and very dark rabbit hole that led to very bad places if I remember correctly. I think the PR might still be open on urllib3 but I don't think it's advisable. A similar yet different solution might be to have two `https://` connection pools in an adapter one for verified connections and one for unverified connections to hack around this ugly behaviour. (Or have a session with 3 httpadapters such that one adapter only ever handles unverified TLS connections. I think that's less elegant though)", "I think this is fixed in proposed/3.0.0 with https://github.com/requests/requests/pull/3109 and https://github.com/requests/requests/pull/4173", "Yup, this is fixed in 3.0.0 as I recall.", "Alright, I think we can close this out since it's fixed in the 3.0.0 branch and it doesn't seem like we have any action we can take to mitigate this in the 2.x branch.", "Looks like v3 is still not out over 2 years later, and I have a fix for this for v2 in PR #5406" ]
https://api.github.com/repos/psf/requests/issues/4390
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4390/labels{/name}
https://api.github.com/repos/psf/requests/issues/4390/comments
https://api.github.com/repos/psf/requests/issues/4390/events
https://github.com/psf/requests/pull/4390
275,284,831
MDExOlB1bGxSZXF1ZXN0MTUzNTc3OTY2
4,390
[docs; tiny] Clarify that Response.ok will *only* return True/False
{ "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
2
2017-11-20T09:19:38Z
2021-09-04T00:06:40Z
2017-11-20T13:18:01Z
CONTRIBUTOR
resolved
This is a tiny documentation fix, just to be super-duper explicit about the return value of `response.ok`. (I wanted to check I could use its value in a function that’s meant to return a boolean, but the docs weren’t clear about what a non-Truthy return value would be.)
{ "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/4390/reactions" }
https://api.github.com/repos/psf/requests/issues/4390/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4390.diff", "html_url": "https://github.com/psf/requests/pull/4390", "merged_at": "2017-11-20T13:18:01Z", "patch_url": "https://github.com/psf/requests/pull/4390.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4390" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4390?src=pr&el=h1) Report\n> Merging [#4390](https://codecov.io/gh/requests/requests/pull/4390?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/c3f2553114fdaf83b9c646a73987bbd2f13285e1?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4390/graphs/tree.svg?token=mZGswIiXLa&width=650&height=150&src=pr)](https://codecov.io/gh/requests/requests/pull/4390?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4390 +/- ##\n=======================================\n Coverage 88.36% 88.36% \n=======================================\n Files 18 18 \n Lines 2055 2055 \n=======================================\n Hits 1816 1816 \n Misses 239 239\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4390?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/4390?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.45% <ø> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4390?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4390?src=pr&el=footer). Last update [c3f2553...775cde0](https://codecov.io/gh/requests/requests/pull/4390?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Thanks @alexwlchan " ]
https://api.github.com/repos/psf/requests/issues/4389
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4389/labels{/name}
https://api.github.com/repos/psf/requests/issues/4389/comments
https://api.github.com/repos/psf/requests/issues/4389/events
https://github.com/psf/requests/issues/4389
275,169,373
MDU6SXNzdWUyNzUxNjkzNzM=
4,389
Raise the real error if max retries failed.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1014282?v=4", "events_url": "https://api.github.com/users/orzilca/events{/privacy}", "followers_url": "https://api.github.com/users/orzilca/followers", "following_url": "https://api.github.com/users/orzilca/following{/other_user}", "gists_url": "https://api.github.com/users/orzilca/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/orzilca", "id": 1014282, "login": "orzilca", "node_id": "MDQ6VXNlcjEwMTQyODI=", "organizations_url": "https://api.github.com/users/orzilca/orgs", "received_events_url": "https://api.github.com/users/orzilca/received_events", "repos_url": "https://api.github.com/users/orzilca/repos", "site_admin": false, "starred_url": "https://api.github.com/users/orzilca/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/orzilca/subscriptions", "type": "User", "url": "https://api.github.com/users/orzilca", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2017-11-19T15:55:02Z
2021-09-08T05:00:51Z
2017-11-28T12:59:35Z
NONE
resolved
When using Retry(), if max retries is reached an error is thrown "max retries". Is it possible to see the real API error? the real HTTP response instead? ## Expected Result The real error/http response. (ResponseError in the example below) ## Actual Result max retries error, not logging correctly on Sentry. ``` MaxRetryError(\"HTTPSConnectionPool(host='***', port=443): Max retries exceeded with url: *** (Caused by ResponseError('too many 401 error responses',))\",) is not JSON serializable ``` ## Reproduction Steps ```python import requests import urllib import logging import json from requests.packages.urllib3.util.retry import Retry session = requests.Session() retries = Retry( total=3, backoff_factor=0.5, method_whitelist=frozenset(['HEAD', 'TRACE', 'GET', 'PUT', 'OPTIONS', 'DELETE', 'POST']), status_forcelist=[401, 403, 404, 500, 502, 503, 504] ) session.mount("http://", requests.adapters.HTTPAdapter(max_retries=retries)) session.mount("https://", requests.adapters.HTTPAdapter(max_retries=retries)) if method == 'GET': if params: endpoint = '%s?%s' % (endpoint, urllib.urlencode(params)) response = session.get(endpoint, headers=headers) elif method == 'POST': response = session.post(endpoint, data=params, headers=headers) elif method == 'POST/JSON': response = session.post(endpoint, json=params, headers=headers) elif method == 'PUT/JSON': response = session.put(endpoint, json=params, headers=headers) else: raise Exception("Invalid method.") ``` ## System Information $ python -m requests.help ``` Python 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2 Requests version 2.13 urllib3 version 1.20 ```
{ "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/4389/reactions" }
https://api.github.com/repos/psf/requests/issues/4389/timeline
null
completed
null
null
false
[ "Which error is the real one? What happens if for each of your three retries, we get a different error? Let's say, first we get a `ConnectionTimeout`. Then we receive a 500 and then a 403? Which one do you want us to tell you about?", "Thats a good question @sigmavirus24 \r\n\r\nBasically I wish to know to real error from the API I tried to call so it'll be easier to debug using tools like Sentry.\r\n\r\nCurrently it logges under MaxRetries error which forces me to try and reconstruct, and thats not always possible.", "> Basically I wish to know to real error from the API \r\n\r\nI think you may want a different way of retrying errors then. In fact, I think you may want to have a separate abstraction such that you can attempt a request, send the error to sentry, and then repeat up until you hit your limit. That would give you the \"real error\" on each attempt.\r\n\r\nRight now, the exception we're raising really makes the most sense (MaxRetries) because we've reached our Retry limit (specified by you) and there's nothing more for us to do. Browsers have similar behaviour. If a website redirects too many times or fails to load too many times, Browsers will tell you as much.", "Right, so I'm closing this now. I don't think that Requests or urllib3 should try to keep track of each error that led to a retry. If we did that, we could start leaking resources or even other sensitive information that users may not want stored. Perhaps, urllib3 would want to consider allowing the user to specify some kind of callback for each retry (which a user could then pass a logger to or some other function that posts to an error handling service) but that belongs there, not here :)" ]
https://api.github.com/repos/psf/requests/issues/4388
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4388/labels{/name}
https://api.github.com/repos/psf/requests/issues/4388/comments
https://api.github.com/repos/psf/requests/issues/4388/events
https://github.com/psf/requests/issues/4388
275,151,457
MDU6SXNzdWUyNzUxNTE0NTc=
4,388
FileNotFoundError: [Errno 2] No such file or directory: './README.rst'
{ "avatar_url": "https://avatars.githubusercontent.com/u/30954037?v=4", "events_url": "https://api.github.com/users/lvallejou85/events{/privacy}", "followers_url": "https://api.github.com/users/lvallejou85/followers", "following_url": "https://api.github.com/users/lvallejou85/following{/other_user}", "gists_url": "https://api.github.com/users/lvallejou85/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lvallejou85", "id": 30954037, "login": "lvallejou85", "node_id": "MDQ6VXNlcjMwOTU0MDM3", "organizations_url": "https://api.github.com/users/lvallejou85/orgs", "received_events_url": "https://api.github.com/users/lvallejou85/received_events", "repos_url": "https://api.github.com/users/lvallejou85/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lvallejou85/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lvallejou85/subscriptions", "type": "User", "url": "https://api.github.com/users/lvallejou85", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-19T11:27:43Z
2021-09-08T06:00:27Z
2017-11-19T16:02:17Z
NONE
resolved
Summary. ## Expected Result pip install request Installed OK ## Actual Result pip install request Collecting request Using cached request-0.0.13.tar.gz Collecting get (from request) Using cached get-0.0.21.tar.gz Collecting post (from request) Using cached post-0.0.13.tar.gz Collecting setupfiles (from request) Using cached setupfiles-0.0.50.tar.gz Collecting query_string (from get->request) Using cached query_string-0.0.12.tar.gz Collecting public (from query_string->get->request) Using cached public-0.0.41.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-bex9djjl/public/setup.py", line 28, in <module> setup_cfg_data = read_configuration(path) File "/tmp/pip-build-bex9djjl/public/setup.py", line 23, in read_configuration val = open(val).read() FileNotFoundError: [Errno 2] No such file or directory: './README.rst' ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-bex9djjl/public/ What happened instead. Library installation failed ## Reproduction Steps ```python pip install request ``` ## System Information $ python -m requests.help ``` No module named requests.help ``` 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). ![selection_999 1555](https://user-images.githubusercontent.com/30954037/32990180-bca9465a-ccf2-11e7-8025-55fa1a7d985d.png) ![image](https://user-images.githubusercontent.com/30954037/32990178-b2fb6b88-ccf2-11e7-8882-71dcc56747e2.png)
{ "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/4388/reactions" }
https://api.github.com/repos/psf/requests/issues/4388/timeline
null
completed
null
null
false
[ "@lvallejou85 it looks like you're missing the final \"s\" in the package name in your install command. It should be `pip install requests`." ]
https://api.github.com/repos/psf/requests/issues/4387
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4387/labels{/name}
https://api.github.com/repos/psf/requests/issues/4387/comments
https://api.github.com/repos/psf/requests/issues/4387/events
https://github.com/psf/requests/pull/4387
275,004,208
MDExOlB1bGxSZXF1ZXN0MTUzMzk5ODEx
4,387
Clarify raw response reading in the quickstart.
{ "avatar_url": "https://avatars.githubusercontent.com/u/350812?v=4", "events_url": "https://api.github.com/users/dave-shawley/events{/privacy}", "followers_url": "https://api.github.com/users/dave-shawley/followers", "following_url": "https://api.github.com/users/dave-shawley/following{/other_user}", "gists_url": "https://api.github.com/users/dave-shawley/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dave-shawley", "id": 350812, "login": "dave-shawley", "node_id": "MDQ6VXNlcjM1MDgxMg==", "organizations_url": "https://api.github.com/users/dave-shawley/orgs", "received_events_url": "https://api.github.com/users/dave-shawley/received_events", "repos_url": "https://api.github.com/users/dave-shawley/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dave-shawley/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dave-shawley/subscriptions", "type": "User", "url": "https://api.github.com/users/dave-shawley", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2017-11-17T21:38:49Z
2021-09-04T00:06:41Z
2017-11-18T09:44:29Z
CONTRIBUTOR
resolved
It's a small change but this would have saved me a bit of time today.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4387/reactions" }
https://api.github.com/repos/psf/requests/issues/4387/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4387.diff", "html_url": "https://github.com/psf/requests/pull/4387", "merged_at": "2017-11-18T09:44:29Z", "patch_url": "https://github.com/psf/requests/pull/4387.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4387" }
true
[]
https://api.github.com/repos/psf/requests/issues/4386
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4386/labels{/name}
https://api.github.com/repos/psf/requests/issues/4386/comments
https://api.github.com/repos/psf/requests/issues/4386/events
https://github.com/psf/requests/issues/4386
274,857,764
MDU6SXNzdWUyNzQ4NTc3NjQ=
4,386
pip install : Unable to determine SOCKS version
{ "avatar_url": "https://avatars.githubusercontent.com/u/18721751?v=4", "events_url": "https://api.github.com/users/torfhub/events{/privacy}", "followers_url": "https://api.github.com/users/torfhub/followers", "following_url": "https://api.github.com/users/torfhub/following{/other_user}", "gists_url": "https://api.github.com/users/torfhub/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/torfhub", "id": 18721751, "login": "torfhub", "node_id": "MDQ6VXNlcjE4NzIxNzUx", "organizations_url": "https://api.github.com/users/torfhub/orgs", "received_events_url": "https://api.github.com/users/torfhub/received_events", "repos_url": "https://api.github.com/users/torfhub/repos", "site_admin": false, "starred_url": "https://api.github.com/users/torfhub/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/torfhub/subscriptions", "type": "User", "url": "https://api.github.com/users/torfhub", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2017-11-17T13:00:08Z
2021-09-08T05:00:51Z
2017-11-28T13:12:36Z
NONE
resolved
i have try all the method, it just not work !
{ "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/4386/reactions" }
https://api.github.com/repos/psf/requests/issues/4386/timeline
null
completed
null
null
false
[ "@torfhub If you really have found a problem and expect to have it fixed, what you wrote is not enough.\r\n\r\nStart by reading [CONTRIBUTING.md](https://github.com/requests/requests/blob/master/CONTRIBUTING.md)\r\n--\r\nAt least post here the command and the output.\r\n", "Hi @torfhub,\r\n\r\nWe will need a lot more information in order to help you. Without that information, I'm going to close this, for now. If you leave a comment with information, I'll be happy to reopen this and help you investigate.\r\n\r\n---\r\n\r\n@HelioGuilherme66 we appreciate your attempt to help gather some basic information with @torfhub. Please, in the future, try to phrase your comments a bit more gently. @torfhub seems rather new to open source software and gruff and unwelcoming responses are not typically helpful for either them or the maintainers." ]
https://api.github.com/repos/psf/requests/issues/4385
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4385/labels{/name}
https://api.github.com/repos/psf/requests/issues/4385/comments
https://api.github.com/repos/psf/requests/issues/4385/events
https://github.com/psf/requests/issues/4385
274,778,655
MDU6SXNzdWUyNzQ3Nzg2NTU=
4,385
not able to extract key:value from Json
{ "avatar_url": "https://avatars.githubusercontent.com/u/33282235?v=4", "events_url": "https://api.github.com/users/rishi-pal/events{/privacy}", "followers_url": "https://api.github.com/users/rishi-pal/followers", "following_url": "https://api.github.com/users/rishi-pal/following{/other_user}", "gists_url": "https://api.github.com/users/rishi-pal/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rishi-pal", "id": 33282235, "login": "rishi-pal", "node_id": "MDQ6VXNlcjMzMjgyMjM1", "organizations_url": "https://api.github.com/users/rishi-pal/orgs", "received_events_url": "https://api.github.com/users/rishi-pal/received_events", "repos_url": "https://api.github.com/users/rishi-pal/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rishi-pal/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rishi-pal/subscriptions", "type": "User", "url": "https://api.github.com/users/rishi-pal", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2017-11-17T07:44:17Z
2021-09-08T06:00:27Z
2017-11-17T12:11:05Z
NONE
resolved
I am able to get whole json data but not able to get specific key:values from json data (url). Have someone seen this issue ? ## Expected Result Specific Key:Value Pair i.e ( ID : 123456) What you expected. I want to extract key-value from json data ## Actual Result Getting below error print (data["id"]) Traceback (most recent call last): File "", line 1, in KeyError: 'id' What happened instead. ## Reproduction Steps <code> import urllib, json import requests from requests.auth import HTTPBasicAuth url = requests.get('http://ac-infinibox10.com/api/rest/pools', auth=HTTPBasicAuth('test', 'test')) data = url.json() print(data) ###### this works print (data['id']) ###### this does not works ================== System information: Python 2.7 RHEL 7
{ "avatar_url": "https://avatars.githubusercontent.com/u/33282235?v=4", "events_url": "https://api.github.com/users/rishi-pal/events{/privacy}", "followers_url": "https://api.github.com/users/rishi-pal/followers", "following_url": "https://api.github.com/users/rishi-pal/following{/other_user}", "gists_url": "https://api.github.com/users/rishi-pal/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rishi-pal", "id": 33282235, "login": "rishi-pal", "node_id": "MDQ6VXNlcjMzMjgyMjM1", "organizations_url": "https://api.github.com/users/rishi-pal/orgs", "received_events_url": "https://api.github.com/users/rishi-pal/received_events", "repos_url": "https://api.github.com/users/rishi-pal/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rishi-pal/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rishi-pal/subscriptions", "type": "User", "url": "https://api.github.com/users/rishi-pal", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4385/reactions" }
https://api.github.com/repos/psf/requests/issues/4385/timeline
null
completed
null
null
false
[ "Hi - can you print output of `print(data)` ?", "{u'metadata': {u'ready': True, u'number_of_objects': 3, u'pages_total': 1, u'page': 1, u'page_size': 50}, u'result': [{u'volumes_count': 1, u'updated_at': 1487594704819, u'max_extend': -1, u'allocated_physical_space': 10000007168, u'free_virtual_space': 99990000369664, u'id': 4880, u'reserved_capacity': 107374313472, u'filesystems_count': 0, u'ssd_enabled': True, u'snapshots_count': 0, u'state': u'NORMAL', u'free_physical_space': 69990000099328, u'entities_count': 1, u'owners': [], u'capacity_savings': 0, u'name': u'AMDC-IBOX04_AIX_Storage_Pool', u'virtual_capacity': 100000000376832, u'created_at': 1487594704819, u'filesystem_snapshots_count': 0, u'compression_enabled': True, u'physical_capacity_warning': 90, u'physical_capacity': 70000000106496, u'physical_capacity_critical': 95}, {u'volumes_count': 28, u'updated_at': 1508346569350, u'max_extend': -1, u'allocated_physical_space': 111404476229632, u'free_virtual_space': 78739426377728, u'id': 15285, u'reserved_capacity': 107374313472, u'filesystems_count': 0, u'ssd_enabled': True, u'snapshots_count': 0, u'state': u'NORMAL', u'free_physical_space': 88595524130816, u'entities_count': 28, u'owners': [],", "Try posting it in a code block - it has been clipped here. ", "import urllib, json\r\n\r\n\r\nimport requests\r\nfrom requests.auth import HTTPBasicAuth\r\nurl = requests.get('http://ac-infinibox10.com/api/rest/pools', auth=HTTPBasicAuth('test', 'test'))\r\ndata = url.json()\r\nprint(data)\r\n\r\nprint (data['id'])", "I feel your dictionary structure might be different from what you're expecting.\r\n\r\nYou can try: `print(data.keys())` - perhaps you need to access the `id` key at a different level. ", "Thanks for you quick reply on the issue. I am new to python and need to write script to fetch set of information from json data.\r\n\r\nI tried below command and I m getting output. How can I extract a specific data like free_physical_space=free_physical_space from json data ?\r\n\r\n>>> print(data.keys())\r\n[u'metadata', u'result', u'error']\r\n", "Maybe something like this:\r\n\r\n```\r\nfor result in data['result']:\r\n print(result['free_physical_space'])\r\n```\r\n\r\nPlease close this issue as it is not really a `requests` bug.", "Thank you so much! It worked.\r\nClosing the issue." ]
https://api.github.com/repos/psf/requests/issues/4384
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4384/labels{/name}
https://api.github.com/repos/psf/requests/issues/4384/comments
https://api.github.com/repos/psf/requests/issues/4384/events
https://github.com/psf/requests/pull/4384
274,425,324
MDExOlB1bGxSZXF1ZXN0MTUyOTczNTI0
4,384
Correct HTTP -> HTML in quickstart doc
{ "avatar_url": "https://avatars.githubusercontent.com/u/532281?v=4", "events_url": "https://api.github.com/users/taleinat/events{/privacy}", "followers_url": "https://api.github.com/users/taleinat/followers", "following_url": "https://api.github.com/users/taleinat/following{/other_user}", "gists_url": "https://api.github.com/users/taleinat/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/taleinat", "id": 532281, "login": "taleinat", "node_id": "MDQ6VXNlcjUzMjI4MQ==", "organizations_url": "https://api.github.com/users/taleinat/orgs", "received_events_url": "https://api.github.com/users/taleinat/received_events", "repos_url": "https://api.github.com/users/taleinat/repos", "site_admin": false, "starred_url": "https://api.github.com/users/taleinat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/taleinat/subscriptions", "type": "User", "url": "https://api.github.com/users/taleinat", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-16T08:00:32Z
2021-09-04T00:06:41Z
2017-11-16T16:01:45Z
CONTRIBUTOR
resolved
The quickstart doc apparently wanted to mention that "HTML and XML have ways of specifying their encoding in their body".
{ "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/4384/reactions" }
https://api.github.com/repos/psf/requests/issues/4384/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4384.diff", "html_url": "https://github.com/psf/requests/pull/4384", "merged_at": "2017-11-16T16:01:45Z", "patch_url": "https://github.com/psf/requests/pull/4384.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4384" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4384?src=pr&el=h1) Report\n> Merging [#4384](https://codecov.io/gh/requests/requests/pull/4384?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/d55de2d391d1350766221ce0aa36e670dc2a0169?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4384/graphs/tree.svg?width=650&height=150&src=pr&token=mZGswIiXLa)](https://codecov.io/gh/requests/requests/pull/4384?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4384 +/- ##\n=======================================\n Coverage 88.36% 88.36% \n=======================================\n Files 18 18 \n Lines 2055 2055 \n=======================================\n Hits 1816 1816 \n Misses 239 239\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4384?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4384?src=pr&el=footer). Last update [d55de2d...7f08ad3](https://codecov.io/gh/requests/requests/pull/4384?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n" ]
https://api.github.com/repos/psf/requests/issues/4383
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4383/labels{/name}
https://api.github.com/repos/psf/requests/issues/4383/comments
https://api.github.com/repos/psf/requests/issues/4383/events
https://github.com/psf/requests/issues/4383
274,030,998
MDU6SXNzdWUyNzQwMzA5OTg=
4,383
How can I get session storage variable in Python requests library?
{ "avatar_url": "https://avatars.githubusercontent.com/u/24641385?v=4", "events_url": "https://api.github.com/users/willowTank/events{/privacy}", "followers_url": "https://api.github.com/users/willowTank/followers", "following_url": "https://api.github.com/users/willowTank/following{/other_user}", "gists_url": "https://api.github.com/users/willowTank/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/willowTank", "id": 24641385, "login": "willowTank", "node_id": "MDQ6VXNlcjI0NjQxMzg1", "organizations_url": "https://api.github.com/users/willowTank/orgs", "received_events_url": "https://api.github.com/users/willowTank/received_events", "repos_url": "https://api.github.com/users/willowTank/repos", "site_admin": false, "starred_url": "https://api.github.com/users/willowTank/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/willowTank/subscriptions", "type": "User", "url": "https://api.github.com/users/willowTank", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-15T04:26:46Z
2021-09-08T06:00:28Z
2017-11-15T20:24:45Z
NONE
resolved
I want to get session storage variable when I call any url. Best Regards here is my code ``` > self.session = requests.Session() > self.session.mount('https://', HTTPAdapter(max_retries=4)) > resp = self.session.get("https://m.betclic.it/sport/sportList/") ``` this is session storage when I visit this site ![uta](https://user-images.githubusercontent.com/24641385/32818822-82fd67e6-ca00-11e7-890b-9bdf2cfc88e2.png)
{ "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/4383/reactions" }
https://api.github.com/repos/psf/requests/issues/4383/timeline
null
completed
null
null
false
[ "This isn't a bug or feature request and is therefore better suited to a question and answer site like [StackOverflow](https://stackoverflow.com/questions/tagged/python-requests)." ]
https://api.github.com/repos/psf/requests/issues/4382
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4382/labels{/name}
https://api.github.com/repos/psf/requests/issues/4382/comments
https://api.github.com/repos/psf/requests/issues/4382/events
https://github.com/psf/requests/issues/4382
273,081,514
MDU6SXNzdWUyNzMwODE1MTQ=
4,382
request fails with bad handshake error
{ "avatar_url": "https://avatars.githubusercontent.com/u/8977402?v=4", "events_url": "https://api.github.com/users/uttampawar/events{/privacy}", "followers_url": "https://api.github.com/users/uttampawar/followers", "following_url": "https://api.github.com/users/uttampawar/following{/other_user}", "gists_url": "https://api.github.com/users/uttampawar/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/uttampawar", "id": 8977402, "login": "uttampawar", "node_id": "MDQ6VXNlcjg5Nzc0MDI=", "organizations_url": "https://api.github.com/users/uttampawar/orgs", "received_events_url": "https://api.github.com/users/uttampawar/received_events", "repos_url": "https://api.github.com/users/uttampawar/repos", "site_admin": false, "starred_url": "https://api.github.com/users/uttampawar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/uttampawar/subscriptions", "type": "User", "url": "https://api.github.com/users/uttampawar", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-10T22:42:54Z
2021-09-08T06:00:28Z
2017-11-14T18:57:48Z
NONE
resolved
Summary. I've a node.js server running with local certificate for SSL connection created using openssl command as, ``` $ openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -keyout localhost-privkey.pem -out localhost-cert.pem ``` Trying to use requests module to initiate communication with this node.js server which fails with various errors. ## Reproduction Steps ```python >>> import requests >>> requests.get("https://localhost:9000/getcpuinfo") ... requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",) ``` So I tried to pass verify=False option as, ``` >>> requests.get("https://localhost:9000/getcpuinfo", verify=False) equests.exceptions.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",) ``` I tested the server with "curl" utility as shown below, ``` $ curl https://localhost:9000/loaddb curl: (60) SSL certificate problem: self signed certificate <--- fails ``` But it works with "-k" to ignore certificate verification step, ``` $ curl -k https://localhost:9000/getcpuinfo {"hw":{"architecture":"x64","model":"Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz","speed":899,"sys":3600700,"irq":0,"idle":2617236700,"user":17612800,"nice":39400,"endianness":"LE","totalmem":33605652480,"freemem":27233288192},"sw":{"platform":"linux","release":"4.9.0-3-amd64","type":"Linux","uptime":265048},"appName":"Cluster","version":{"http_parser":"2.7.0","node":"9.0.0-pre","v8":"6.1.534.42","uv":"1.14.1","zlib":"1.2.11","ares":"1.13.0","modules":"58","nghttp2":"1.25.0","openssl":"1.0.2l","icu":"59.1","unicode":"9.0","cldr":"31.0.1","tz":"2017b"},"cpuCount":0} ``` So why doesn't requests module ignores certificate validation when "verify=False"? Environment details: OS: Linux nodejs-work 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 GNU/Linux Python: Python 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118] on linux2 Client/Public certificate (localhost-cert.pem), ``` ----BEGIN CERTIFICATE----- MIIC/jCCAeagAwIBAgIJAKATu2AY/QT4MA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV BAMMCWxvY2FsaG9zdDAeFw0xNzExMDkyMTQ1NTBaFw0xNzEyMDkyMTQ1NTBaMBQx EjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAJTPk5nao0wG/EDFGnq7BvXMkEZ5oUVq7PAUxWi+E/byJk924l7Z5kACgWBa zQL0lLXLpdMk97EFGWMblz5Ehtqh7U8HaE9OZ6x/pesDTka+REnpXecklRrdZHX7 lfFnNIU58grPpB2GyUXrRdOtcPlaKXUo+VTd7PgwMtYVtt8pyTWxSB2MMYrqJGT8 78KX6trRzQLm7tas3U0jD59+R8j7gxU6FyFaNJBrkJ5T9kHGKOsAzSqZdCgRBjl5 i7xcXJfOAAnZ3jhGlY5DQht+HZDHhjkLG9kcZZhFDYteFk8drzbd3lBw96nLq+8A Sy92FtQL4GiYSwZ0WVAmwmTCGjUCAwEAAaNTMFEwHQYDVR0OBBYEFLYjwGKbcV9h sYHxe8l9UvXVivByMB8GA1UdIwQYMBaAFLYjwGKbcV9hsYHxe8l9UvXVivByMA8G A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHl7okBCJlms+cwfzLhs sbyyuX2wgngxyvjy497zBmeh1TiueGPhOx9u/sfJSZmoUaeRd/zPGkp2DcPQ+Lo2 EHYrXMPE1Ecgpu/15JZ8jNuE+FwZb9lllULLwzq8pDkdbdsSRltdV/rFlZ2YkscB c+xvVaCltw5KpKnY6AWHoqwoDcd8TZKzyKXLSuluKbHNC1lvg8cMzs6hFA9P92Ae 9P08AKLAIOGJ7QzRrXQIsAO4p9rHheeZeYQZyNiRrXPQUoWos4+OjynaNs+FabhN XBtSl/GGPRRRfU/D9v4iKfQx15CEvs1AKn1Z6mIPF05pSqbgIoz2mJBV6UM7e+hz TRs= -----END CERTIFICATE----- ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4382/reactions" }
https://api.github.com/repos/psf/requests/issues/4382/timeline
null
completed
null
null
false
[ "Requests *is* ignoring the certificate validation: the server you're using is closing the connection in our face after it sends the certificate to us. That is an issue with your server." ]
https://api.github.com/repos/psf/requests/issues/4381
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4381/labels{/name}
https://api.github.com/repos/psf/requests/issues/4381/comments
https://api.github.com/repos/psf/requests/issues/4381/events
https://github.com/psf/requests/issues/4381
272,981,702
MDU6SXNzdWUyNzI5ODE3MDI=
4,381
SSLError "bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],) with self signed certificate
{ "avatar_url": "https://avatars.githubusercontent.com/u/17707629?v=4", "events_url": "https://api.github.com/users/sg77/events{/privacy}", "followers_url": "https://api.github.com/users/sg77/followers", "following_url": "https://api.github.com/users/sg77/following{/other_user}", "gists_url": "https://api.github.com/users/sg77/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sg77", "id": 17707629, "login": "sg77", "node_id": "MDQ6VXNlcjE3NzA3NjI5", "organizations_url": "https://api.github.com/users/sg77/orgs", "received_events_url": "https://api.github.com/users/sg77/received_events", "repos_url": "https://api.github.com/users/sg77/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sg77/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sg77/subscriptions", "type": "User", "url": "https://api.github.com/users/sg77", "user_view_type": "public" }
[]
closed
true
null
[]
null
13
2017-11-10T16:09:37Z
2021-08-27T00:08:35Z
2017-11-14T18:56:35Z
NONE
resolved
Hello. I'm trying to connect to a server with https. I have the certificate which is a self signed certificate which is being included in the verify parameter but the result is an error 'certificate verify failed' error. I was suspecting it had to do with the certificate being self signed (by Microsoft IIS) but with curl this works. Thanks in advance! This is the openssl output: ``` openssl s_client -showcerts -connect server:44300 CONNECTED(00000003) depth=0 CN = server verify error:num=20:unable to get local issuer certificate verify return:1 depth=0 CN = server verify error:num=21:unable to verify the first certificate verify return:1 --- Certificate chain 0 s:/CN=server i:/CN=server -----BEGIN CERTIFICATE----- <certificate data here> -----END CERTIFICATE----- --- Server certificate subject=/CN=server issuer=/CN=server --- No client certificate CA names sent Peer signing digest: SHA1 Server Temp Key: ECDH, P-256, 256 bits --- SSL handshake has read 1477 bytes and written 431 bytes --- New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES256-GCM-SHA384 Session-ID: CC4A000083B1E03B446416C9C0B16CBEAB79949E3CF5C936A309A6F92FA01364 Session-ID-ctx: Master-Key: 798A570B0EC2A0CBB7C4C4DE6167E7579A92239942D869CD794B8BEBEA6EB5E492394634AD32665A8BB829DE1F3858D2 Key-Arg : None PSK identity: None PSK identity hint: None SRP username: None Start Time: 1510329948 Timeout : 300 (sec) Verify return code: 21 (unable to verify the first certificate) --- ``` ## Expected Result I'm expecting, since the certificate is in the verify parameter, that the connection won't fail. If I try the same with curl outside python it works: ``` curl https://server:44300 --cacert /usr/share/ca-certificates/server.crt HTTP/1.1 403 Forbidden Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Content-Length: 1158 Content-Type: text/html Server: Microsoft-IIS/10.0 X-Frame-Options: SAMEORIGIN P3P: CP=None Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS Access-Control-Allow-Headers: X-Requested-With,Content-Type Access-Control-Allow-Credentials: true Date: Fri, 10 Nov 2017 16:02:26 GMT ``` (It fails but not because of certificate issues) ## Actual Result ``` Traceback (most recent call last): File "<string>", line 1, in <module> File "xxxxx/TestVirtualEnv/local/lib/python2.7/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "xxxxx/TestVirtualEnv/local/lib/python2.7/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "xxxxx/TestVirtualEnv/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "xxxxx/TestVirtualEnv/local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "xxxxx/TestVirtualEnv/local/lib/python2.7/site-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='nlybstqvp4nb75n.code1.emi.philips.com', port=44300): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)) ``` ## Reproduction Steps ```python import requests requests.get('https://server:44300', verify='/usr/share/ca-certificates/server.crt') ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.1.3" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.12" }, "platform": { "release": "4.10.0-38-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010007f", "version": "17.3.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000207f" }, "urllib3": { "version": "1.22" }, "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/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4381/reactions" }
https://api.github.com/repos/psf/requests/issues/4381/timeline
null
completed
null
null
false
[ "BTW, this is Ubuntu 16.04", "This error is almost certainly because the certificate itself is invalid in some way. Can you provide the PEM-encoded certificate itself, please?", "Hi. Thanks for the quick answer. This is the certificate:\r\n-----BEGIN CERTIFICATE-----\r\nMIID3TCCAsWgAwIBAgIIU/nMdlbWojMwDQYJKoZIhvcNAQELBQAwMDEuMCwGA1UE\r\nAwwlTkxZQlNUUVZQNE5CNzVOLmNvZGUxLmVtaS5waGlsaXBzLmNvbTAeFw0xNzEx\r\nMTAwMDAwMDBaFw0yNzExMTAwMDAwMDBaMDAxLjAsBgNVBAMMJU5MWUJTVFFWUDRO\r\nQjc1Ti5jb2RlMS5lbWkucGhpbGlwcy5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB\r\nDwAwggEKAoIBAQC3mzWep6k1/FbkzzoyZ8QBy/tE8adfwKvw80zaLL+car1bBZ9U\r\nVIXs4es3babtjD3QJWP5/mwoBdIp8gvQkjA1X7RBNJZXbPz6hGR4eqaeRQLrFV9Y\r\nTtB92MA9CDpCXfalCvzzO1jw3zvP1BHUdnTQEwSnnwtf/Ryaud+e7TDxGq8LThmc\r\nglZgO8d2zaYpIjwWx92bXDF/qlqWBkH5mtKIkWOw6Y71xz0Di62cFrMAPEGBjK3c\r\nszpBa5Ttb9+SFtl16t2xDyCbiPFkoMW/4u3Husy/i18hLhEuQwZMHnWsocm+etZ4\r\n8fDt5Bqhab8zC+LKS+Ll7qZdqMHzobeB6j5JAgMBAAGjgfowgfcwXwYDVR0jBFgw\r\nVoAUGdJ3os9nPtTubuwcy1ugtDMdSMChNKQyMDAxLjAsBgNVBAMMJU5MWUJTVFFW\r\nUDROQjc1Ti5jb2RlMS5lbWkucGhpbGlwcy5jb22CCFP5zHZW1qIzMB0GA1UdDgQW\r\nBBQZ0neiz2c+1O5u7BzLW6C0Mx1IwDAMBgNVHRMBAf8EAjAAMAsGA1UdDwQEAwIE\r\nsDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwOwYDVR0RBDQwMoIlTkxZ\r\nQlNUUVZQNE5CNzVOLmNvZGUxLmVtaS5waGlsaXBzLmNvbYIJbG9jYWxob3N0MA0G\r\nCSqGSIb3DQEBCwUAA4IBAQC0MtflowNB4LTLKD1MW3w0QIY5ale3/sEhNCQgHGN5\r\niNZJptFuFt5jgPGmFjy0Pb5vLMS/Ag1RF3UgTeZzFnaSgyB4mTnwj1gLdwQidVcr\r\n2SlL7TffCj0m/bYjtNbwExRqXE4pQKb5RKwYwpruZaX/G3oHWOG9+2X9Pw5C42zB\r\nOFE4KvYUwOV+noabXvil8LERIdKYxR/2B6qBiwm47IcioqM07zTYLHJ+WDTEMO2k\r\nQy51yXwFmeOEr5MIBElYCQ0j2AfI4RCXr+2cyUym7tjEr3/I8EsZ5Crvdf++Gwaz\r\n2A05ScPMr+5yfVXygZCenMTwNAyUY1yN9zVj8/n94Psa\r\n-----END CERTIFICATE-----\r\nI know is not entirely valid. But somehow curl is able to accept it. I was wondering why requests does not do the same. I assumed both use openssl to validate the certificate. ", "Any updates on this? I am also facing issue with self sign certified sites in python request library. \r\n\r\nGetting below error.\r\n\r\n>>> requests.get('https://10.10.24.20', verify='/etc/ssl/certs/certSIGN_ROOT_CA.pem')\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 72, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 506, in send\r\n raise SSLError(e, request=request)\r\nrequests.exceptions.SSLError: HTTPSConnectionPool(host='10.10.24.20', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(\"bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)\",),))\r\n\r\n\r\n\r\nIf i keep verify False it works but i want it with verify=True", "I didn't see this before so I opened a new issue, sorry about that. But I'm facing same issue. For me 'request' fails even with verify=False.\r\n\r\n$ python\r\nPython 2.7.13 (default, Jan 19 2017, 14:48:08) \r\n[GCC 6.3.0 20170118] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> requests.get(\"https://localhost:9000/getcpuinfo\", verify=False)\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/lib/python2.7/dist-packages/requests/api.py\", line 70, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/usr/lib/python2.7/dist-packages/requests/api.py\", line 56, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 488, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/lib/python2.7/dist-packages/requests/sessions.py\", line 609, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/lib/python2.7/dist-packages/requests/adapters.py\", line 497, in send\r\n raise SSLError(e, request=request)\r\nrequests.exceptions.SSLError: (\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",)\r\n\r\nMy local certificate info is,\r\n```\r\n$ openssl s_client -showcerts -connect localhost:9000\r\nCONNECTED(00000003)\r\ndepth=0 CN = localhost\r\nverify error:num=18:self signed certificate\r\nverify return:1\r\ndepth=0 CN = localhost\r\nverify return:1\r\nwrite:errno=0\r\n---\r\nCertificate chain\r\n 0 s:/CN=localhost\r\n i:/CN=localhost\r\n-----BEGIN CERTIFICATE-----\r\nMIIC/jCCAeagAwIBAgIJAKATu2AY/QT4MA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV\r\nBAMMCWxvY2FsaG9zdDAeFw0xNzExMDkyMTQ1NTBaFw0xNzEyMDkyMTQ1NTBaMBQx\r\nEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\r\nggEBAJTPk5nao0wG/EDFGnq7BvXMkEZ5oUVq7PAUxWi+E/byJk924l7Z5kACgWBa\r\nzQL0lLXLpdMk97EFGWMblz5Ehtqh7U8HaE9OZ6x/pesDTka+REnpXecklRrdZHX7\r\nlfFnNIU58grPpB2GyUXrRdOtcPlaKXUo+VTd7PgwMtYVtt8pyTWxSB2MMYrqJGT8\r\n78KX6trRzQLm7tas3U0jD59+R8j7gxU6FyFaNJBrkJ5T9kHGKOsAzSqZdCgRBjl5\r\ni7xcXJfOAAnZ3jhGlY5DQht+HZDHhjkLG9kcZZhFDYteFk8drzbd3lBw96nLq+8A\r\nSy92FtQL4GiYSwZ0WVAmwmTCGjUCAwEAAaNTMFEwHQYDVR0OBBYEFLYjwGKbcV9h\r\nsYHxe8l9UvXVivByMB8GA1UdIwQYMBaAFLYjwGKbcV9hsYHxe8l9UvXVivByMA8G\r\nA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHl7okBCJlms+cwfzLhs\r\nsbyyuX2wgngxyvjy497zBmeh1TiueGPhOx9u/sfJSZmoUaeRd/zPGkp2DcPQ+Lo2\r\nEHYrXMPE1Ecgpu/15JZ8jNuE+FwZb9lllULLwzq8pDkdbdsSRltdV/rFlZ2YkscB\r\nc+xvVaCltw5KpKnY6AWHoqwoDcd8TZKzyKXLSuluKbHNC1lvg8cMzs6hFA9P92Ae\r\n9P08AKLAIOGJ7QzRrXQIsAO4p9rHheeZeYQZyNiRrXPQUoWos4+OjynaNs+FabhN\r\nXBtSl/GGPRRRfU/D9v4iKfQx15CEvs1AKn1Z6mIPF05pSqbgIoz2mJBV6UM7e+hz\r\nTRs=\r\n-----END CERTIFICATE-----\r\n---\r\nServer certificate\r\nsubject=/CN=localhost\r\nissuer=/CN=localhost\r\n---\r\nNo client certificate CA names sent\r\nPeer signing digest: SHA512\r\nServer Temp Key: ECDH, P-256, 256 bits\r\n---\r\nSSL handshake has read 1198 bytes and written 302 bytes\r\nVerification error: self signed certificate\r\n---\r\nNew, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256\r\nServer public key is 2048 bit\r\nSecure Renegotiation IS supported\r\nCompression: NONE\r\nExpansion: NONE\r\nNo ALPN negotiated\r\nSSL-Session:\r\n Protocol : TLSv1.2\r\n Cipher : ECDHE-RSA-AES128-GCM-SHA256\r\n Session-ID: \r\n Session-ID-ctx: \r\n Master-Key: 5311B8500C8AF327083E1465FE1E1A6A98E0996B4791150A01D6B130C7F0549909A4BDCDED388E9EDE124BB6C50E150A\r\n PSK identity: None\r\n PSK identity hint: None\r\n SRP username: None\r\n Start Time: 1510599077\r\n Timeout : 7200 (sec)\r\n Verify return code: 18 (self signed certificate)\r\n Extended master secret: no\r\n---\r\n```\r\n\r\n", "Please do not hijack this issue. In general you should be using Stack Overflow to ask these questions: if you overload the issue with requests you just make me inclined to close it.\r\n\r\n@sg77 Your certificate is marked `CA=FALSE`, which makes it ineligible to be an issuing certificate. I suspect curl is customising their code to use this certificate as a pin, rather than as a root CA. Requests does not do that: this certificate cannot be a root CA, so it does not validate.\r\n\r\nI recommend minting a new certificate with `CA=TRUE`, or omitting the BasicConstraints altogether.\r\n\r\n@ashwini-kaklij I have no idea why your verification is failing, because I can't see the certificate. Please *do not post it here*: direct your question to StackOverflow instead.\r\n\r\n@uttampawar Your error is caused by the server not liking our TLS handshake for some reason. In the absence of more details I cannot determine why. Please, again, take your question to Stack Overflow.", "@Lukasa I didn't mean to hijack the issue just elevate. May be this is a wrong place. I added my comments and observation since I saw it's of similar nature. I appreciate your feedback. I'll ask on stackoverflow. Thanks.", "> Please do not hijack this issue. In general you should be using Stack Overflow to ask these questions: if you overload the issue with requests you just make me inclined to close it.\r\n> \r\n> @sg77 Your certificate is marked `CA=FALSE`, which makes it ineligible to be an issuing certificate. I suspect curl is customising their code to use this certificate as a pin, rather than as a root CA. Requests does not do that: this certificate cannot be a root CA, so it does not validate.\r\n> \r\n> I recommend minting a new certificate with `CA=TRUE`, or omitting the BasicConstraints altogether.\r\n> \r\n> @ashwini-kaklij I have no idea why your verification is failing, because I can't see the certificate. Please _do not post it here_: direct your question to StackOverflow instead.\r\n> \r\n> @uttampawar Your error is caused by the server not liking our TLS handshake for some reason. In the absence of more details I cannot determine why. Please, again, take your question to Stack Overflow.\r\n\r\nHi Lukasa - Just seen your reply. You have replied to @sg77 saying \"Your certificate is marked `CA=FALSE`\". \r\n\r\nHow do you tell this is false and where/how can I set this back to TRUE?\r\n\r\nThanks.", "posting the certificate key online is like posting your password", "@Synida\r\n\r\n> posting the certificate key online is like posting your password\r\n\r\nUmm, no. Posting the certificate's *private key* is equivalent to your password.\r\n\r\nEvery CA in business has their certificate in every mainstream OS and browser. Are they giving their password away to everyone?\r\n\r\nhttps://en.wikipedia.org/wiki/Public-key_cryptography", "> This error is almost certainly because the certificate itself is invalid in some way. Can you provide the PEM-encoded certificate itself, please?\r\n\r\nhow can i access to this certificate ? ", "If you are beginner to python `requests` module and want to do some stuffs that requires accessing secure sites, there is high chance that you will be doomed by this error - `Certificate verify failed` and like all beginner programmers you will be tempted to use `auth = session.post( mysecureurl, verify=false)`\r\n\r\nBut this is very bad practice and have been discouraged over a lots of SO posts, but still beginners misuse this because the error is so sucky to fix. \r\nLet me attempt to throw some light on this issue. \r\nPython(pip) and Conda and whatsoever python based software uses separate **certificate store** just like all browsers do. The Python Requests library uses its [own CA file](https://incognitjoe.github.io/adding-certs-to-requests.html) by default, or will use the certifi package's certificate bundle if installed. Also, pip does not use the system certs unlike the `curl` do.\r\nHence the for the `requests` you have to manually specify the certificate store through the conda or pip. \r\n\r\nTldr;\r\n1. Export all the `.cer` encoded certificate chain using browser as per [this amazing blog](http://blog.majcica.com/2016/12/27/installing-self-signed-certificates-into-git-cert-store/) shown over here. Note, that blog is not about conda certstore but git certstore and it only says to export the root, however I exported **all the certificate chains into separate files**.\r\n2. Next, install `certifi` using command `pip install certifi`\r\n3. Check the default path of the cert store of conda or python:\r\n\r\n`import ssl`\r\n`ssl.get_default_verify_paths()` OR \r\n`import certifi`\r\n`certifi.where()`\r\n\r\n4. Once you have located the default `cacert.pem` file, open this (preferably into Notepad++) and append all the certificate at the end of file. (Take care of certificate demarcation `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`). Save the file and that is it. \r\nOr if you are using conda use the conda commands: \r\n`conda config --set ssl_verify <pathToYourFile>.crt`\r\n(I have noticed this command updates stuff in `C:\\Users\\johndoe\\.condarc`)\r\n\r\n5. Use the below code to verify: \r\n`import certifi`\r\n`auth = session.post('https://mysecuresite.com/', cert=());`\r\n\r\nAlso, if you are on linux, you can export custom cacert into system-wide or user profile (`.bashrc` or `.bash_profile`) using [this link](https://stackoverflow.com/questions/38571099/how-can-i-set-the-certificates-in-curl).\r\n\r\n", "Just in case it helps someone, I was getting the same error and was able to fix it by sending BOTH the verify parameter set to the path of the cert.pem AND the cert parameter set to a tuple of both the cert.pem and key.pem paths.:\r\n\r\n```\r\n cert_file_path = r'cert.pem'\r\n key_file_path = r'key.pem'\r\n cert = (cert_file_path, key_file_path)\r\n \r\n \r\n response_data = requests.post(url, data=data, headers=headers, verify=cert_file_path, cert=cert)\r\n\r\n```\r\n\r\nIf I only sent the verify parameter or only the cert parameter or verify=True and the cert parameter I would get the error. The above method was the only one that worked.\r\n\r\n" ]
https://api.github.com/repos/psf/requests/issues/4380
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4380/labels{/name}
https://api.github.com/repos/psf/requests/issues/4380/comments
https://api.github.com/repos/psf/requests/issues/4380/events
https://github.com/psf/requests/pull/4380
272,844,649
MDExOlB1bGxSZXF1ZXN0MTUxODQzNTA5
4,380
utils: winreg module may not exist like on windows universal platform.
{ "avatar_url": "https://avatars.githubusercontent.com/u/2063885?v=4", "events_url": "https://api.github.com/users/afedchin/events{/privacy}", "followers_url": "https://api.github.com/users/afedchin/followers", "following_url": "https://api.github.com/users/afedchin/following{/other_user}", "gists_url": "https://api.github.com/users/afedchin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/afedchin", "id": 2063885, "login": "afedchin", "node_id": "MDQ6VXNlcjIwNjM4ODU=", "organizations_url": "https://api.github.com/users/afedchin/orgs", "received_events_url": "https://api.github.com/users/afedchin/received_events", "repos_url": "https://api.github.com/users/afedchin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/afedchin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/afedchin/subscriptions", "type": "User", "url": "https://api.github.com/users/afedchin", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2017-11-10T07:35:33Z
2021-09-04T00:06:36Z
2017-11-27T20:39:16Z
CONTRIBUTOR
resolved
UWP has no API to get access to windows registry, so python has no winreg module on UWP. This fixes unexpected error on UWP.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4380/reactions" }
https://api.github.com/repos/psf/requests/issues/4380/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4380.diff", "html_url": "https://github.com/psf/requests/pull/4380", "merged_at": "2017-11-27T20:39:16Z", "patch_url": "https://github.com/psf/requests/pull/4380.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4380" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4380?src=pr&el=h1) Report\n> Merging [#4380](https://codecov.io/gh/requests/requests/pull/4380?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/d1fb1a29ab949223d8d64797e0fcc9a7d2690483?src=pr&el=desc) will **decrease** coverage by `0.08%`.\n> The diff coverage is `66.66%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4380/graphs/tree.svg?src=pr&width=650&token=mZGswIiXLa&height=150)](https://codecov.io/gh/requests/requests/pull/4380?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4380 +/- ##\n=========================================\n- Coverage 89.08% 89% -0.09% \n=========================================\n Files 18 18 \n Lines 2062 2065 +3 \n=========================================\n+ Hits 1837 1838 +1 \n- Misses 225 227 +2\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4380?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4380?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `86.35% <66.66%> (-0.38%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4380?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4380?src=pr&el=footer). Last update [d1fb1a2...351ec98](https://codecov.io/gh/requests/requests/pull/4380?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@Lukasa I've updated the PR", "@Lukasa done", "rebased on current master" ]
https://api.github.com/repos/psf/requests/issues/4379
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4379/labels{/name}
https://api.github.com/repos/psf/requests/issues/4379/comments
https://api.github.com/repos/psf/requests/issues/4379/events
https://github.com/psf/requests/issues/4379
272,439,890
MDU6SXNzdWUyNzI0Mzk4OTA=
4,379
Error in request: EOF occurred in violation of protocol (_ssl.c:590)
{ "avatar_url": "https://avatars.githubusercontent.com/u/8120377?v=4", "events_url": "https://api.github.com/users/w888/events{/privacy}", "followers_url": "https://api.github.com/users/w888/followers", "following_url": "https://api.github.com/users/w888/following{/other_user}", "gists_url": "https://api.github.com/users/w888/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/w888", "id": 8120377, "login": "w888", "node_id": "MDQ6VXNlcjgxMjAzNzc=", "organizations_url": "https://api.github.com/users/w888/orgs", "received_events_url": "https://api.github.com/users/w888/received_events", "repos_url": "https://api.github.com/users/w888/repos", "site_admin": false, "starred_url": "https://api.github.com/users/w888/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/w888/subscriptions", "type": "User", "url": "https://api.github.com/users/w888", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2017-11-09T04:49:27Z
2021-09-08T05:00:46Z
2017-11-28T13:14:14Z
NONE
resolved
Summary. ## Expected Result No exception ## Actual Result ``` INFO:root:Updating jobs in ['vm_docker_test.yaml'] ([]) Traceback (most recent call last): File "/usr/local/Cellar/jenkins-job-builder/1.6.2/libexec/bin/jenkins-jobs", line 10, in <module> sys.exit(main()) File "/usr/local/Cellar/jenkins-job-builder/1.6.2/libexec/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 191, in main execute(options, config) File "/usr/local/Cellar/jenkins-job-builder/1.6.2/libexec/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 372, in execute n_workers=options.n_workers) File "/usr/local/Cellar/jenkins-job-builder/1.6.2/libexec/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 348, in update_jobs self.load_files(input_fn) File "/usr/local/Cellar/jenkins-job-builder/1.6.2/libexec/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 245, in load_files self.parser = YamlParser(self.global_config, self.plugins_list) File "/usr/local/Cellar/jenkins-job-builder/1.6.2/libexec/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 241, in plugins_list self._plugins_list = self.jenkins.get_plugins_info() File "/usr/local/Cellar/jenkins-job-builder/1.6.2/libexec/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 205, in get_plugins_info raise e jenkins.JenkinsException: Error in request: EOF occurred in violation of protocol (_ssl.c:590) ``` ## Reproduction Steps i am trying to create a jenkins jobs through jjb ``` jenkins-jobs --conf ./jenkins_jobs.ini update vm_docker_test.yaml ``` where jenkins_jobs.ini ``` [job_builder] ignore_cache=True keep_descriptions=False recursive=False exclude=.*:manual:./development allow_duplicates=False allow_empty_variables=True [jenkins] user=someuser password=somepassword url=https://subdomain.company.com/jenkins/group query_plugins_info=True ``` ## System Information ``` openssl version OpenSSL 1.0.2l 25 May 2017 pip freeze asn1crypto==0.23.0 certifi==2017.7.27.1 cffi==1.11.2 chardet==3.0.4 cryptography==2.1.2 Cython==0.27.1 enum34==1.1.6 http-client==0.1.22 idna==2.5 ipaddress==1.0.18 ndg-httpsclient==0.4.3 pyasn1==0.3.7 pycparser==2.18 pycurl==7.43.0 pyOpenSSL==17.3.0 requests==2.18.4 six==1.11.0 urllib3==1.22 ```
{ "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/4379/reactions" }
https://api.github.com/repos/psf/requests/issues/4379/timeline
null
completed
null
null
false
[ "It seems like your Jenkins doesn't like our TLS handshake. Can you run `openssl s_client -connect jenkins_host:jenkins_port` and provide the output here?", "Hi @w888,\r\n\r\nIt seems this isn't an issue for you any longer. If I'm wrong, please provide us with the information that @Lukasa requested.\r\n\r\nUntil we have that information, I'm closing this issue because it does not have enough information for us to act on it.\r\n\r\nCheers,\r\nIan", "I am hit the same error. sending some REST API call via requests\r\n\r\n>>> r = requests.post(url=url,headers=headers,data=json.dumps(Data),verify=False)\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/Library/Python/2.7/site-packages/requests/api.py\", line 112, in post\r\n return request('post', url, data=data, json=json, **kwargs)\r\n File \"/Library/Python/2.7/site-packages/requests/api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/Library/Python/2.7/site-packages/requests/sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/Library/Python/2.7/site-packages/requests/sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/Library/Python/2.7/site-packages/requests/adapters.py\", line 506, in send\r\n raise SSLError(e, request=request)\r\nrequests.exceptions.SSLError: HTTPSConnectionPool(host='172.16.76.172', port=443): Max retries exceeded with url: /tssm/onboard-tenant (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:590)'),))\r\n\r\n$ openssl version\r\nOpenSSL 1.0.2m 2 Nov 2017\r\n$ python --version\r\nPython 2.7.10\r\n" ]
https://api.github.com/repos/psf/requests/issues/4378
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4378/labels{/name}
https://api.github.com/repos/psf/requests/issues/4378/comments
https://api.github.com/repos/psf/requests/issues/4378/events
https://github.com/psf/requests/pull/4378
272,411,012
MDExOlB1bGxSZXF1ZXN0MTUxNTQxMzE4
4,378
for RFC-7616 add SHA-256 and SHA-512
{ "avatar_url": "https://avatars.githubusercontent.com/u/438131?v=4", "events_url": "https://api.github.com/users/linuxlizard/events{/privacy}", "followers_url": "https://api.github.com/users/linuxlizard/followers", "following_url": "https://api.github.com/users/linuxlizard/following{/other_user}", "gists_url": "https://api.github.com/users/linuxlizard/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/linuxlizard", "id": 438131, "login": "linuxlizard", "node_id": "MDQ6VXNlcjQzODEzMQ==", "organizations_url": "https://api.github.com/users/linuxlizard/orgs", "received_events_url": "https://api.github.com/users/linuxlizard/received_events", "repos_url": "https://api.github.com/users/linuxlizard/repos", "site_admin": false, "starred_url": "https://api.github.com/users/linuxlizard/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/linuxlizard/subscriptions", "type": "User", "url": "https://api.github.com/users/linuxlizard", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2017-11-09T01:38:02Z
2021-09-04T00:06:38Z
2017-11-29T14:08:31Z
CONTRIBUTOR
resolved
While working with some FIPS libraries that disabled MD5, we ran into a problem with our Requests based tools not being able to talk to our server. <img width="1440" alt="screen shot 2017-11-08 at 4 19 47 pm" src="https://user-images.githubusercontent.com/438131/32584052-c4a29c36-c4b3-11e7-8ca1-7601c60c60f2.png"> I haven't fully read the RFC-7616 SHA-256 and SHA-512 standards but this patch works. Thanks for Requests!
{ "avatar_url": "https://avatars.githubusercontent.com/u/438131?v=4", "events_url": "https://api.github.com/users/linuxlizard/events{/privacy}", "followers_url": "https://api.github.com/users/linuxlizard/followers", "following_url": "https://api.github.com/users/linuxlizard/following{/other_user}", "gists_url": "https://api.github.com/users/linuxlizard/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/linuxlizard", "id": 438131, "login": "linuxlizard", "node_id": "MDQ6VXNlcjQzODEzMQ==", "organizations_url": "https://api.github.com/users/linuxlizard/orgs", "received_events_url": "https://api.github.com/users/linuxlizard/received_events", "repos_url": "https://api.github.com/users/linuxlizard/repos", "site_admin": false, "starred_url": "https://api.github.com/users/linuxlizard/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/linuxlizard/subscriptions", "type": "User", "url": "https://api.github.com/users/linuxlizard", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4378/reactions" }
https://api.github.com/repos/psf/requests/issues/4378/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4378.diff", "html_url": "https://github.com/psf/requests/pull/4378", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4378.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4378" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4378?src=pr&el=h1) Report\n> Merging [#4378](https://codecov.io/gh/requests/requests/pull/4378?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/c3f2553114fdaf83b9c646a73987bbd2f13285e1?src=pr&el=desc) will **decrease** coverage by `0.51%`.\n> The diff coverage is `0%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4378/graphs/tree.svg?token=mZGswIiXLa&width=650&height=150&src=pr)](https://codecov.io/gh/requests/requests/pull/4378?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4378 +/- ##\n==========================================\n- Coverage 88.36% 87.85% -0.52% \n==========================================\n Files 18 18 \n Lines 2055 2067 +12 \n==========================================\n Hits 1816 1816 \n- Misses 239 251 +12\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4378?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/auth.py](https://codecov.io/gh/requests/requests/pull/4378?src=pr&el=tree#diff-cmVxdWVzdHMvYXV0aC5weQ==) | `80.45% <0%> (-5.96%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4378?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4378?src=pr&el=footer). Last update [c3f2553...a31531f](https://codecov.io/gh/requests/requests/pull/4378?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Could you add test cases for this, please?", "Can do.", "Status: I'm reaching out to Requests developers listed in \"contributing\" for some assistance adding tests. ", "Status update: Twitter reply from @lukasaoz \r\n\"  | Lukasaoz @linuxlizard I doubt httpbin supports these auth modes yet so you may need to begin by adding support there. Alternatively you can use code like test_lowlevel.py to force the correct responses.Nov 14, 2017, 12:01 PM\r\n-- | --\r\n\r\nI'm going to investigate that approach.\r\n", "Status update: Twitter reply from @lukasaoz \r\n\"  | Lukasaoz @linuxlizard I doubt httpbin supports these auth modes yet so you may need to begin by adding support there. Alternatively you can use code like test_lowlevel.py to force the correct responses.Nov 14, 2017, 12:01 PM\r\n-- | --\r\n\r\nI'm going to investigate that approach.\r\n", "Created pull request for httpbin to add SHA-512 support.\r\nhttps://github.com/kennethreitz/httpbin/pull/401\r\n", "Thanksgiving over. httpbin patch accepted. Back to work on learning how to add tests to Requests.\r\n", "Shutting down this pull request. Creating a new pull request with test code." ]
https://api.github.com/repos/psf/requests/issues/4377
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4377/labels{/name}
https://api.github.com/repos/psf/requests/issues/4377/comments
https://api.github.com/repos/psf/requests/issues/4377/events
https://github.com/psf/requests/pull/4377
271,849,469
MDExOlB1bGxSZXF1ZXN0MTUxMTI2Njc4
4,377
#4373, fix possible winreg value type difference
{ "avatar_url": "https://avatars.githubusercontent.com/u/1170592?v=4", "events_url": "https://api.github.com/users/mingyuan-xia/events{/privacy}", "followers_url": "https://api.github.com/users/mingyuan-xia/followers", "following_url": "https://api.github.com/users/mingyuan-xia/following{/other_user}", "gists_url": "https://api.github.com/users/mingyuan-xia/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mingyuan-xia", "id": 1170592, "login": "mingyuan-xia", "node_id": "MDQ6VXNlcjExNzA1OTI=", "organizations_url": "https://api.github.com/users/mingyuan-xia/orgs", "received_events_url": "https://api.github.com/users/mingyuan-xia/received_events", "repos_url": "https://api.github.com/users/mingyuan-xia/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mingyuan-xia/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mingyuan-xia/subscriptions", "type": "User", "url": "https://api.github.com/users/mingyuan-xia", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2017-11-07T14:25:49Z
2021-09-04T00:06:40Z
2017-11-20T20:01:05Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4377/reactions" }
https://api.github.com/repos/psf/requests/issues/4377/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4377.diff", "html_url": "https://github.com/psf/requests/pull/4377", "merged_at": "2017-11-20T20:01:05Z", "patch_url": "https://github.com/psf/requests/pull/4377.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4377" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4377?src=pr&el=h1) Report\n> Merging [#4377](https://codecov.io/gh/requests/requests/pull/4377?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/e4fc3539b43416f9e9ba6837d73b1b7392d4b242?src=pr&el=desc) will **increase** coverage by `0.68%`.\n> The diff coverage is `100%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4377/graphs/tree.svg?height=150&width=650&token=mZGswIiXLa&src=pr)](https://codecov.io/gh/requests/requests/pull/4377?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4377 +/- ##\n==========================================\n+ Coverage 88.36% 89.05% +0.68% \n==========================================\n Files 18 18 \n Lines 2055 2055 \n==========================================\n+ Hits 1816 1830 +14 \n+ Misses 239 225 -14\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4377?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4377?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `86.72% <100%> (+3.31%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4377?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4377?src=pr&el=footer). Last update [e4fc353...7e1fb02](https://codecov.io/gh/requests/requests/pull/4377?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "It seems that `test_should_bypass_proxies_win_registry` only monkeypatches WinReg but never tests anything (no assert~). Will adding another monkeypatch there be sufficient?", "Since we already have multiple parameterized tests, I simply rotate the `ProxyEnable` Windows registry key type per test to simulate the case. Also I have added an assertion to test the proxy selection as it was supposed to be there.", "Looks like the tests are failing: mind addressing the test failures?", "Hi @mingyuan-xia the tests are passing but the branch isn't up-to-date with master. If you can fix that up, I think we can finally accept this work. 👍 ", "Ok I will pull from the master and please squash my commits into one to make things more concise." ]
https://api.github.com/repos/psf/requests/issues/4376
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4376/labels{/name}
https://api.github.com/repos/psf/requests/issues/4376/comments
https://api.github.com/repos/psf/requests/issues/4376/events
https://github.com/psf/requests/issues/4376
271,639,730
MDU6SXNzdWUyNzE2Mzk3MzA=
4,376
SSLError when requests deportesweb.madrid.es
{ "avatar_url": "https://avatars.githubusercontent.com/u/5998601?v=4", "events_url": "https://api.github.com/users/s-nt-s/events{/privacy}", "followers_url": "https://api.github.com/users/s-nt-s/followers", "following_url": "https://api.github.com/users/s-nt-s/following{/other_user}", "gists_url": "https://api.github.com/users/s-nt-s/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/s-nt-s", "id": 5998601, "login": "s-nt-s", "node_id": "MDQ6VXNlcjU5OTg2MDE=", "organizations_url": "https://api.github.com/users/s-nt-s/orgs", "received_events_url": "https://api.github.com/users/s-nt-s/received_events", "repos_url": "https://api.github.com/users/s-nt-s/repos", "site_admin": false, "starred_url": "https://api.github.com/users/s-nt-s/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/s-nt-s/subscriptions", "type": "User", "url": "https://api.github.com/users/s-nt-s", "user_view_type": "public" }
[]
closed
true
null
[]
null
14
2017-11-06T22:13:47Z
2021-09-08T06:00:29Z
2017-11-07T20:45:56Z
NONE
resolved
`ssl.SSLEOFError: EOF occurred in violation of protocol ` when requests `deportesweb.madrid.es` ## Reproduction Steps ```console Python 3.5.2 (default, Sep 14 2017, 22:51:06) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> s = requests.Session() >>> s.get("https://deportesweb.madrid.es/deportesWeb/Login", verify=False) Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 560, in urlopen body=body, headers=headers) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 787, in _validate_conn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 252, in connect ssl_version=resolved_ssl_version) File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 305, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.5/ssl.py", line 377, in wrap_socket _context=self) File "/usr/lib/python3.5/ssl.py", line 752, in __init__ self.do_handshake() File "/usr/lib/python3.5/ssl.py", line 988, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.5/ssl.py", line 633, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:645) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 376, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 589, in urlopen raise SSLError(e) requests.packages.urllib3.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:645) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3/dist-packages/requests/sessions.py", line 480, in get return self.request('GET', url, **kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 468, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 447, in send raise SSLError(e, request=request) requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:645) ``` ## System Information ``` $ python3 -m requests.help /usr/bin/python3: No module named requests.help $ python3 --version Python 3.5.2 $ python3 -c "import requests; print (requests.__version__)" 2.9.1 $ uname -a Linux yamato 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux ``` https://www.ssllabs.com/ssltest/analyze.html?d=deportesweb.madrid.es&hideResults=on ## Second try ```console $ sudo pip3 install -U requests Collecting requests Downloading requests-2.18.4-py2.py3-none-any.whl (88kB) 100% |████████████████████████████████| 92kB 270kB/s Collecting urllib3<1.23,>=1.21.1 (from requests) Downloading urllib3-1.22-py2.py3-none-any.whl (132kB) 100% |████████████████████████████████| 133kB 193kB/s Collecting chardet<3.1.0,>=3.0.2 (from requests) Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB) 100% |████████████████████████████████| 143kB 305kB/s Collecting idna<2.7,>=2.5 (from requests) Downloading idna-2.6-py2.py3-none-any.whl (56kB) 100% |████████████████████████████████| 61kB 562kB/s Collecting certifi>=2017.4.17 (from requests) Downloading certifi-2017.11.5-py2.py3-none-any.whl (330kB) 100% |████████████████████████████████| 337kB 93kB/s Installing collected packages: urllib3, chardet, idna, certifi, requests Found existing installation: urllib3 1.13.1 Uninstalling urllib3-1.13.1: Successfully uninstalled urllib3-1.13.1 Found existing installation: chardet 2.3.0 Uninstalling chardet-2.3.0: Successfully uninstalled chardet-2.3.0 Found existing installation: idna 2.0 Uninstalling idna-2.0: Successfully uninstalled idna-2.0 Found existing installation: requests 2.9.1 Uninstalling requests-2.9.1: Successfully uninstalled requests-2.9.1 Successfully installed certifi-2017.11.5 chardet-3.0.4 idna-2.6 requests-2.18.4 urllib3-1.22 $ python3 -c "import requests; print (requests.__version__)" 2.18.4 $ python3 -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.5.2" }, "platform": { "release": "4.4.0-53-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000207f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } $ python3 Python 3.5.2 (default, Sep 14 2017, 22:51:06) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> s = requests.Session() >>> s.get("https://deportesweb.madrid.es/deportesWeb/Login", verify=False) Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 850, in _validate_conn conn.connect() File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 326, in connect ssl_context=context) File "/usr/local/lib/python3.5/dist-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.5/ssl.py", line 377, in wrap_socket _context=self) File "/usr/lib/python3.5/ssl.py", line 752, in __init__ self.do_handshake() File "/usr/lib/python3.5/ssl.py", line 988, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.5/ssl.py", line 633, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:645) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 440, in send timeout=timeout File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='deportesweb.madrid.es', port=443): Max retries exceeded with url: /deportesWeb/Login (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:645)'),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 521, in get return self.request('GET', url, **kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='deportesweb.madrid.es', port=443): Max retries exceeded with url: /deportesWeb/Login (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:645)'),)) ``` ## Third try ```console $ sudo pip3 install -U pyopenssl Collecting pyopenssl Downloading pyOpenSSL-17.3.0-py2.py3-none-any.whl (51kB) 100% |████████████████████████████████| 51kB 1.1MB/s Collecting cryptography>=1.9 (from pyopenssl) Downloading cryptography-2.1.3-cp35-cp35m-manylinux1_x86_64.whl (2.2MB) 100% |████████████████████████████████| 2.2MB 242kB/s Collecting six>=1.5.2 (from pyopenssl) Downloading six-1.11.0-py2.py3-none-any.whl Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=1.9->pyopenssl) Downloading cffi-1.11.2-cp35-cp35m-manylinux1_x86_64.whl (419kB) 100% |████████████████████████████████| 419kB 1.3MB/s Collecting asn1crypto>=0.21.0 (from cryptography>=1.9->pyopenssl) Downloading asn1crypto-0.23.0-py2.py3-none-any.whl (99kB) 100% |████████████████████████████████| 102kB 3.7MB/s Requirement already up-to-date: idna>=2.1 in /usr/local/lib/python3.5/dist-packages (from cryptography>=1.9->pyopenssl) Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=1.9->pyopenssl) Downloading pycparser-2.18.tar.gz (245kB) 100% |████████████████████████████████| 256kB 1.6MB/s Installing collected packages: six, pycparser, cffi, asn1crypto, cryptography, pyopenssl Found existing installation: six 1.10.0 Uninstalling six-1.10.0: Successfully uninstalled six-1.10.0 Running setup.py install for pycparser ... done Found existing installation: cryptography 1.2.3 Uninstalling cryptography-1.2.3: Successfully uninstalled cryptography-1.2.3 Successfully installed asn1crypto-0.23.0 cffi-1.11.2 cryptography-2.1.3 pycparser-2.18 pyopenssl-17.3.0 six-1.11.0 $ python3 Python 3.5.2 (default, Sep 14 2017, 22:51:06) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> s = requests.Session() >>> s.get("https://deportesweb.madrid.es/deportesWeb/Login", verify=False) Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/urllib3/contrib/pyopenssl.py", line 441, in wrap_socket cnx.do_handshake() File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 1716, in do_handshake self._raise_ssl_error(self._ssl, result) File "/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py", line 1449, in _raise_ssl_error raise SysCallError(-1, "Unexpected EOF") OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 850, in _validate_conn conn.connect() File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 326, in connect ssl_context=context) File "/usr/local/lib/python3.5/dist-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/local/lib/python3.5/dist-packages/urllib3/contrib/pyopenssl.py", line 448, in wrap_socket raise ssl.SSLError('bad handshake: %r' % e) ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 440, in send timeout=timeout File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='deportesweb.madrid.es', port=443): Max retries exceeded with url: /deportesWeb/Login (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 521, in get return self.request('GET', url, **kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='deportesweb.madrid.es', port=443): Max retries exceeded with url: /deportesWeb/Login (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4376/reactions" }
https://api.github.com/repos/psf/requests/issues/4376/timeline
null
completed
null
null
false
[ "It's an error on `deportesweb.madrid.es` side.\r\n\r\n```\r\n$ wget https://deportesweb.madrid.es/deportesWeb/Login\r\n\r\n--2017-11-07 09:20:51-- https://deportesweb.madrid.es/deportesWeb/Login\r\nResolving deportesweb.madrid.es... 195.55.79.160\r\nConnecting to deportesweb.madrid.es|195.55.79.160|:443... connected.\r\nUnable to establish SSL connection.\r\n```", "Yes, but it is becouse you are trying validate the certificate, and I didn't that becouse I'm using `verify=False`.\r\n\r\nSo the equivalent in wget would be:\r\n\r\n````console\r\nwget https://deportesweb.madrid.es/deportesWeb/Login --no-check-certificate\r\n--2017-11-07 11:02:55-- https://deportesweb.madrid.es/deportesWeb/Login\r\nResolving *** my proxy ***\r\nConnecting to *** my proxy ***|:8080... connected.\r\nWARNING: cannot verify deportesweb.madrid.es's certificate, issued by `/C=US/O=GeoTrust Inc./CN=GeoTrust SSL CA - G3':\r\n Unable to locally verify the issuer's authority.\r\nProxy request sent, awaiting response... 200 OK\r\nLength: 10058 (9.8K) [text/html]\r\nSaving to: `Login'\r\n\r\n100%[====================================================================================================================================>] 10,058 --.-K/s in 0s\r\n\r\n2017-11-07 11:02:55 (91.9 MB/s) - `Login' saved [10058/10058]\r\n````", "What if you don't use a proxy? It still does not work here even with `--no-check-certificate`\r\n```\r\n$ wget --no-check-certificate https://deportesweb.madrid.es/deportesWeb/Login\r\n--2017-11-07 11:47:10-- https://deportesweb.madrid.es/deportesWeb/Login\r\nResolving deportesweb.madrid.es... 195.55.79.160\r\nConnecting to deportesweb.madrid.es|195.55.79.160|:443... connected.\r\nUnable to establish SSL connection.\r\n```", "Without proxy:\r\n\r\n````console\r\n$ wget --no-check-certificate https://deportesweb.madrid.es/deportesWeb/Login\r\nconverted 'https://deportesweb.madrid.es/deportesWeb/Login' (ANSI_X3.4-1968) -> 'https://deportesweb.madrid.es/deportesWeb/Login' (UTF-8)\r\n--2017-11-07 11:58:50-- https://deportesweb.madrid.es/deportesWeb/Login\r\nResolving deportesweb.madrid.es (deportesweb.madrid.es)... 195.55.79.160\r\nConnecting to deportesweb.madrid.es (deportesweb.madrid.es)|195.55.79.160|:443... connected.\r\nWARNING: The certificate of 'deportesweb.madrid.es' is not trusted.\r\nWARNING: The certificate of 'deportesweb.madrid.es' hasn't got a known issuer.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: 10058 (9.8K) [text/html]\r\nSaving to: 'Login.1'\r\n\r\nLogin.1 100%[=====================================================================>] 9.82K --.-KB/s in 0.001s\r\n\r\n2017-11-07 11:58:52 (10.5 MB/s) - 'Login.1' saved [10058/10058]\r\n````", "I have tried that https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/ from @Lukasa but it isn't worked.\r\nI think my issue is the same at https://github.com/requests/requests/issues/3833 and https://github.com/requests/requests/issues/3774 but I don't know why can't do work the same solution.\r\n\r\n```python\r\nimport requests\r\nfrom requests.adapters import HTTPAdapter\r\nfrom requests.packages.urllib3.util.ssl_ import create_urllib3_context\r\n\r\nCIPHERS = (\r\n 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'\r\n 'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'\r\n '!eNULL:!MD5'\r\n)\r\n\r\nclass DESAdapter(HTTPAdapter):\r\n def init_poolmanager(self, *args, **kwargs):\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).init_poolmanager(*args, **kwargs)\r\n def proxy_manager_for(self, *args, **kwargs):\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).proxy_manager_for(*args, **kwargs)\r\n\r\ns = requests.Session()\r\ns.mount('https://deportesweb.madrid.es', DESAdapter())\r\nr = s.get('https://deportesweb.madrid.es/deportesWeb/Login', verify=False)\r\nprint (r.text)\r\n```\r\n=\r\n```console\r\n$ python3 ej.py \r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/contrib/pyopenssl.py\", line 441, in wrap_socket\r\n cnx.do_handshake()\r\n File \"/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py\", line 1716, in do_handshake\r\n self._raise_ssl_error(self._ssl, result)\r\n File \"/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py\", line 1449, in _raise_ssl_error\r\n raise SysCallError(-1, \"Unexpected EOF\")\r\nOpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 601, in urlopen\r\n chunked=chunked)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 346, in _make_request\r\n self._validate_conn(conn)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 850, in _validate_conn\r\n conn.connect()\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connection.py\", line 326, in connect\r\n ssl_context=context)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/util/ssl_.py\", line 329, in ssl_wrap_socket\r\n return context.wrap_socket(sock, server_hostname=server_hostname)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/contrib/pyopenssl.py\", line 448, in wrap_socket\r\n raise ssl.SSLError('bad handshake: %r' % e)\r\nssl.SSLError: (\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/adapters.py\", line 440, in send\r\n timeout=timeout\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py\", line 639, in urlopen\r\n _stacktrace=sys.exc_info()[2])\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py\", line 388, in increment\r\n raise MaxRetryError(_pool, url, error or ResponseError(cause))\r\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='deportesweb.madrid.es', port=443): Max retries exceeded with url: /deportesWeb/Login (Caused by SSLError(SSLError(\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",),))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"ej.py\", line 23, in <module>\r\n r = s.get('https://deportesweb.madrid.es/deportesWeb/Login', verify=False)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 521, in get\r\n return self.request('GET', url, **kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/adapters.py\", line 506, in send\r\n raise SSLError(e, request=request)\r\nrequests.exceptions.SSLError: HTTPSConnectionPool(host='deportesweb.madrid.es', port=443): Max retries exceeded with url: /deportesWeb/Login (Caused by SSLError(SSLError(\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",),))\r\n```", "This server is a complete tire fire, and the humane thing would be to have it taken out the back and put down. In this case it seems to be seeing cipher suites it doesn't recognise and literally shutting the handshake down, instead of selecting the one it knows it can handle. This is awful behaviour.\r\n\r\nRegardless, you can fix it by tweaking `CIPHERS` in your code to just be `'RSA+3DES:!aNULL:!eNULL:!MD5'`. This is a godawful configuration, but it'll work.", "Thanks, but with:\r\n```python\r\nimport requests\r\nfrom requests.adapters import HTTPAdapter\r\nfrom requests.packages.urllib3.util.ssl_ import create_urllib3_context\r\nimport ssl\r\n\r\nCIPHERS = 'RSA+3DES:!aNULL:!eNULL:!MD5'\r\n\r\nclass DESAdapter(HTTPAdapter):\r\n def init_poolmanager(self, *args, **kwargs):\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).init_poolmanager(*args, **kwargs)\r\n \r\n def proxy_manager_for(self, *args, **kwargs):\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n return super(DESAdapter, self).proxy_manager_for(*args, **kwargs)\r\n\r\ns = requests.Session()\r\ns.mount('https://deportesweb.madrid.es', DESAdapter())\r\nr = s.get('https://deportesweb.madrid.es/deportesWeb/Login', verify=False)\r\nprint (r.text)\r\n```\r\nI get:\r\n\r\n```console\r\n$ python3 ej.py \r\nTraceback (most recent call last):\r\n File \"ej.py\", line 20, in <module>\r\n s.mount('https://deportesweb.madrid.es', DESAdapter())\r\n File \"/usr/local/lib/python3.5/dist-packages/requests/adapters.py\", line 126, in __init__\r\n self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block)\r\n File \"ej.py\", line 10, in init_poolmanager\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/util/ssl_.py\", line 272, in create_urllib3_context\r\n context.set_ciphers(ciphers or DEFAULT_CIPHERS)\r\n File \"/usr/local/lib/python3.5/dist-packages/urllib3/contrib/pyopenssl.py\", line 409, in set_ciphers\r\n self._ctx.set_cipher_list(ciphers)\r\n File \"/usr/local/lib/python3.5/dist-packages/OpenSSL/SSL.py\", line 1051, in set_cipher_list\r\n _lib.SSL_CTX_set_cipher_list(self._context, cipher_list) == 1\r\n File \"/usr/local/lib/python3.5/dist-packages/OpenSSL/_util.py\", line 67, in openssl_assert\r\n exception_from_error_queue(error)\r\n File \"/usr/local/lib/python3.5/dist-packages/OpenSSL/_util.py\", line 54, in exception_from_error_queue\r\n raise exception_type(errors)\r\nOpenSSL.SSL.Error: [('SSL routines', 'SSL_CTX_set_cipher_list', 'no cipher match')]\r\n```", "What's the output of running this shell command: `openssl ciphers RSA+3DES:!aNULL:!eNULL:!MD5`", "```console\r\n$ openssl ciphers RSA+3DES:\\!aNULL:\\!eNULL:\\!MD5\r\nDES-CBC3-SHA\r\n```", "Hrm. Is that the same OpenSSL your Python is compiled against?", "I think so:\r\n\r\n```console\r\n$ python3 -c \"import ssl; print(ssl.OPENSSL_VERSION)\"\r\nOpenSSL 1.0.2g 1 Mar 2016\r\n$ openssl version\r\nOpenSSL 1.0.2g 1 Mar 2016\r\n```\r\nbut I have checked the code in other computer and works, so it is sure that the problem is my local configuration.", "That's very perplexing. The cipher suite string appears to work fine for the command line, but for some reason the Python code is rejecting it: I have no idea why.", "What is the openssl version on the other (EDIT: where it's working) computer?", "In where it's working:\r\n````console\r\n$ python3 -c \"import ssl; print(ssl.OPENSSL_VERSION)\"\r\nOpenSSL 1.0.1t 3 May 2016\r\n$ openssl version\r\nOpenSSL 1.0.1t 3 May 2016\r\n````" ]
https://api.github.com/repos/psf/requests/issues/4375
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4375/labels{/name}
https://api.github.com/repos/psf/requests/issues/4375/comments
https://api.github.com/repos/psf/requests/issues/4375/events
https://github.com/psf/requests/issues/4375
271,614,638
MDU6SXNzdWUyNzE2MTQ2Mzg=
4,375
Handle HTTPDigestAuth requests that return stale=true
{ "avatar_url": "https://avatars.githubusercontent.com/u/7587111?v=4", "events_url": "https://api.github.com/users/greeny88/events{/privacy}", "followers_url": "https://api.github.com/users/greeny88/followers", "following_url": "https://api.github.com/users/greeny88/following{/other_user}", "gists_url": "https://api.github.com/users/greeny88/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/greeny88", "id": 7587111, "login": "greeny88", "node_id": "MDQ6VXNlcjc1ODcxMTE=", "organizations_url": "https://api.github.com/users/greeny88/orgs", "received_events_url": "https://api.github.com/users/greeny88/received_events", "repos_url": "https://api.github.com/users/greeny88/repos", "site_admin": false, "starred_url": "https://api.github.com/users/greeny88/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/greeny88/subscriptions", "type": "User", "url": "https://api.github.com/users/greeny88", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-06T20:46:50Z
2021-09-08T06:00:30Z
2017-11-06T21:07:32Z
NONE
resolved
I'm using the requests library to communicate with a Wildfly management API. In one specific environment, I am getting sporadic 401 responses that include in the 'WWW-Authenticate' the 'stale=true' flag. My understanding of the spec on this header is that the server sees that the authentication is valid but the nonce is old so it sends a new nonce with the stale flag to signal that it wants you to try again with the newly returned nonce. My question is how do I do that with requests? It seems that if I can find a way to build the Authorization header I could manage sending the response myself. However, ideally, I would like to set a limit on the number of times that request would retry this with the new nonce but I don't see that this is an option. In fact, it appears it is currently limited to the 2 attempts (the original 401 and the following response). How do I go about handling this?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4375/reactions" }
https://api.github.com/repos/psf/requests/issues/4375/timeline
null
completed
null
null
false
[ "So the Requests standard Digest Handler does not handle any of this, so you'll need to write a custom auth handler. This is very straightforward, and you can use the DigestAuth handler in the repository as a jumping off point: take that code and make the edits you need." ]
https://api.github.com/repos/psf/requests/issues/4374
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4374/labels{/name}
https://api.github.com/repos/psf/requests/issues/4374/comments
https://api.github.com/repos/psf/requests/issues/4374/events
https://github.com/psf/requests/issues/4374
271,388,756
MDU6SXNzdWUyNzEzODg3NTY=
4,374
pyinstaller make a exe file which contain requests run failed on no requests' windows
{ "avatar_url": "https://avatars.githubusercontent.com/u/20035768?v=4", "events_url": "https://api.github.com/users/Shaunchenzhaojin/events{/privacy}", "followers_url": "https://api.github.com/users/Shaunchenzhaojin/followers", "following_url": "https://api.github.com/users/Shaunchenzhaojin/following{/other_user}", "gists_url": "https://api.github.com/users/Shaunchenzhaojin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Shaunchenzhaojin", "id": 20035768, "login": "Shaunchenzhaojin", "node_id": "MDQ6VXNlcjIwMDM1NzY4", "organizations_url": "https://api.github.com/users/Shaunchenzhaojin/orgs", "received_events_url": "https://api.github.com/users/Shaunchenzhaojin/received_events", "repos_url": "https://api.github.com/users/Shaunchenzhaojin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Shaunchenzhaojin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Shaunchenzhaojin/subscriptions", "type": "User", "url": "https://api.github.com/users/Shaunchenzhaojin", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-06T08:07:01Z
2021-09-08T06:00:30Z
2017-11-06T20:55:24Z
NONE
resolved
Help me, I just being crazy.... My Pyinstaller version is 3.2.1, Python 2.7.13 and I make a exe which contain requests. But it can not run on other's windows whose without requests. So, which version should I try?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4374/reactions" }
https://api.github.com/repos/psf/requests/issues/4374/timeline
null
completed
null
null
false
[ "I'm afraid this is an issue with PyInstaller, not Requests: we can't really help you with PyInstaller. You'll need to take this up with the developers of PyInstaller." ]
https://api.github.com/repos/psf/requests/issues/4373
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4373/labels{/name}
https://api.github.com/repos/psf/requests/issues/4373/comments
https://api.github.com/repos/psf/requests/issues/4373/events
https://github.com/psf/requests/issues/4373
271,370,604
MDU6SXNzdWUyNzEzNzA2MDQ=
4,373
On Windows, getting wrong proxy settings from Windows registry
{ "avatar_url": "https://avatars.githubusercontent.com/u/1170592?v=4", "events_url": "https://api.github.com/users/mingyuan-xia/events{/privacy}", "followers_url": "https://api.github.com/users/mingyuan-xia/followers", "following_url": "https://api.github.com/users/mingyuan-xia/following{/other_user}", "gists_url": "https://api.github.com/users/mingyuan-xia/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mingyuan-xia", "id": 1170592, "login": "mingyuan-xia", "node_id": "MDQ6VXNlcjExNzA1OTI=", "organizations_url": "https://api.github.com/users/mingyuan-xia/orgs", "received_events_url": "https://api.github.com/users/mingyuan-xia/received_events", "repos_url": "https://api.github.com/users/mingyuan-xia/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mingyuan-xia/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mingyuan-xia/subscriptions", "type": "User", "url": "https://api.github.com/users/mingyuan-xia", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2017-11-06T06:23:08Z
2021-09-08T05:00:54Z
2017-11-22T04:06:07Z
CONTRIBUTOR
resolved
For some windows machines (not all), a confusing Windows registry key type (`HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings \ ProxyEnable`) fails the following code in `requests/requests/utils.py`. ``` proxyEnable = winreg.QueryValueEx(internetSettings, 'ProxyEnable')[0] proxyOverride = winreg.QueryValueEx(internetSettings, 'ProxyOverride')[0] ``` The case is if proxyEnable is a string , everything is fine. But `ProxyEnable` could be `REG_SZ` on some Windows machines (no idea why, but it happens). After user deletes this key or set if to `REG_DWORD 0x00000000(0)`, things get right. But I believe better type checks in requests will help. First found: https://stackoverflow.com/questions/46260169/python-locationvalueerror-no-host-specified Aggregated discussion: https://github.com/conda/conda/issues/3962 ## Expected Result Type checks. no failure for `REG_SZ` values.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1170592?v=4", "events_url": "https://api.github.com/users/mingyuan-xia/events{/privacy}", "followers_url": "https://api.github.com/users/mingyuan-xia/followers", "following_url": "https://api.github.com/users/mingyuan-xia/following{/other_user}", "gists_url": "https://api.github.com/users/mingyuan-xia/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mingyuan-xia", "id": 1170592, "login": "mingyuan-xia", "node_id": "MDQ6VXNlcjExNzA1OTI=", "organizations_url": "https://api.github.com/users/mingyuan-xia/orgs", "received_events_url": "https://api.github.com/users/mingyuan-xia/received_events", "repos_url": "https://api.github.com/users/mingyuan-xia/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mingyuan-xia/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mingyuan-xia/subscriptions", "type": "User", "url": "https://api.github.com/users/mingyuan-xia", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 1, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/4373/reactions" }
https://api.github.com/repos/psf/requests/issues/4373/timeline
null
completed
null
null
false
[ "I'd be happy to merge a patch that resolves this issue.", "PR: https://github.com/requests/requests/pull/4377", "@mingyuan-xia Could you please open a PR with that patch? I'd really love to see that get fixed in the next release of requests.", "https://github.com/requests/requests/pull/4377" ]
https://api.github.com/repos/psf/requests/issues/4372
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4372/labels{/name}
https://api.github.com/repos/psf/requests/issues/4372/comments
https://api.github.com/repos/psf/requests/issues/4372/events
https://github.com/psf/requests/pull/4372
271,213,442
MDExOlB1bGxSZXF1ZXN0MTUwNjg4Njkx
4,372
When Location decoding fails, fall back to original
{ "avatar_url": "https://avatars.githubusercontent.com/u/46775?v=4", "events_url": "https://api.github.com/users/mjpieters/events{/privacy}", "followers_url": "https://api.github.com/users/mjpieters/followers", "following_url": "https://api.github.com/users/mjpieters/following{/other_user}", "gists_url": "https://api.github.com/users/mjpieters/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mjpieters", "id": 46775, "login": "mjpieters", "node_id": "MDQ6VXNlcjQ2Nzc1", "organizations_url": "https://api.github.com/users/mjpieters/orgs", "received_events_url": "https://api.github.com/users/mjpieters/received_events", "repos_url": "https://api.github.com/users/mjpieters/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mjpieters/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mjpieters/subscriptions", "type": "User", "url": "https://api.github.com/users/mjpieters", "user_view_type": "public" }
[]
open
false
null
[]
null
11
2017-11-04T18:28:35Z
2022-01-03T15:30:58Z
null
CONTRIBUTOR
null
Issue #3888 correctly identified Location headers as *usually* containing UTF-8 codepoints (when not correctly URL encoded), but this is not always the case. For example the URL http://www.finanzen.net/suchergebnis.asp?strSuchString=DE0005933931 redirects to `b'/etf/ishares_core_dax\xae_ucits_etf_de'`, containing the Latin-1 byte for the ® character. If UTF-8 decoding fails, it is better to fall back to the original. This issue was found via https://stackoverflow.com/questions/47113376/python-3-x-requests-redirect-with-unicode-character
null
{ "+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/4372/reactions" }
https://api.github.com/repos/psf/requests/issues/4372/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4372.diff", "html_url": "https://github.com/psf/requests/pull/4372", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4372.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4372" }
true
[ "Crumbs, tests fail on 2.x because it encodes a bytestring (latin-1 encoded), while Python 3 handles a Unicode value. Returning a native `latin-1` string should work there.", "Nope, `to_native_string()` returns a `str` on Python 2. Suggestions to produce consistent output on 2.x and 3.x appreciated; just returning `location.decode('latin1')` doesn't work either.", "And another thought: Python 3 ends up with UTF8 bytes in the URL-encoded redirection URL regardless of what encoding the server used in the Location header. Surprisingly, this specific server doesn't appear to care (both variants end accepted and return the same response), but for other servers this may necessarily be the same. Most will expect the exact same byte sequence to be used for the next location. How should requests handle those?", "All of this is distressingly difficult for us to handle appropriately. The biggest issue is that we do not control header decoding on Python 3 (as noted in the code comments above the change you made), so things get tricky fast.\r\n\r\nThe core issue though is that we cannot \"retain the original\": we need to transition the string to a native form. Have you tried using `to_native_string(resp.headers['location'], 'latin1')` to see if that resolves the test failure?", "> Have you tried using `to_native_string(resp.headers['location'], 'latin1')` to see if that resolves the test failure?\r\n\r\nI did, it doesn't, because in Python 2 you'd get a bytestring still. That is then urlencoded to a different representation from the Python 3 Unicode string path.", "@mjpieters What is the different urlencoding output in each case?", "For the Latin1 `å` character, Python 2 outputs `%E5`, Python 3 `%C3%A5`, so the Latin-1 and UTF-8 bytes URL-encoded.\r\n\r\nYou can reproduce these in Python 3 with:\r\n\r\n```python\r\n>>> from urllib.parse import quote\r\n>>> quote('å', encoding='utf8')\r\n'%C3%A5'\r\n>>> quote('å', encoding='latin')\r\n'%E5'\r\n ```", "So, just to be clear: when given a byte string in Python 2, the quote library just quotes its bytes directly. When given a unicode string on Python 3, the quote library encodes it and then quotes the bytes?", "Exactly. And you can tell `quote()` what encoding to use too; the default is UTF-8. So if we can store the encoding for the location header (UTF-8, or if that fails, the fallback to Latin-1) we could use that information to re-encode to the same.", "That sounds like it'd be the best approach, if we can swing it.", "Any update on this?\r\n\r\n__Edit:__ I see there's https://github.com/psf/requests/pull/4933 as well." ]
https://api.github.com/repos/psf/requests/issues/4371
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4371/labels{/name}
https://api.github.com/repos/psf/requests/issues/4371/comments
https://api.github.com/repos/psf/requests/issues/4371/events
https://github.com/psf/requests/pull/4371
271,151,619
MDExOlB1bGxSZXF1ZXN0MTUwNjUyOTgw
4,371
support extraction of certificate bundle from a zip archive
{ "avatar_url": "https://avatars.githubusercontent.com/u/2501228?v=4", "events_url": "https://api.github.com/users/ahvigil/events{/privacy}", "followers_url": "https://api.github.com/users/ahvigil/followers", "following_url": "https://api.github.com/users/ahvigil/following{/other_user}", "gists_url": "https://api.github.com/users/ahvigil/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ahvigil", "id": 2501228, "login": "ahvigil", "node_id": "MDQ6VXNlcjI1MDEyMjg=", "organizations_url": "https://api.github.com/users/ahvigil/orgs", "received_events_url": "https://api.github.com/users/ahvigil/received_events", "repos_url": "https://api.github.com/users/ahvigil/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ahvigil/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahvigil/subscriptions", "type": "User", "url": "https://api.github.com/users/ahvigil", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2017-11-04T00:27:37Z
2021-09-04T00:06:42Z
2017-11-06T21:08:46Z
CONTRIBUTOR
resolved
Resolves #4369 by checking whether the default CA certificate bundle is being imported from a zip archive. If it is, extract the certificate bundle to a temp folder so it can be handled by the standard OpenSSL libraries.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4371/reactions" }
https://api.github.com/repos/psf/requests/issues/4371/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4371.diff", "html_url": "https://github.com/psf/requests/pull/4371", "merged_at": "2017-11-06T21:08:45Z", "patch_url": "https://github.com/psf/requests/pull/4371.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4371" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4371?src=pr&el=h1) Report\n> Merging [#4371](https://codecov.io/gh/requests/requests/pull/4371?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/81b63419cbd8a6f0c9c2b79083d25dc2260156e3?src=pr&el=desc) will **decrease** coverage by `0.28%`.\n> The diff coverage is `60%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4371/graphs/tree.svg?height=150&width=650&token=mZGswIiXLa&src=pr)](https://codecov.io/gh/requests/requests/pull/4371?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4371 +/- ##\n=========================================\n- Coverage 88.28% 88% -0.29% \n=========================================\n Files 18 18 \n Lines 2031 2050 +19 \n=========================================\n+ Hits 1793 1804 +11 \n- Misses 238 246 +8\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4371?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4371?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `92.99% <100%> (ø)` | :arrow_up: |\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4371?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `81.75% <57.89%> (-1.13%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4371?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4371?src=pr&el=footer). Last update [81b6341...b79df49](https://codecov.io/gh/requests/requests/pull/4371?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@Lukasa added tests. I also moved logic to `requests.utils` to avoid sullying the simple beauty of `requests.certs` and refactored to avoid my earlier use of module loading introspection in favor of a less magical approach.", "done!", "Thank you very much! :sparkles: :cake: :sparkles:" ]
https://api.github.com/repos/psf/requests/issues/4370
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4370/labels{/name}
https://api.github.com/repos/psf/requests/issues/4370/comments
https://api.github.com/repos/psf/requests/issues/4370/events
https://github.com/psf/requests/pull/4370
271,148,297
MDExOlB1bGxSZXF1ZXN0MTUwNjUwNTk4
4,370
Actually gmo used
{ "avatar_url": "https://avatars.githubusercontent.com/u/412673?v=4", "events_url": "https://api.github.com/users/gunlinux/events{/privacy}", "followers_url": "https://api.github.com/users/gunlinux/followers", "following_url": "https://api.github.com/users/gunlinux/following{/other_user}", "gists_url": "https://api.github.com/users/gunlinux/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gunlinux", "id": 412673, "login": "gunlinux", "node_id": "MDQ6VXNlcjQxMjY3Mw==", "organizations_url": "https://api.github.com/users/gunlinux/orgs", "received_events_url": "https://api.github.com/users/gunlinux/received_events", "repos_url": "https://api.github.com/users/gunlinux/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gunlinux/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gunlinux/subscriptions", "type": "User", "url": "https://api.github.com/users/gunlinux", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-03T23:56:54Z
2017-11-04T08:44:48Z
2017-11-04T08:44:34Z
NONE
null
Not serious. Not cool.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 1, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/4370/reactions" }
https://api.github.com/repos/psf/requests/issues/4370/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4370.diff", "html_url": "https://github.com/psf/requests/pull/4370", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4370.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4370" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4370?src=pr&el=h1) Report\n> Merging [#4370](https://codecov.io/gh/requests/requests/pull/4370?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/81b63419cbd8a6f0c9c2b79083d25dc2260156e3?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4370/graphs/tree.svg?height=150&width=650&token=mZGswIiXLa&src=pr)](https://codecov.io/gh/requests/requests/pull/4370?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4370 +/- ##\n=======================================\n Coverage 88.28% 88.28% \n=======================================\n Files 18 18 \n Lines 2031 2031 \n=======================================\n Hits 1793 1793 \n Misses 238 238\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4370?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4370?src=pr&el=footer). Last update [81b6341...2b09ab6](https://codecov.io/gh/requests/requests/pull/4370?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n" ]
https://api.github.com/repos/psf/requests/issues/4369
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4369/labels{/name}
https://api.github.com/repos/psf/requests/issues/4369/comments
https://api.github.com/repos/psf/requests/issues/4369/events
https://github.com/psf/requests/issues/4369
271,078,608
MDU6SXNzdWUyNzEwNzg2MDg=
4,369
IOError when making https requests from executable zip archive
{ "avatar_url": "https://avatars.githubusercontent.com/u/2501228?v=4", "events_url": "https://api.github.com/users/ahvigil/events{/privacy}", "followers_url": "https://api.github.com/users/ahvigil/followers", "following_url": "https://api.github.com/users/ahvigil/following{/other_user}", "gists_url": "https://api.github.com/users/ahvigil/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ahvigil", "id": 2501228, "login": "ahvigil", "node_id": "MDQ6VXNlcjI1MDEyMjg=", "organizations_url": "https://api.github.com/users/ahvigil/orgs", "received_events_url": "https://api.github.com/users/ahvigil/received_events", "repos_url": "https://api.github.com/users/ahvigil/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ahvigil/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahvigil/subscriptions", "type": "User", "url": "https://api.github.com/users/ahvigil", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2017-11-03T18:43:03Z
2021-09-08T06:00:30Z
2017-11-06T21:08:46Z
CONTRIBUTOR
resolved
Python has supported running packaged zip files [since 2.6](https://bugs.python.org/issue1739468). The [zipapp](https://docs.python.org/3/library/zipapp.html) module newly introduced in python 3 is supposed to make it even easier to create executable python zip archives. As part of this, the contents of the zip archive are added to `sys.path` on execution to facilitate bundling dependencies. Unfortunately, the way `requests` currently handles TLS CA certs is incompatible with this feature- It tries to load a certificate bundle from the `cacert.pem` file provided by the `certifi` package, but this fails in the case where the provided `certifi` installation is packaged as part of a zip archive. ## Expected Result Making https requests using `requests` as part of a zip archive succeeds. ## Actual Result Making https calls using a requests installation from a zip file raises an `IOError` ``` Traceback (most recent call last): File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "./zipapptest.pyz/__main__.py", line 2, in <module> File "./zipapptest.pyz/requests/api.py", line 72, in get File "./zipapptest.pyz/requests/api.py", line 58, in request File "./zipapptest.pyz/requests/sessions.py", line 508, in request File "./zipapptest.pyz/requests/sessions.py", line 618, in send File "./zipapptest.pyz/requests/adapters.py", line 407, in send File "./zipapptest.pyz/requests/adapters.py", line 226, in cert_verify OSError: Could not find a suitable TLS CA certificate bundle, invalid path: ./zipapptest.pyz/certifi/cacert.pem ``` ## Reproduction Steps I generated a minimal zip that should execute the following code: ```python import requests requests.get('https://www.google.com') ``` Reproduced within a `python:3` docker container ```bash # will generate a barebones zip archive from the contents of this folder mkdir zipapptest # produce a 2 line __main__.py that reproduces the bug cat >zipapptest/__main__.py <<EOF import requests requests.get('https://www.google.com') EOF # I will try to include the requests dependency in the archive pip install -t zipapptest requests # generate an executable zip from the above folder python -m zipapp --python $(which python) zipapptest # try to run the generated archive ./zipapptest.pyz ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.3" }, "platform": { "release": "4.9.49-moby", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000114f" }, "urllib3": { "version": "1.22" }, "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/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4369/reactions" }
https://api.github.com/repos/psf/requests/issues/4369/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/4368
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4368/labels{/name}
https://api.github.com/repos/psf/requests/issues/4368/comments
https://api.github.com/repos/psf/requests/issues/4368/events
https://github.com/psf/requests/pull/4368
270,985,347
MDExOlB1bGxSZXF1ZXN0MTUwNTMzMDE0
4,368
Clarify behaviour of `json` parameter.
{ "avatar_url": "https://avatars.githubusercontent.com/u/131395?v=4", "events_url": "https://api.github.com/users/danielroseman/events{/privacy}", "followers_url": "https://api.github.com/users/danielroseman/followers", "following_url": "https://api.github.com/users/danielroseman/following{/other_user}", "gists_url": "https://api.github.com/users/danielroseman/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/danielroseman", "id": 131395, "login": "danielroseman", "node_id": "MDQ6VXNlcjEzMTM5NQ==", "organizations_url": "https://api.github.com/users/danielroseman/orgs", "received_events_url": "https://api.github.com/users/danielroseman/received_events", "repos_url": "https://api.github.com/users/danielroseman/repos", "site_admin": false, "starred_url": "https://api.github.com/users/danielroseman/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/danielroseman/subscriptions", "type": "User", "url": "https://api.github.com/users/danielroseman", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2017-11-03T13:53:31Z
2021-09-04T00:06:40Z
2017-11-22T15:56:10Z
CONTRIBUTOR
resolved
`json` is ignored if `data` is not empty.
{ "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/4368/reactions" }
https://api.github.com/repos/psf/requests/issues/4368/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4368.diff", "html_url": "https://github.com/psf/requests/pull/4368", "merged_at": "2017-11-22T15:56:10Z", "patch_url": "https://github.com/psf/requests/pull/4368.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4368" }
true
[ "How about this?\r\n\r\n> The `data` parameter takes precedence over the `json` parameter.", "# [Codecov](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=h1) Report\n> Merging [#4368](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/81b63419cbd8a6f0c9c2b79083d25dc2260156e3?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4368/graphs/tree.svg?width=650&height=150&src=pr&token=mZGswIiXLa)](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4368 +/- ##\n=======================================\n Coverage 88.28% 88.28% \n=======================================\n Files 18 18 \n Lines 2031 2031 \n=======================================\n Hits 1793 1793 \n Misses 238 238\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=footer). Last update [81b6341...b701555](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "# [Codecov](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=h1) Report\n> Merging [#4368](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/acd2645444d280ac0c5d2d227fdd222cb1ac609c?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4368/graphs/tree.svg?height=150&width=650&token=mZGswIiXLa&src=pr)](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4368 +/- ##\n=======================================\n Coverage 89.05% 89.05% \n=======================================\n Files 18 18 \n Lines 2055 2055 \n=======================================\n Hits 1830 1830 \n Misses 225 225\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=footer). Last update [acd2645...39446de](https://codecov.io/gh/requests/requests/pull/4368?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@nateprewitt Thanks for the comments and apologies for the delay. I've updated as suggested.", "Yep, looks great to me too, thanks @danielroseman!" ]
https://api.github.com/repos/psf/requests/issues/4367
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4367/labels{/name}
https://api.github.com/repos/psf/requests/issues/4367/comments
https://api.github.com/repos/psf/requests/issues/4367/events
https://github.com/psf/requests/issues/4367
270,978,423
MDU6SXNzdWUyNzA5Nzg0MjM=
4,367
Exception ignored in: <generator object iter_slices at 0x7f...90>
{ "avatar_url": "https://avatars.githubusercontent.com/u/14262975?v=4", "events_url": "https://api.github.com/users/mikkqu/events{/privacy}", "followers_url": "https://api.github.com/users/mikkqu/followers", "following_url": "https://api.github.com/users/mikkqu/following{/other_user}", "gists_url": "https://api.github.com/users/mikkqu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mikkqu", "id": 14262975, "login": "mikkqu", "node_id": "MDQ6VXNlcjE0MjYyOTc1", "organizations_url": "https://api.github.com/users/mikkqu/orgs", "received_events_url": "https://api.github.com/users/mikkqu/received_events", "repos_url": "https://api.github.com/users/mikkqu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mikkqu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mikkqu/subscriptions", "type": "User", "url": "https://api.github.com/users/mikkqu", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2017-11-03T13:31:03Z
2018-03-13T16:55:36Z
2017-11-27T13:15:04Z
NONE
off-topic
I am getting an annoying warning message from requests library. Everything seem to work fine except that the message is extremely annoying and I'm having a lot of them. That's how it looks like. ``` Exception ignored in: <generator object iter_slices at 0x7f332d3cf990> Traceback (most recent call last): File "/home/mqu/.pyenv/versions/3.6.2/lib/python3.6/site-packages/requests/utils.py", line 449, in iter_slices def iter_slices(string, slice_length): SystemError: error return without exception set ``` This is the only line where I'm using requests in my program, I'm just sending JSON to different servers once in a while. ``` requests.post(url, json={'command': command, 'arguments': arguments}).json() ``` Could this error message be more descriptive? What can I do to make it go away? Anything else I can provide to you to help me identify the cause? Thanks in advance. requests-2.18.4
{ "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/4367/reactions" }
https://api.github.com/repos/psf/requests/issues/4367/timeline
null
completed
null
null
false
[ "The usage of requests will not by itself throw such an exception. Can you provide a [SSCCE](http://www.sscce.org/) that demonstrates the problem?\r\n\r\nThis works fine:\r\n\r\n```python\r\nimport requests\r\n\r\nbody = {\"foo\": 1, \"bar\": \"BAR\", \"baz\": True}\r\nresponse = requests.post(\"https://httpbin.org/post\", json=body)\r\nprint(response)\r\nprint(response.json())\r\n```\r\n\r\n```\r\n<Response [200]>\r\n{'url': 'https://httpbin.org/post', 'args': {}, 'data': '{\"foo\": 1, \"bar\": \"BAR\", \"baz\": true}', 'origin': '85.183.143.30', 'json': {'foo': 1, 'bar': 'BAR', 'baz': True}, 'headers': {'Accept': '*/*', 'Content-Length': '37', 'Host': 'httpbin.org', 'Content-Type': 'application/json', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'python-requests/2.12.4', 'Connection': 'close'}, 'files': {}, 'form': {}}\r\n```\r\n\r\n\r\n", "@mikkqu, this exception is raised when a python module calls out to a C module, raising an exception but no exception info is sent back. Requests is a pure Python module, so I don't believe we can be generating this message.\r\n\r\nA cursory google search suggests you're likely using numpy or cpickle to generate some of your json parameter content. Is that correct?", "@nateprewitt I'm inclined to agree that this isn't something Requests can fix. It's also plausible that this is being caused by [simplejson](https://github.com/requests/requests/blob/d1fb1a29ab949223d8d64797e0fcc9a7d2690483/requests/compat.py#L29) so there are many possible causes to this bug and none of them can we really help with. They're all entirely outside our domain to fix.", "Got the same after (I think) I updated to python 3.6.4 (from 3.6.1). I use requests (2.18.4). I get this error when simply downloading files, not simplejson or anything fancy. The error happens for every download in my script and shows like this for one download. If I have two downloads it will result in 2x parse.py error and 2x utils.py error, and so on.\r\n\r\n> Exception ignored in: <generator object urlsplit.<locals>.<genexpr> at 0x00000000039A6990>\r\n> Traceback (most recent call last):\r\n> File \"C:\\Program Files\\Python34\\lib\\urllib\\parse.py\", line 431, in <genexpr>\r\n> if not rest or any(c not in '0123456789' for c in rest):\r\n> SystemError: error return without exception set\r\n> Exception ignored in: <generator object iter_slices at 0x00000000039A67D8>\r\n> Traceback (most recent call last):\r\n> File \"C:\\Program Files\\Python34\\lib\\site-packages\\requests\\utils.py\", line 449, in iter_slices\r\n> def iter_slices(string, slice_length):\r\n> SystemError: error return without exception set\r\n\r\n\r\n-----\r\nSometimes I get this (response.py too):\r\n\r\n> Exception ignored in: <generator object urlsplit.<locals>.<genexpr> at 0x00000000039A67D8>\r\n> Traceback (most recent call last):\r\n> File \"C:\\Program Files\\Python34\\lib\\urllib\\parse.py\", line 431, in <genexpr>\r\n> if not rest or any(c not in '0123456789' for c in rest):\r\n> SystemError: error return without exception set\r\n> Exception ignored in: <generator object HTTPResponse.__init__.<locals>.<genexpr> at 0x00000000039A67D8>\r\n> Traceback (most recent call last):\r\n> File \"C:\\Program Files\\Python34\\lib\\site-packages\\urllib3\\response.py\", line 150, in <genexpr>\r\n> encodings = (enc.strip() for enc in tr_enc.split(\",\"))\r\n> SystemError: error return without exception set\r\n> Exception ignored in: <generator object iter_slices at 0x00000000066F6B48>\r\n> Traceback (most recent call last):\r\n> File \"C:\\Program Files\\Python34\\lib\\site-packages\\requests\\utils.py\", line 449, in iter_slices\r\n> def iter_slices(string, slice_length):\r\n> SystemError: error return without exception set\r\n\r\n\r\n\r\n-----\r\nAnd this all happens in a simple block like this:\r\n```\r\nwith open( os.path.join( file_path ), \"wb\") as f: # w: overwrite if exists\r\n print(\"Downloading\", items[1])\r\n f.write( session.get(items[1], timeout=2).content )\r\n```\r\nThis will then print\r\n> Downloading https://....\r\n> Exception ignored in: <generator object urlsplit.<locals>.<genexpr> at 0x000000000383AA98>\r\n> ...\r\n\r\n_Interestingly, the first 60 downloads or so work perfectly fine._\r\n\r\nI'll try to get some pure code example that I can share.", "And one other thing I (think I) just realized - you will not see this error when you just run the .py file in Windows. Using PyDev (Eclipse) will show the errors though for whatever reason. And again it always starts after lots of downloads are done.", "We're also experiencing this and are having a hard time figuring out how to investigate it further. I does look like it originates from our call to `json.dumps(object)`, which happens before we send a POST request." ]
https://api.github.com/repos/psf/requests/issues/4366
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4366/labels{/name}
https://api.github.com/repos/psf/requests/issues/4366/comments
https://api.github.com/repos/psf/requests/issues/4366/events
https://github.com/psf/requests/issues/4366
270,706,372
MDU6SXNzdWUyNzA3MDYzNzI=
4,366
Response content corrupted for file download
{ "avatar_url": "https://avatars.githubusercontent.com/u/16189532?v=4", "events_url": "https://api.github.com/users/djkirkham/events{/privacy}", "followers_url": "https://api.github.com/users/djkirkham/followers", "following_url": "https://api.github.com/users/djkirkham/following{/other_user}", "gists_url": "https://api.github.com/users/djkirkham/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/djkirkham", "id": 16189532, "login": "djkirkham", "node_id": "MDQ6VXNlcjE2MTg5NTMy", "organizations_url": "https://api.github.com/users/djkirkham/orgs", "received_events_url": "https://api.github.com/users/djkirkham/received_events", "repos_url": "https://api.github.com/users/djkirkham/repos", "site_admin": false, "starred_url": "https://api.github.com/users/djkirkham/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/djkirkham/subscriptions", "type": "User", "url": "https://api.github.com/users/djkirkham", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2017-11-02T15:52:56Z
2021-09-08T06:00:31Z
2017-11-02T17:08:10Z
NONE
resolved
Using `requests` to download http://hdfeos.org/software/pyhdf/pyhdf-0.9.0.tar.gz results in a corrupted file. Other methods of downloading the file (`wget`, `urllib.urlretrieve`) download the file correctly. ## Expected Result When the file downloads correctly the [sha256 listed here](http://hdfeos.org/software/pyhdf/SHA256) can be obtained: ``` $ sha256sum pyhdf-0.9.0.tar.gz c20c58e53f8fbdc47a1fcdec954262528f486cfcb4efa7e1c2e8847ad3e8092f pyhdf-0.9.0.tar.gz ``` ## Actual Result ``` $ sha256sum pyhdf-0.9.0.tar.gz f1fd2d72838f30fc4e3a7688a4e1a395483b08e54f4955f3b4d384639e13c67a pyhdf-0.9.0.tar.gz ``` ## Reproduction Steps ```python import requests resp = requests.get('http://hdfeos.org/software/pyhdf/pyhdf-0.9.0.tar.gz') with open('pyhdf-0.9.0.tar.gz', 'w') as f: f.write(resp.content) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.2" }, "cryptography": { "version": "1.9" }, "idna": { "version": "" }, "implementation": { "name": "CPython", "version": "2.7.13" }, "platform": { "release": "2.6.32-696.10.3.el6.x86_64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "100020bf", "version": "16.2.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020cf" }, "urllib3": { "version": "1.21.1" }, "using_pyopenssl": true } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/16189532?v=4", "events_url": "https://api.github.com/users/djkirkham/events{/privacy}", "followers_url": "https://api.github.com/users/djkirkham/followers", "following_url": "https://api.github.com/users/djkirkham/following{/other_user}", "gists_url": "https://api.github.com/users/djkirkham/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/djkirkham", "id": 16189532, "login": "djkirkham", "node_id": "MDQ6VXNlcjE2MTg5NTMy", "organizations_url": "https://api.github.com/users/djkirkham/orgs", "received_events_url": "https://api.github.com/users/djkirkham/received_events", "repos_url": "https://api.github.com/users/djkirkham/repos", "site_admin": false, "starred_url": "https://api.github.com/users/djkirkham/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/djkirkham/subscriptions", "type": "User", "url": "https://api.github.com/users/djkirkham", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4366/reactions" }
https://api.github.com/repos/psf/requests/issues/4366/timeline
null
completed
null
null
false
[ "Requests gunzips the file:\r\n\r\n```\r\n$ file pyhdf-0.9.0.tar.gz\r\npyhdf-0.9.0.tar.gz: POSIX tar archive (GNU)\r\n$ tar tf pyhdf-0.9.0.tar.gz \r\npyhdf-0.9.0/\r\npyhdf-0.9.0/PKG-INFO\r\npyhdf-0.9.0/pyhdf/\r\npyhdf-0.9.0/pyhdf/error.py\r\npyhdf-0.9.0/pyhdf/HC.py\r\npyhdf-0.9.0/pyhdf/HDF.py\r\npyhdf-0.9.0/pyhdf/hdfext.py\r\npyhdf-0.9.0/pyhdf/hdfext_wrap.c\r\npyhdf-0.9.0/pyhdf/SD.py\r\npyhdf-0.9.0/pyhdf/six.py\r\npyhdf-0.9.0/pyhdf/V.py\r\npyhdf-0.9.0/pyhdf/VS.py\r\npyhdf-0.9.0/pyhdf/__init__.py\r\npyhdf-0.9.0/pyhdf.egg-info/\r\npyhdf-0.9.0/pyhdf.egg-info/dependency_links.txt\r\npyhdf-0.9.0/pyhdf.egg-info/PKG-INFO\r\npyhdf-0.9.0/pyhdf.egg-info/SOURCES.txt\r\npyhdf-0.9.0/pyhdf.egg-info/top_level.txt\r\npyhdf-0.9.0/README.rst\r\npyhdf-0.9.0/setup.cfg\r\npyhdf-0.9.0/setup.py\r\n```\r\n\r\n~~Use [`stream=True`](http://docs.python-requests.org/en/latest/user/quickstart/#raw-response-content):~~\r\n\r\n", "Great, thanks for your help!", "Sorry, I closed this prematurely. `stream=True` gives the same result...", "Now:\r\n\r\n```python\r\nwith open('pyhdf-0.9.0.tar.gz', 'wb') as f:\r\n f.write(resp.raw.data)\r\n```\r\n\r\n", "@djkirkham, `stream=True` should not be necessary unless you have a need for streaming the content.\r\n\r\nYou need to write `resp.content` to a file opened with the `wb` flag, not `w`. We've already ungzipped the content for you, so it will just be the tar file.", "The goal is to verify the SHA256, so writing the ungzipped content is probably no option.", "Actually it's not in my code. I'm using `conda build`, which is failing on this file.\r\n\r\nWhat are the rules about when `requests` will gunzip a file? This is the first time I've run into this problem and I've been using conda build extensively with `.tar.gz` files", "Requests will return uncompressed content by default so it can be written directly to file or passed around your code in the intended base format. Lots of web servers send content, that would otherwise be uncompressed, in the gzip format to reduce the bytes going across the wire.\r\n\r\nThe solution @lutzhorn noted is probably the best one if you need the content compressed. Otherwise, you'll receive the tar file.\r\n\r\nIf this is conda-build's code, it sounds like they may not be using Requests with this use case in mind. You'll likely want to open an issue there to discuss with them.", "I've noticed that the response header for the url in questions contains the key/value pair `Content-Encoding': 'gzip'`. Is this what causes `requests` to gunzip it? Other files I've looked at don't contain this key.\r\n\r\nThis seems like a problem with the response itself. Based on my limited understanding it seems like specifying a `Connent-Type` of `gzip` is incorrect, as the intention is to provide a zipped file to the client.\r\n\r\nIn any case, it's not an issue with `requests`. Thanks for you help.", "Yes, that is why Requests decompresses it. `Content-Encoding` means that the compression is not an intrinsic part of the file, so we remove it. " ]
https://api.github.com/repos/psf/requests/issues/4365
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4365/labels{/name}
https://api.github.com/repos/psf/requests/issues/4365/comments
https://api.github.com/repos/psf/requests/issues/4365/events
https://github.com/psf/requests/issues/4365
270,560,459
MDU6SXNzdWUyNzA1NjA0NTk=
4,365
can requests has a way to automatically determine the type of authentication?
{ "avatar_url": "https://avatars.githubusercontent.com/u/7598892?v=4", "events_url": "https://api.github.com/users/beruhan/events{/privacy}", "followers_url": "https://api.github.com/users/beruhan/followers", "following_url": "https://api.github.com/users/beruhan/following{/other_user}", "gists_url": "https://api.github.com/users/beruhan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/beruhan", "id": 7598892, "login": "beruhan", "node_id": "MDQ6VXNlcjc1OTg4OTI=", "organizations_url": "https://api.github.com/users/beruhan/orgs", "received_events_url": "https://api.github.com/users/beruhan/received_events", "repos_url": "https://api.github.com/users/beruhan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/beruhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/beruhan/subscriptions", "type": "User", "url": "https://api.github.com/users/beruhan", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2017-11-02T07:43:06Z
2021-09-08T06:00:31Z
2017-11-02T21:20:34Z
NONE
resolved
I have a problem that I known the web services require authentication,but I can't determine Basic or Digest it need,How can I deal with this situation?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4365/reactions" }
https://api.github.com/repos/psf/requests/issues/4365/timeline
null
completed
null
null
false
[ "The requests-toolbelt has a [`GuessAuth`](http://toolbelt.readthedocs.io/en/latest/authentication.html#guessauth) handler which is perfect for this use-case." ]
https://api.github.com/repos/psf/requests/issues/4364
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4364/labels{/name}
https://api.github.com/repos/psf/requests/issues/4364/comments
https://api.github.com/repos/psf/requests/issues/4364/events
https://github.com/psf/requests/issues/4364
270,276,195
MDU6SXNzdWUyNzAyNzYxOTU=
4,364
Delete cookies not working with adapter
{ "avatar_url": "https://avatars.githubusercontent.com/u/6284?v=4", "events_url": "https://api.github.com/users/Singletoned/events{/privacy}", "followers_url": "https://api.github.com/users/Singletoned/followers", "following_url": "https://api.github.com/users/Singletoned/following{/other_user}", "gists_url": "https://api.github.com/users/Singletoned/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Singletoned", "id": 6284, "login": "Singletoned", "node_id": "MDQ6VXNlcjYyODQ=", "organizations_url": "https://api.github.com/users/Singletoned/orgs", "received_events_url": "https://api.github.com/users/Singletoned/received_events", "repos_url": "https://api.github.com/users/Singletoned/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Singletoned/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Singletoned/subscriptions", "type": "User", "url": "https://api.github.com/users/Singletoned", "user_view_type": "public" }
[]
closed
true
null
[]
null
14
2017-11-01T11:16:23Z
2021-09-08T06:00:31Z
2017-11-06T08:52:14Z
NONE
resolved
## Summary. Using the requests-wsgi-adapter code, deleting cookies (eg using httpbin) doesn't work. I wrote a test that demonstrates it: https://github.com/Singletoned/requests-wsgi-adapter/blob/feature/delete-cookies/tests.py#L77 The equivalent code using requests and httpbin.org works fine, but using requests, requests-wsgi-adapter and httpbin as a wsgi app, it fails to delete the cookie. ``` # This works as expected import requests session = requests.Session() response = session.get("http://httpbin.org/cookies/set?flim=flam&flooble=flumble") print(response.json()) assert response.json()['cookies'] == {'flooble': 'flumble', 'flim': 'flam'} response = session.get("http://httpbin.org/cookies/delete?flim=flam") print(response.json()) assert response.json()['cookies'] == {'flooble': 'flumble'} ``` I imagine the fact that is doesn't work is a result of the interface between requests and requests-wsgi-adapter, but I can't work out what is going wrong. Any help investigating this would be greatly appreciated. I wonder if it might be something to do with the cookie domain... ## Expected Result I expect the `flim` cookie to not be in the response anymore. ## Actual Result Rather than deleting the cookie it appears to do nothing. ## Reproduction Steps ``` # pip install httpbin requests-wsgi-adapter # This fails import httpbin import requests from wsgiadapter import WSGIAdapter session = requests.session() session.mount('http://localhost', WSGIAdapter(app=httpbin.app)) session.get( "http://localhost/cookies/set?flimble=floop&flamble=flaap") response = session.get("http://localhost/cookies") assert response.json() == { 'cookies': {'flimble': 'floop', 'flamble': 'flaap'}} response = session.get( "http://localhost/cookies/delete?flimble") result = response.json() expected = {'cookies': {'flamble': 'flaap'}} assert result == expected, result ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "implementation": { "name": "CPython", "version": "3.6.2" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.1" }, "system_ssl": { "version": "100020cf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/6284?v=4", "events_url": "https://api.github.com/users/Singletoned/events{/privacy}", "followers_url": "https://api.github.com/users/Singletoned/followers", "following_url": "https://api.github.com/users/Singletoned/following{/other_user}", "gists_url": "https://api.github.com/users/Singletoned/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Singletoned", "id": 6284, "login": "Singletoned", "node_id": "MDQ6VXNlcjYyODQ=", "organizations_url": "https://api.github.com/users/Singletoned/orgs", "received_events_url": "https://api.github.com/users/Singletoned/received_events", "repos_url": "https://api.github.com/users/Singletoned/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Singletoned/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Singletoned/subscriptions", "type": "User", "url": "https://api.github.com/users/Singletoned", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4364/reactions" }
https://api.github.com/repos/psf/requests/issues/4364/timeline
null
completed
null
null
false
[ "What are the response headers for each request in both cases?", "These are the failing headers using the wsgi adapter:\r\n```\r\n[('Content-Type', 'text/html; charset=utf-8'),\r\n ('Content-Length', '223'),\r\n ('Location', '/cookies'),\r\n ('Set-Cookie', 'flimble=floop; Path=/'),\r\n ('Set-Cookie', 'flamble=flaap; Path=/'),\r\n ('Access-Control-Allow-Origin', '*'),\r\n ('Access-Control-Allow-Credentials', 'true'),\r\n ('X-Powered-By', 'Flask'),\r\n ('X-Processed-Time', '0')]\r\n\r\n[('Content-Type', 'application/json'),\r\n ('Access-Control-Allow-Origin', '*'),\r\n ('Access-Control-Allow-Credentials', 'true'),\r\n ('X-Powered-By', 'Flask'),\r\n ('X-Processed-Time', '0'),\r\n ('Content-Length', '71')]\r\n\r\n[('Content-Type', 'text/html; charset=utf-8'),\r\n ('Content-Length', '223'),\r\n ('Location', '/cookies'),\r\n ('Set-Cookie',\r\n 'flimble=; Expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/'),\r\n ('Access-Control-Allow-Origin', '*'),\r\n ('Access-Control-Allow-Credentials', 'true'),\r\n ('X-Powered-By', 'Flask'),\r\n ('X-Processed-Time', '0')]\r\n\r\n[('Content-Type', 'application/json'),\r\n ('Access-Control-Allow-Origin', '*'),\r\n ('Access-Control-Allow-Credentials', 'true'),\r\n ('X-Powered-By', 'Flask'),\r\n ('X-Processed-Time', '0'),\r\n ('Content-Length', '71')]\r\n```\r\nAnd these are the passing ones using requests against httpbin.org\r\n```\r\n\r\nConnection: keep-alive\r\nServer: meinheld/0.6.1\r\nDate: Wed, 01 Nov 2017 20:41:15 GMT\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: 223\r\nLocation: /cookies\r\nSet-Cookie: flim=flam; Path=/\r\nSet-Cookie: flooble=flumble; Path=/\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nX-Powered-By: Flask\r\nX-Processed-Time: 0.00153303146362\r\nVia: 1.1 vegur\r\n\r\nConnection: keep-alive\r\nServer: meinheld/0.6.1\r\nDate: Wed, 01 Nov 2017 20:41:14 GMT\r\nContent-Type: application/json\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nX-Powered-By: Flask\r\nX-Processed-Time: 0.00084400177002\r\nContent-Length: 69\r\nVia: 1.1 vegur\r\n\r\nConnection: keep-alive\r\nServer: meinheld/0.6.1\r\nDate: Wed, 01 Nov 2017 20:41:15 GMT\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: 223\r\nLocation: /cookies\r\nSet-Cookie: flim=; Expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nX-Powered-By: Flask\r\nX-Processed-Time: 0.00103402137756\r\nVia: 1.1 vegur\r\n\r\n\r\nConnection: keep-alive\r\nServer: meinheld/0.6.1\r\nDate: Wed, 01 Nov 2017 20:41:15 GMT\r\nContent-Type: application/json\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nX-Powered-By: Flask\r\nX-Processed-Time: 0.000602006912231\r\nContent-Length: 48\r\nVia: 1.1 vegur\r\n```\r\n\r\nSorry that they are in different formats.", "Hrm. Those seem just fine. I suspect requests-wsgi adapter is not correctly shimming the underlying response into a format that cookielib likes. ", "These are the cookies from each response:\r\n```\r\n<RequestsCookieJar[<Cookie flamble=flaap for example.com/>, <Cookie flimble=floop for example.com/>]>\r\n<RequestsCookieJar[]>\r\n<RequestsCookieJar[<Cookie flimble= for example.com/cookies>]>\r\n<RequestsCookieJar[]>\r\n```\r\nThey seem correct.", "Although I notice that the deleted cookie is for \"example.com/cookies\" not \"example.com/\". I wonder if that could affect it?", "Yup, that will do it. That is incorrect though: the path is specified in the cookie header. ", "That stuff is handled by `requests.cookies` and std lib's `http.cookiejar`. The interface is somewhat complicated (with MockReqeusts and email messages and stuff), but I'm trying to follow it.", "I've got it down to a minimum failing example.\r\n\r\n```\r\nimport requests\r\nimport http.cookiejar\r\nfrom requests.structures import CaseInsensitiveDict\r\n\r\n\r\nclass MockMessage(object):\r\n def __init__(self, headers):\r\n self._headers = CaseInsensitiveDict(headers)\r\n\r\n def getheaders(self, name, default=None):\r\n header = self._headers.get(name)\r\n if default is None:\r\n default = []\r\n if header is None:\r\n return default\r\n return [s.strip() for s in header.split(',')]\r\n\r\n get_all = getheaders\r\n\r\n\r\nclass Stub(object):\r\n def __init__(self, **kwargs):\r\n for key in kwargs:\r\n setattr(self, key, kwargs[key])\r\n\r\n\r\ncookies = http.cookiejar.CookieJar()\r\n\r\n\r\nres = Stub(\r\n _original_response=Stub(\r\n msg=MockMessage(\r\n {\r\n 'Set-Cookie': 'flimble=; Expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/',})\r\n ))\r\n\r\nreq = Stub(\r\n **{\r\n 'method': 'GET',\r\n 'url': 'http://example.com/cookies/delete?flimble',\r\n 'headers': {'Host': 'example.com'}})\r\n\r\nprint(cookies)\r\n\r\nresult = requests.cookies.extract_cookies_to_jar(cookies, req, res)\r\n\r\nprint(result)\r\nprint(cookies)\r\n```\r\n\r\nIt seems to be the line `[s.strip() for s in header.split(',')]` that is causing the problem, as it is naively splitting the header on commas. I can't see what the correct solution would be though. And I can't find any code that does a better job of parsing the headers.", "For cookie headers, don’t split them. Just check the header names first. ", "Unfortunately that doesn't work. They don't get parsed at all if I do that and then no cookies are detected.", "Ah, ok, sorry. The problem you have here is that a different layer (maybe yours, maybe Requests), is joining the two `Set-Cookie` headers at the start together with a comma. This isn't right, but it's a common behaviour when storing these headers in a dictionary. Really this needs to be solved by using a dictionary more like urllib3's `HeaderDict`, which is able to return a list of all the headers received rather than joining them.", "Okay, I know where that's happening and it's easily fixable. I think that fix my problems. Is it reasonable to not handle joined `Set-Cookie` headers if a server sends them? (Handling multiple separate headers is fine). My code is only going to be dealing with WSGI servers, so I doubt anyone will have set them manually, nor will there be any major legacy issues. Thanks for all your help with this. 😸 ", "Yeah, it’s fine. 😁", "Brilliant, thanks again for all your help with this. I think I've got it sorted 😺 " ]
https://api.github.com/repos/psf/requests/issues/4363
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4363/labels{/name}
https://api.github.com/repos/psf/requests/issues/4363/comments
https://api.github.com/repos/psf/requests/issues/4363/events
https://github.com/psf/requests/issues/4363
270,121,018
MDU6SXNzdWUyNzAxMjEwMTg=
4,363
rl print response headers
{ "avatar_url": "https://avatars.githubusercontent.com/u/25519096?v=4", "events_url": "https://api.github.com/users/hrpomrx/events{/privacy}", "followers_url": "https://api.github.com/users/hrpomrx/followers", "following_url": "https://api.github.com/users/hrpomrx/following{/other_user}", "gists_url": "https://api.github.com/users/hrpomrx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hrpomrx", "id": 25519096, "login": "hrpomrx", "node_id": "MDQ6VXNlcjI1NTE5MDk2", "organizations_url": "https://api.github.com/users/hrpomrx/orgs", "received_events_url": "https://api.github.com/users/hrpomrx/received_events", "repos_url": "https://api.github.com/users/hrpomrx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hrpomrx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hrpomrx/subscriptions", "type": "User", "url": "https://api.github.com/users/hrpomrx", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2017-10-31T21:13:36Z
2021-09-08T06:00:32Z
2017-10-31T21:15:24Z
NONE
resolved
Summary. ## Expected Result What you expected. ## Actual Result What happened instead. ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ``` <paste here> ``` 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/25519096?v=4", "events_url": "https://api.github.com/users/hrpomrx/events{/privacy}", "followers_url": "https://api.github.com/users/hrpomrx/followers", "following_url": "https://api.github.com/users/hrpomrx/following{/other_user}", "gists_url": "https://api.github.com/users/hrpomrx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hrpomrx", "id": 25519096, "login": "hrpomrx", "node_id": "MDQ6VXNlcjI1NTE5MDk2", "organizations_url": "https://api.github.com/users/hrpomrx/orgs", "received_events_url": "https://api.github.com/users/hrpomrx/received_events", "repos_url": "https://api.github.com/users/hrpomrx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hrpomrx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hrpomrx/subscriptions", "type": "User", "url": "https://api.github.com/users/hrpomrx", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4363/reactions" }
https://api.github.com/repos/psf/requests/issues/4363/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/4362
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4362/labels{/name}
https://api.github.com/repos/psf/requests/issues/4362/comments
https://api.github.com/repos/psf/requests/issues/4362/events
https://github.com/psf/requests/issues/4362
269,952,391
MDU6SXNzdWUyNjk5NTIzOTE=
4,362
Redirect resolved even though allow_redirects is set to False causing exception for unsupported connection adapter
{ "avatar_url": "https://avatars.githubusercontent.com/u/4640825?v=4", "events_url": "https://api.github.com/users/fevertree/events{/privacy}", "followers_url": "https://api.github.com/users/fevertree/followers", "following_url": "https://api.github.com/users/fevertree/following{/other_user}", "gists_url": "https://api.github.com/users/fevertree/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fevertree", "id": 4640825, "login": "fevertree", "node_id": "MDQ6VXNlcjQ2NDA4MjU=", "organizations_url": "https://api.github.com/users/fevertree/orgs", "received_events_url": "https://api.github.com/users/fevertree/received_events", "repos_url": "https://api.github.com/users/fevertree/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fevertree/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fevertree/subscriptions", "type": "User", "url": "https://api.github.com/users/fevertree", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" } ]
null
6
2017-10-31T13:11:11Z
2022-03-29T03:12:39Z
2021-12-29T02:32:57Z
NONE
resolved
I'm currently mocking an API that is consumed by an Android application. One of the API responses contains a redirect to a custom URL schema `app://` in the `Location` header Since I am not interested in my mocked API client in following the redirect (which would raise an InvalidSchema exception anyway), I have set `allow_redirects = False` on my session object. Although the redirect is not fired, it is still being resolved, causing an exception due to the missing url adapter. ## Expected Result Since I'm not interested in the redirects being followed, it would make sense to not resolve the redirected request in the first place. ## How to reproduce ```python import requests S = requests.session() S.allow_redirects = False destination = https://somesite.example # URL with a redirect to a non-standard protocol S.get(url=destination) ``` Response headers (example): ``` HTTP/1.1 302 Found Server: Apache-Coyote Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 Strict-Transport-Security: max-age=31536000 ; includeSubDomains Location: app://api-test.somesite.example?q=example Content-Language: en Content-Length: 0 Date: Tue, 31 Oct 2017 12:39:17 GMT Connection: close ``` Exception thrown by code: ``` Traceback (most recent call last): File "example.py", line 6, in <module> S.get(url=destination) in get return self.request('GET', url, **kwargs) File ~/.local/lib/python2.7/site-packages/requests/sessions.py", line 518, in request resp = self.send(prep, **send_kwargs) File "~/.local/lib/python2.7/site-packages/requests/sessions.py", line 661, in send history = [resp for resp in gen] if allow_redirects else [] File "~/.local/lib/python2.7/site-packages/requests/sessions.py", line 214, in resolve_redirects **adapter_kwargs File "~/.local/lib/python2.7/site-packages/requests/sessions.py", line 633, in send adapter = self.get_adapter(url=request.url) File "~/.local/lib/python2.7/site-packages/requests/sessions.py", line 717, in get_adapter raise InvalidSchema("No connection adapters were found for '%s'" % url) requests.exceptions.InvalidSchema: No connection adapters were found for 'app://api-test.somesite.com?q=example' ``` ## Actual Result InvalidSchema exception
{ "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/4362/reactions" }
https://api.github.com/repos/psf/requests/issues/4362/timeline
null
completed
null
null
false
[ "@kennethreitz This is the result of `Response.next`, which you added. Mind taking a look?", "@fevertree can you try this and see if you still get the exception?\r\n\r\n```\r\nimport requests\r\n\r\nS = requests.session()\r\ndestination = https://somesite.example # URL with a redirect to a non-standard protocol\r\nS.get(url=destination, allow_redirects=False)\r\n```\r\n\r\nAs far as I know `S.allow_redirects = False` doesn't do anything.", "Hmm, never got this notification.", "I cannot reproduce this as of 2.18.4\r\nfails on `allow_redirects=True`\r\nworks as expected with `allow_redirects=False`\r\n\r\ntest server:\r\n```\r\nfrom aiohttp import web\r\n\r\nasync def app_redir(request):\r\n return web.HTTPSeeOther('app://test')\r\n\r\napp = web.Application()\r\napp.add_routes([web.get('/', app_redir)])\r\nweb.run_app(app)\r\n```", "Good evening. \r\nI was able to reproduce the error.\r\n\r\nhttps://github.com/psf/requests/blob/8c211a96cdbe9fe320d63d9e1ae15c5c07e179f8/requests/sessions.py#L730-L742\r\n\r\n\r\nserver.py\r\n```python\r\nfrom aiohttp import web\r\n\r\nasync def app_redir(request):\r\n return web.HTTPSeeOther('app://test')\r\n\r\napp = web.Application()\r\napp.add_routes([web.get('/', app_redir)])\r\nweb.run_app(app)\r\n```\r\n\r\ntester.py\r\n```python\r\nimport requests\r\n\r\ns = requests.session()\r\ns.allow_redirects = False\r\ndestination = \"0.0.0.0:8080\"\r\ns.get(url=destination)\r\n```\r\nWe get an error message because we don't pass the check by this list. \r\n\r\nhttps://github.com/psf/requests/blob/8c211a96cdbe9fe320d63d9e1ae15c5c07e179f8/requests/sessions.py#L419-L423\r\n\r\nBut it seems to me that the error should be: `requests.exceptions.MissingSchema`. The error slips in here.\r\nhttps://github.com/psf/requests/blob/8c211a96cdbe9fe320d63d9e1ae15c5c07e179f8/requests/models.py#L373-L378", "Reading back through this issue I think we ended up going down the wrong rabbit hole. The original reported issue isn't a bug. The error is reproducible at least as far back as 2.13.0, prior to the inclusion of `next`. Session has never supported direct assignment of `allow_redirects`, at least not in Requests 2.x. As noted in the comments above, it's only usable in the Session `request` API as a kwarg.\r\n\r\nThe issue raised by @LuckyDenis is tangential to the original problem and can be addressed in PR. I'll resolve this since there doesn't appear to be anything left to do." ]