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/4661
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4661/labels{/name}
https://api.github.com/repos/psf/requests/issues/4661/comments
https://api.github.com/repos/psf/requests/issues/4661/events
https://github.com/psf/requests/pull/4661
326,773,738
MDExOlB1bGxSZXF1ZXN0MTkwNzYyODg4
4,661
Response.content minor perf improvement
{ "avatar_url": "https://avatars.githubusercontent.com/u/9677399?v=4", "events_url": "https://api.github.com/users/ofek/events{/privacy}", "followers_url": "https://api.github.com/users/ofek/followers", "following_url": "https://api.github.com/users/ofek/following{/other_user}", "gists_url": "https://api.github.com/users/ofek/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ofek", "id": 9677399, "login": "ofek", "node_id": "MDQ6VXNlcjk2NzczOTk=", "organizations_url": "https://api.github.com/users/ofek/orgs", "received_events_url": "https://api.github.com/users/ofek/received_events", "repos_url": "https://api.github.com/users/ofek/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ofek/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ofek/subscriptions", "type": "User", "url": "https://api.github.com/users/ofek", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-05-26T23:11:52Z
2021-09-03T00:10:56Z
2018-05-27T00:00:26Z
CONTRIBUTOR
resolved
Python 2 ```console $ python -m timeit -s "blist = [b'foo', b'bar'];" "bytes().join(blist)" 1000000 loops, best of 3: 0.243 usec per loop $ python -m timeit -s "blist = [b'foo', b'bar'];" "b''.join(blist)" 10000000 loops, best of 3: 0.125 usec per loop ``` Python 3 ```console $ python -m timeit -s "blist = [b'foo', b'bar'];" "bytes().join(blist)" 1000000 loops, best of 3: 0.285 usec per loop $ python -m timeit -s "blist = [b'foo', b'bar'];" "b''.join(blist)" 10000000 loops, best of 3: 0.161 usec per loop ```
{ "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/4661/reactions" }
https://api.github.com/repos/psf/requests/issues/4661/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4661.diff", "html_url": "https://github.com/psf/requests/pull/4661", "merged_at": "2018-05-27T00:00:26Z", "patch_url": "https://github.com/psf/requests/pull/4661.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4661" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4661?src=pr&el=h1) Report\n> Merging [#4661](https://codecov.io/gh/requests/requests/pull/4661?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/fe8290b3d0ca21dd8ae5471a59a8bf13d3dcb31e?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `100%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4661/graphs/tree.svg?src=pr&token=mZGswIiXLa&width=650&height=150)](https://codecov.io/gh/requests/requests/pull/4661?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4661 +/- ##\n=======================================\n Coverage 66.62% 66.62% \n=======================================\n Files 15 15 \n Lines 1564 1564 \n=======================================\n Hits 1042 1042 \n Misses 522 522\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4661?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/4661/diff?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `77.4% <100%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4661?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/4661?src=pr&el=footer). Last update [fe8290b...c1b828b](https://codecov.io/gh/requests/requests/pull/4661?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Thanks for catching this @ofek!\r\n\r\nIf others are curious as to why this is happening it's because the syntactic sugar for `b''` built into the language is faster than creating an object via `bytes()`. The same actually holds true for `[]` instead of `list()`, `{}` instead of `dict()`, and the list goes on." ]
https://api.github.com/repos/psf/requests/issues/4660
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4660/labels{/name}
https://api.github.com/repos/psf/requests/issues/4660/comments
https://api.github.com/repos/psf/requests/issues/4660/events
https://github.com/psf/requests/issues/4660
326,713,537
MDU6SXNzdWUzMjY3MTM1Mzc=
4,660
Multipart PUT?
{ "avatar_url": "https://avatars.githubusercontent.com/u/2229284?v=4", "events_url": "https://api.github.com/users/aparamon/events{/privacy}", "followers_url": "https://api.github.com/users/aparamon/followers", "following_url": "https://api.github.com/users/aparamon/following{/other_user}", "gists_url": "https://api.github.com/users/aparamon/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/aparamon", "id": 2229284, "login": "aparamon", "node_id": "MDQ6VXNlcjIyMjkyODQ=", "organizations_url": "https://api.github.com/users/aparamon/orgs", "received_events_url": "https://api.github.com/users/aparamon/received_events", "repos_url": "https://api.github.com/users/aparamon/repos", "site_admin": false, "starred_url": "https://api.github.com/users/aparamon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/aparamon/subscriptions", "type": "User", "url": "https://api.github.com/users/aparamon", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-26T06:05:08Z
2021-09-08T02:09:54Z
2018-05-26T11:38:32Z
NONE
resolved
Does `requests` currently support Multipart-encoded files in `PUT` requests? It seems that both http://docs.python-requests.org/en/master/user/quickstart/#post-a-multipart-encoded-file and https://toolbelt.readthedocs.io/en/latest/uploading-data.html only work with `POST`. For `PUT` requests, I keep getting error "413 Request Entity Too Large" from my Apache httpd. Should that be considered a bug, improvement suggestion, or there is some fundamental limitation why `PUT` shouldn't upload large files? (yes, my `GET` would stream the huge file unmodified) Original StackOverflow question: https://stackoverflow.com/questions/50533901/multipart-put-with-requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4660/reactions" }
https://api.github.com/repos/psf/requests/issues/4660/timeline
null
completed
null
null
false
[ "> I keep getting error \"413 Request Entity Too Large\" from my Apache httpd.\r\n\r\nThe documentation might be misleading, but we do support `multipart/form-data` content in a `PUT`. `POST` requests are merely the 99% use-case. It seems your Apache server, however, will not accept the request you're sending for literally the reason it is telling you.\r\n\r\nThe only potential \"bug\" with requests might be that your Apache server is expecting us to use the `100-continue` workflow which we cannot support. There are other issues about this and so this is at best a duplicate of those.\r\n\r\nAny further information should continue to be added on StackOverflow." ]
https://api.github.com/repos/psf/requests/issues/4659
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4659/labels{/name}
https://api.github.com/repos/psf/requests/issues/4659/comments
https://api.github.com/repos/psf/requests/issues/4659/events
https://github.com/psf/requests/issues/4659
326,541,881
MDU6SXNzdWUzMjY1NDE4ODE=
4,659
requests[security] breaks on Python 2.6 after pyOpenSSL 18.0.0 (2018-05-16) drops support
{ "avatar_url": "https://avatars.githubusercontent.com/u/454042?v=4", "events_url": "https://api.github.com/users/dwightgunning/events{/privacy}", "followers_url": "https://api.github.com/users/dwightgunning/followers", "following_url": "https://api.github.com/users/dwightgunning/following{/other_user}", "gists_url": "https://api.github.com/users/dwightgunning/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dwightgunning", "id": 454042, "login": "dwightgunning", "node_id": "MDQ6VXNlcjQ1NDA0Mg==", "organizations_url": "https://api.github.com/users/dwightgunning/orgs", "received_events_url": "https://api.github.com/users/dwightgunning/received_events", "repos_url": "https://api.github.com/users/dwightgunning/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dwightgunning/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dwightgunning/subscriptions", "type": "User", "url": "https://api.github.com/users/dwightgunning", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2018-05-25T14:15:59Z
2021-09-08T01:21:22Z
2018-06-12T15:29:42Z
NONE
resolved
WIth the 18.0.0 release, pyOpenSSL dropped support for Python 2.6. As requests[security] pins pyOpenSSL with only a minimum version, fresh installations of requests pick up the latest and incompatible dependency. ## Expected Result Requests[security] functions to work. ## Actual Result ```python NameError: global name 'memoryview' is not defined ``` ## Reproduction Steps ```python >>> import requests /Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. The next version of cryptography will drop support for Python 2.6 DeprecationWarning >>> requests.get('https://www.dwightgunning.com') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/requests/adapters.py", line 440, in send timeout=timeout File "/Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "/Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/urllib3/connectionpool.py", line 357, in _make_request conn.request(method, url, **httplib_request_kw) File "/Users/dwight/.pyenv/versions/2.6.6/lib/python2.6/httplib.py", line 914, in request self._send_request(method, url, body, headers) File "/Users/dwight/.pyenv/versions/2.6.6/lib/python2.6/httplib.py", line 951, in _send_request self.endheaders() File "/Users/dwight/.pyenv/versions/2.6.6/lib/python2.6/httplib.py", line 908, in endheaders self._send_output() File "/Users/dwight/.pyenv/versions/2.6.6/lib/python2.6/httplib.py", line 780, in _send_output self.send(msg) File "/Users/dwight/.pyenv/versions/2.6.6/lib/python2.6/httplib.py", line 759, in send self.sock.sendall(str) File "/Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/urllib3/contrib/pyopenssl.py", line 316, in sendall sent = self._send_until_done(data[total_sent:total_sent + SSL_WRITE_BLOCKSIZE]) File "/Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/urllib3/contrib/pyopenssl.py", line 304, in _send_until_done return self.connection.send(data) File "build/bdist.macosx-10.13-x86_64/egg/OpenSSL/SSL.py", line 1719, in send NameError: global name 'memoryview' is not defined ``` ## System Information ```bash $ python --version Python 2.6.6 $ python -m requests.help /Users/dwight/.local/share/virtualenvs/stream-python-z8k7CN8K/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. The next version of cryptography will drop support for Python 2.6 DeprecationWarning { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.1.4" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.6.6" }, "platform": { "release": "17.5.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "100020ff", "version": "18.0.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "" }, "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/4659/reactions" }
https://api.github.com/repos/psf/requests/issues/4659/timeline
null
completed
null
null
false
[ "Hey @dwightgunning, thanks for bringing this to our attention! I think the easiest option is to pin a max version for Python 2.6 specifically in our `security` section of setup.py. Similar to how we handle `win_inet_pton`.\r\n\r\nOne thing we may want to consider is the implications of further supporting 2.6 as a “secure” option though. Given that it’s no longer (to my knowledge) receiving security updates and we’re pinning security packages at a possibly flawed point in time, do we want to reconsider dropping 2.6 prior to Requests 3.0.0?\r\n\r\n/cc @Sigmavirus24", "We haven't tested against Python 2.6 in a long time, @nateprewitt. In my mind, we dropped support for it a long time ago. Between pip dropping support for it, most packaging libraries dropping support for it, and our inability to test on Python 2.6, I think calling it unsupported in the next release is only reasonable.", "Fair.\r\n\r\nI setup a fork to test the fix proposed by @nateprewitt and works with my test application.\r\n\r\nhttps://github.com/dwightgunning/requests/commits/v2.18.4-patched-for-py2.6\r\n\r\nIt's probably not really worthy of a PR but happy to raise one if you'd like to see it.\r\n\r\nAn alternative for anybody defining a package with setuptools is to use the `install_requires` property. For instance:\r\n\r\n```python\r\ninstall_requires = []\r\nif sys.version_info < (2, 7, 0):\r\n install_requires.append('pyOpenSSL<18.0.0')\r\n\r\nsetup(\r\n # snip\r\n install_requires=install_requires\r\n)\r\n```\r\n\r\n", "Also worth noting that urllib3 does still test against Python 2.6 and is using https://github.com/urllib3/urllib3/pull/1389 to fix this. I wonder if our \"security\" extra should just depend on the \"secure\" urllib3 extra and let that do that all the heavy lifting.\r\n\r\nAs for the alternative fix you've proposed @dwightgunning that only works if people are installing from an sdist. If anyone were to package a wheel for this, then they would not receive the right package version unless they capped it another way.", "Python 2.6 was dropped by requests 3 in May 2017 (https://github.com/requests/requests/pull/4118).\r\n\r\nPython 2.6 has been unsupported/EOL, and no longer receiving security updates (or any updates), from the core Python team since October 2013.\r\n\r\n<img width=65% src=https://user-images.githubusercontent.com/1324225/40718094-78fb0814-6417-11e8-90d4-35e7343727a4.png>\r\n\r\nhttps://en.wikipedia.org/wiki/CPython#Version_history\r\n\r\nAnd there's relatively few pip installs on 2.6 for requests from PyPI (April 2018):\r\n\r\n| python_version | percent | download_count |\r\n| -------------- | ------: | -------------: |\r\n| 2.7 | 64.02% | 4,941,921 |\r\n| 3.6 | 21.76% | 1,679,455 |\r\n| 3.5 | 8.29% | 639,898 |\r\n| 3.4 | 5.38% | 415,136 |\r\n| 2.6 | 0.28% | 21,280 |\r\n| 3.7 | 0.16% | 12,724 |\r\n| 3.3 | 0.11% | 8,204 |\r\n| 3.2 | 0.01% | 808 |\r\n| 3.8 | 0.00% | 52 |\r\n| None | 0.00% | 46 |\r\n| Total | | 7,719,524 |\r\n\r\nSource: `pypinfo --start-date 2018-04-01 --end-date 2018-04-30 --percent --markdown requests pyversion`", "@hugovk 2.6 *and* 2.7 are planned to be unsupported with requests3. @nateprewitt already explained that.\r\n\r\nThank you for providing the download stats. I didn't know pypinfo did that. ", "Hi again @hugovk, the plan is still to *remove* 2.6 (and in general python2) support in Requests3. The next release will simply be removing documentation that we support Python 2.6. I don't think there's a need to break existing implementations just because we don't support it anymore.", "The statement of support for 2.6 in the current stable release was the reason I opened the issue. I understand it's annoying that the problem is introducing via an upstream change but I figured it's worth noting.\r\n\r\nIf there's a reasonable way to restore a \"workable\" py2.6 + Requests2 (even if the python version and some upstream deps aren't maintained) it'll probably be helpful to people.", "Hi @dwightgunning, this is resolved in 2.19.0 which is now up on PyPI. We've also removed 2.6 references from the documentation, so going forward we'll be focusing on 2.7 for our Python 2 support target. Ideally Python 2.6 will continue working for the foreseeable future, but we won't be putting resources towards fixing future 2.6-specific issues.\r\n\r\nThanks again for letting us know about this!" ]
https://api.github.com/repos/psf/requests/issues/4658
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4658/labels{/name}
https://api.github.com/repos/psf/requests/issues/4658/comments
https://api.github.com/repos/psf/requests/issues/4658/events
https://github.com/psf/requests/issues/4658
325,737,344
MDU6SXNzdWUzMjU3MzczNDQ=
4,658
KeyError with Instabot on python 2.7.15 for mac
{ "avatar_url": "https://avatars.githubusercontent.com/u/39561770?v=4", "events_url": "https://api.github.com/users/hamadberlin/events{/privacy}", "followers_url": "https://api.github.com/users/hamadberlin/followers", "following_url": "https://api.github.com/users/hamadberlin/following{/other_user}", "gists_url": "https://api.github.com/users/hamadberlin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hamadberlin", "id": 39561770, "login": "hamadberlin", "node_id": "MDQ6VXNlcjM5NTYxNzcw", "organizations_url": "https://api.github.com/users/hamadberlin/orgs", "received_events_url": "https://api.github.com/users/hamadberlin/received_events", "repos_url": "https://api.github.com/users/hamadberlin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hamadberlin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hamadberlin/subscriptions", "type": "User", "url": "https://api.github.com/users/hamadberlin", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-23T14:39:47Z
2021-09-08T02:09:54Z
2018-05-23T22:35:47Z
NONE
resolved
hey guys, i'm really trying to fix that problem and did research on internet but im not able to finde the selution. can someone help me? *please *freshman MacBook-Air:instabot.py-master2 XXX$ python example.py 23.05.2018_16:30 Instabot v1.2.0 started at 23.05.2018 16:30: 23.05.2018_16:30 Trying to login as XXXX... Traceback (most recent call last): File "example.py", line 52, in <module> unfollow_whitelist=['example_user_1', 'example_user_2']) File "/Users/XXX/Desktop/instabot.py-master2/src/instabot.py", line 232, in __init__ self.login() File "/Users/XXX/Desktop/instabot.py-master2/src/instabot.py", line 283, in login self.s.headers.update({'X-CSRFToken': r.cookies['csrftoken']}) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/cookies.py", line 329, in __getitem__ return self._find_no_duplicates(name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests/cookies.py", line 400, in _find_no_duplicates raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path)) KeyError: "name='csrftoken', domain=None, path=None"
{ "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/4658/reactions" }
https://api.github.com/repos/psf/requests/issues/4658/timeline
null
completed
null
null
false
[ "solution here: https://github.com/instabot-py/instabot.py/issues/1287\r\n\r\nCLOSED" ]
https://api.github.com/repos/psf/requests/issues/4657
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4657/labels{/name}
https://api.github.com/repos/psf/requests/issues/4657/comments
https://api.github.com/repos/psf/requests/issues/4657/events
https://github.com/psf/requests/issues/4657
325,447,919
MDU6SXNzdWUzMjU0NDc5MTk=
4,657
Certificate verify failed SSLError
{ "avatar_url": "https://avatars.githubusercontent.com/u/14719521?v=4", "events_url": "https://api.github.com/users/pmesgari/events{/privacy}", "followers_url": "https://api.github.com/users/pmesgari/followers", "following_url": "https://api.github.com/users/pmesgari/following{/other_user}", "gists_url": "https://api.github.com/users/pmesgari/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pmesgari", "id": 14719521, "login": "pmesgari", "node_id": "MDQ6VXNlcjE0NzE5NTIx", "organizations_url": "https://api.github.com/users/pmesgari/orgs", "received_events_url": "https://api.github.com/users/pmesgari/received_events", "repos_url": "https://api.github.com/users/pmesgari/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pmesgari/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pmesgari/subscriptions", "type": "User", "url": "https://api.github.com/users/pmesgari", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2018-05-22T20:19:44Z
2021-09-08T02:09:54Z
2018-05-23T22:47:24Z
NONE
resolved
Calling a google calendar API results in `certificate verify failure`. ## Expected Result A successful API response, since the API endpoint is running fine ## Actual Result ``` C:\Workspace\Techroom\venvs\lazyhour\lazyhour\Scripts\python.exe C:/Workspace/Techroom/lazyhour-server/main.py * Serving Flask app "main" (lazy loading) * Environment: development * Debug mode: on * Restarting with stat * Debugger is active! * Debugger PIN: 279-826-945 * Running on http://localhost:5000/ (Press CTRL+C to quit) C:\Workspace\Techroom\lazyhour-server\util\service_account.json 127.0.0.1 - - [22/May/2018 15:22:56] "GET /calendar/list HTTP/1.1" 500 - Traceback (most recent call last): File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\app.py", line 2309, in __call__ return self.wsgi_app(environ, start_response) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\app.py", line 2295, in wsgi_app response = self.handle_exception(e) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask_restful\__init__.py", line 273, in error_router return original_handler(e) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\app.py", line 1741, in handle_exception reraise(exc_type, exc_value, tb) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\_compat.py", line 34, in reraise raise value.with_traceback(tb) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask_restful\__init__.py", line 273, in error_router return original_handler(e) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\_compat.py", line 34, in reraise raise value.with_traceback(tb) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask_restful\__init__.py", line 480, in wrapper resp = resource(*args, **kwargs) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask\views.py", line 88, in view return self.dispatch_request(*args, **kwargs) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask_restful\__init__.py", line 595, in dispatch_request resp = meth(*args, **kwargs) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\flask_httpauth.py", line 93, in decorated return f(*args, **kwargs) File "C:\Workspace\Techroom\lazyhour-server\main.py", line 45, in get return calendar_service.get_calendar_list() File "C:\Workspace\Techroom\lazyhour-server\util\calendar_service.py", line 25, in get_calendar_list response = self.authed_session.get(self.service_base_url) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\requests\sessions.py", line 521, in get return self.request('GET', url, **kwargs) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\google\auth\transport\requests.py", line 198, in request self._auth_request, method, url, request_headers) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\google\auth\credentials.py", line 121, in before_request self.refresh(request) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\google\oauth2\service_account.py", line 322, in refresh request, self._token_uri, assertion) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\google\oauth2\_client.py", line 145, in jwt_grant response_data = _token_endpoint_request(request, token_uri, body) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\google\oauth2\_client.py", line 106, in _token_endpoint_request method='POST', url=token_uri, headers=headers, body=body) File "C:\Workspace\Techroom\venvs\lazyhour\lazyhour\lib\site-packages\google\auth\transport\requests.py", line 124, in __call__ six.raise_from(new_exc, caught_exc) File "<string>", line 3, in raise_from # Permission is hereby granted, free of charge, to any person obtaining a copy google.auth.exceptions.TransportError: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),)) ``` ## Reproduction Steps ``` from .auth_service import get_credentials from google.auth.transport.requests import AuthorizedSession import json # Calendar service class CalendarService: def __init__(self, calendar_id=''): self.credentials = get_credentials() self.authed_session = AuthorizedSession(self.credentials) self.service_base_url = 'https://www.googleapis.com/calendar/v3/users/me/calendarList' self.calendar_id = calendar_id def get_service_url(self): return('{base_url}/{calendar_id}'.format( base_url=self.service_base_url, calendar_id=self.calendar_id)) def get_calendar(self): response = self.authed_session.get(self.get_service_url()) calendar = response.json() return calendar def get_calendar_list(self): response = self.authed_session.get(self.service_base_url) calendar_list = response.json() return calendar_list ``` ## System Information The output of pip freeze is: ``` aniso8601==3.0.0 cachetools==2.1.0 certifi==2018.4.16 chardet==3.0.4 click==6.7 Flask==1.0.2 Flask-Cors==3.0.4 Flask-HTTPAuth==3.2.3 Flask-RESTful==0.3.6 google-auth==1.4.1 idna==2.6 itsdangerous==0.24 Jinja2==2.10 MarkupSafe==1.0 pyasn1==0.4.2 pyasn1-modules==0.2.1 pytz==2018.4 requests==2.18.4 rsa==3.4.2 six==1.11.0 urllib3==1.22 Werkzeug==0.14.1 ``` Python 3.6 Windows 10 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/4657/reactions" }
https://api.github.com/repos/psf/requests/issues/4657/timeline
null
completed
null
null
false
[ "I changed the default value for `verify` argument in `sessions.py` file. and the error is gone Here is the method that defines the `request`:\r\n```\r\n def request(self, method, url,\r\n params=None, data=None, headers=None, cookies=None, files=None,\r\n auth=None, timeout=None, allow_redirects=True, proxies=None,\r\n hooks=None, stream=None, verify=False, cert=None, json=None):\r\n \"\"\"Constructs a :class:`Request <Request>`, prepares it and sends it.\r\n Returns :class:`Response <Response>` object.\r\n\r\n :param method: method for the new :class:`Request` object.\r\n :param url: URL for the new :class:`Request` object.\r\n :param params: (optional) Dictionary or bytes to be sent in the query\r\n string for the :class:`Request`.\r\n :param data: (optional) Dictionary, bytes, or file-like object to send\r\n in the body of the :class:`Request`.\r\n :param json: (optional) json to send in the body of the\r\n :class:`Request`.\r\n :param headers: (optional) Dictionary of HTTP Headers to send with the\r\n :class:`Request`.\r\n :param cookies: (optional) Dict or CookieJar object to send with the\r\n :class:`Request`.\r\n :param files: (optional) Dictionary of ``'filename': file-like-objects``\r\n for multipart encoding upload.\r\n :param auth: (optional) Auth tuple or callable to enable\r\n Basic/Digest/Custom HTTP Auth.\r\n :param timeout: (optional) How long to wait for the server to send\r\n data before giving up, as a float, or a :ref:`(connect timeout,\r\n read timeout) <timeouts>` tuple.\r\n :type timeout: float or tuple\r\n :param allow_redirects: (optional) Set to True by default.\r\n :type allow_redirects: bool\r\n :param proxies: (optional) Dictionary mapping protocol or protocol and\r\n hostname to the URL of the proxy.\r\n :param stream: (optional) whether to immediately download the response\r\n content. Defaults to ``False``.\r\n :param verify: (optional) Either a boolean, in which case it controls whether we verify\r\n the server's TLS certificate, or a string, in which case it must be a path\r\n to a CA bundle to use. Defaults to ``True``.\r\n :param cert: (optional) if String, path to ssl client cert file (.pem).\r\n If Tuple, ('cert', 'key') pair.\r\n :rtype: requests.Response\r\n \"\"\"\r\n # Create the Request.\r\n req = Request(\r\n method=method.upper(),\r\n url=url,\r\n headers=headers,\r\n files=files,\r\n data=data or {},\r\n json=json,\r\n params=params or {},\r\n auth=auth,\r\n cookies=cookies,\r\n hooks=hooks,\r\n )\r\n prep = self.prepare_request(req)\r\n\r\n proxies = proxies or {}\r\n\r\n settings = self.merge_environment_settings(\r\n prep.url, proxies, stream, verify, cert\r\n )\r\n\r\n # Send the request.\r\n send_kwargs = {\r\n 'timeout': timeout,\r\n 'allow_redirects': allow_redirects,\r\n }\r\n send_kwargs.update(settings)\r\n resp = self.send(prep, **send_kwargs)\r\n\r\n return resp\r\n```", "By the way just to save time please do not pass me back to google to resolve this issue, I already submitted an [issue](https://github.com/GoogleCloudPlatform/google-auth-library-python/issues/257) on the `google-auth` github repo, and they have declared you as responsible for the error.", "Hi @pmesgari,\r\n\r\nIt seems like there may be some confusion about what’s going on here. The Python SSL module is rejecting your supplied certificate because it can’t be verified. The comment @theacodes linked in the original ticket has some more info on that.\r\n\r\nThe traceback you provided uses a large amount of code that isn’t part of Requests that appears to be creating auth objects that may be being handed to Requests. We’ll need a stripped down version of this, with an example of the kind of cert/credentials being provided before we’d be able to start debugging this.\r\n\r\nThat said, with the current information I don’t believe this is a defect in Requests, but rather bad input. Until we have confirmation there’s actually a bug here, this is something that would likely be better tracked in a [StackOverflow](https://stackoverflow.com) question.", "@nateprewitt that is the response I was afraid of, `google-auth-library-python` people are blaming `requests` and you are saying it is the code being handed to Requests. That extra code you are mentioning is generated by `google-auth-library-python`. So how to go about this?", "Whoa, definitely not blaming requests! (I'd only be blaming myself anyway,\nas I'm the maintainer of urllib3). Google auth doesn't do anything in terms\nof overriding request's ssl stuff, we just inject an authorization header.\n\nI linked to this issue to show that this is not an issue that is unique to\ngoogle-auth. Lots of users run into this and as the comment above mentions\nit is due to an outdated ssl version. Your options are to either update\nopenssl (which generally means updating Python) or switch to a more\ninsecure set of CA certificates.\n\nOn Tue, May 22, 2018, 2:36 PM Payam <[email protected]> wrote:\n\n> @nateprewitt <https://github.com/nateprewitt> that is the response I was\n> afraid of google-auth-library-python people are blaming requests and you\n> are saying it is the code being handed to Requests. That extra code you are\n> mentioning is generated by google-auth-library-python. So how to go about\n> this?\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/4657#issuecomment-391148712>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAPUc-GgdI6IcwUinBmSgeSp-fq-AWZqks5t1ITcgaJpZM4UJU0F>\n> .\n>\n", "@pmesgari, I’d start with the code you’ve written and work backwards from there. You may consider using something like `pdb` to see what objects are being handed to the Requests call. Likely the most important piece of information is the SSL certificate being used.\r\n\r\nOnce you know that, you should be able to create a much simpler repro and we can work from there in a StackOverflow question. Right now responses here are being pushed to 1200 people that are subscribed to this for the purpose on monitoring issues in Requests. Feel free to link the Stackoverflow issue here and I’ll follow up there.\r\n\r\nI’d also try this on another machine/on a basic network configuration to verify this isn’t an environmental issues.", "@nateprewitt this should be easily reduced by just making a request to \"\nhttps://accounts.google.com\".\n\nOn Tue, May 22, 2018, 2:42 PM Nate Prewitt <[email protected]> wrote:\n\n> @pmesgari <https://github.com/pmesgari>, I’d start with the code you’ve\n> written and work backwards from there. You may consider using something\n> like pdb to see what objects are being handed to the Requests call.\n> Likely the most important piece of information is the SSL certificate being\n> used.\n>\n> Once you know that, you should be able to create a much simpler repro and\n> we can work from there in a StackOverflow question. Right now responses\n> here are being pushed to 1200 people that are subscribed to this for the\n> purpose on monitoring issues in Requests. Feel free to link the\n> Stackoverflow issue here and I’ll follow up there.\n>\n> I’d also try this on another machine/on a basic network configuration to\n> verify this isn’t an environmental issues.\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/4657#issuecomment-391150095>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAPUcz6fwID4js0bMkO75I6zd0m1KAseks5t1IY4gaJpZM4UJU0F>\n> .\n>\n", "@nateprewitt I have already created the StackOverflow [question](https://stackoverflow.com/questions/50469027/certificate-verify-failed-google-api). I will also try to update openssl and get a smaller repo.", "@theacodes yep, that’s likely all we need, I haven’t had a chance to look very deep into what all was being passed around. My guess is this is likely an OpenSSL issue or some other system configuration :)\r\n\r\n@pmesgari, thanks! We’ll follow up over there.", "@pmesgari An easy way to get a newer openssl on your system is by installing the latest pyOpenSSL which requests will use automagically." ]
https://api.github.com/repos/psf/requests/issues/4656
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4656/labels{/name}
https://api.github.com/repos/psf/requests/issues/4656/comments
https://api.github.com/repos/psf/requests/issues/4656/events
https://github.com/psf/requests/issues/4656
325,395,151
MDU6SXNzdWUzMjUzOTUxNTE=
4,656
Requests to groupon 403 response
{ "avatar_url": "https://avatars.githubusercontent.com/u/5991118?v=4", "events_url": "https://api.github.com/users/GinVlad/events{/privacy}", "followers_url": "https://api.github.com/users/GinVlad/followers", "following_url": "https://api.github.com/users/GinVlad/following{/other_user}", "gists_url": "https://api.github.com/users/GinVlad/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/GinVlad", "id": 5991118, "login": "GinVlad", "node_id": "MDQ6VXNlcjU5OTExMTg=", "organizations_url": "https://api.github.com/users/GinVlad/orgs", "received_events_url": "https://api.github.com/users/GinVlad/received_events", "repos_url": "https://api.github.com/users/GinVlad/repos", "site_admin": false, "starred_url": "https://api.github.com/users/GinVlad/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/GinVlad/subscriptions", "type": "User", "url": "https://api.github.com/users/GinVlad", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-22T17:36:16Z
2021-09-08T02:09:55Z
2018-05-22T17:39:32Z
NONE
resolved
`import requests as re headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Firefox/60.0', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-US,en;q=0.5', 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', } r = re.Session() print r.get('https://www.groupon.com/signup?ref=https%3A%2F%2Fwww.groupon.com%2Fmyaccount', headers=headers)` I receive 403 response. How to pass it
{ "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/4656/reactions" }
https://api.github.com/repos/psf/requests/issues/4656/timeline
null
completed
null
null
false
[ "Hi @GinVlad, this looks like a request for help. As per our issue tracker guidelines, requests for help should be directed to [StackOverflow](https://stackoverflow.com). You can use the `python-requests` tag to better surface the question. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/4655
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4655/labels{/name}
https://api.github.com/repos/psf/requests/issues/4655/comments
https://api.github.com/repos/psf/requests/issues/4655/events
https://github.com/psf/requests/issues/4655
325,329,832
MDU6SXNzdWUzMjUzMjk4MzI=
4,655
Connection Reset by Peer
{ "avatar_url": "https://avatars.githubusercontent.com/u/2609402?v=4", "events_url": "https://api.github.com/users/etothepii/events{/privacy}", "followers_url": "https://api.github.com/users/etothepii/followers", "following_url": "https://api.github.com/users/etothepii/following{/other_user}", "gists_url": "https://api.github.com/users/etothepii/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/etothepii", "id": 2609402, "login": "etothepii", "node_id": "MDQ6VXNlcjI2MDk0MDI=", "organizations_url": "https://api.github.com/users/etothepii/orgs", "received_events_url": "https://api.github.com/users/etothepii/received_events", "repos_url": "https://api.github.com/users/etothepii/repos", "site_admin": false, "starred_url": "https://api.github.com/users/etothepii/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/etothepii/subscriptions", "type": "User", "url": "https://api.github.com/users/etothepii", "user_view_type": "public" }
[ { "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" } ]
closed
true
null
[]
null
10
2018-05-22T14:49:54Z
2021-09-08T01:21:23Z
2018-06-12T15:24:11Z
NONE
resolved
## Summary While making an HTTPS GET request to fema.gov I get a Connection Reset Error, this is confirmed on multiple machines not to happen in Python 2 but does happen on Python 3, both are using the same version of requests. Very bizarrely (in this case) the failure occurs when trying to read the 3704 byte. (discovered by using lower level functions). Below is the URL: `https://hazards.fema.gov/gis/nfhl/rest/services/public/NFHL/MapServer/16/query?where=&text=&objectIds=&time=&geometry=-9240000%2C4400000%2C-9230000%2C4410000&geometryType=esriGeometryEnvelope&inSR=102100&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson` Things I have tried: * User-Agent strings * Disabling verify * Using machines with different IP addresses * Matching all libraries except openssl_version to the working Python 2.7 environment ## Reproduction Steps ``` python import requests url ="https://hazards.fema.gov/gis/nfhl/rest/services/public/NFHL/MapServer/16/query?where=&text=&objectIds=&time=&geometry=-9240000%2C4400000%2C-9230000%2C4410000&geometryType=esriGeometryEnvelope&inSR=102100&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson" response=requests.get(url) ``` ## System Information ``` $ python -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.2.2" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.4" }, "platform": { "release": "4.13.0-21-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010008f", "version": "18.0.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1010006f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ``` As noted above the request works fine in Python 2.7 ``` $ python -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "1.9" }, "implementation": { "name": "CPython", "version": "2.7.14" }, "platform": { "release": "4.13.0-21-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1000207f", "version": "16.2.0" }, "requests": { "version": "2.18.1" }, "system_ssl": { "version": "1000207f" }, "urllib3": { "version": "1.21.1" }, "using_pyopenssl": true } ``` I have tried to get the versions of my Python 3 to match but even doing this the request still fails in Python 3. ``` $ python -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "1.9" }, "implementation": { "name": "CPython", "version": "3.6.4" }, "platform": { "release": "4.13.0-21-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010006f", "version": "16.2.0" }, "requests": { "version": "2.18.1" }, "system_ssl": { "version": "1010006f" }, "urllib3": { "version": "1.21.1" }, "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/4655/reactions" }
https://api.github.com/repos/psf/requests/issues/4655/timeline
null
completed
null
null
false
[ "Have you ever tried that using a browser to get the response of the API?\r\nIt seems that the problem was caused by the remote server error.", "Works in a browser, works in CURL, works in python 2.7. Works in Python 3.6 using this awful, awful code\r\n\r\n``` \r\ncmd = \"curl -o {cache_file} {url}\".format(\r\n url=url, cache_file=cache_file)\r\np = subprocess.Popen(cmd.split())\r\ntry:\r\n p.communicate(timeout=30)\r\n if p.returncode != 0:\r\n raise Exception()\r\nexcept subprocess.TimeoutExpired:\r\n p.kill()\r\n p.communicate()\r\n raise Exception()\r\n```", "@etothepii Before we get started, your GitHub handle is *excellent*.\r\n\r\nNext, I've noticed a few discrepancies:\r\n\r\n1. Your version of Requests is different across your test environments\r\n1. Your urllib3 versions are different\r\n1. Your pyOpenSSL and Cryptography versions are different\r\n1. As a result of the discrepancy in pyOpenSSL and Cryptography, the *actual* OpenSSL versions you're using are different.\r\n\r\nCan you retest with the same versions of requests, urllib3, pyOpenSSL, and cryptography?\r\n\r\nI attempted on a Mac with Python 3.6 to retrieve that URL and it works fine.", "@etothepii We haven't heard back from you in a few days and it doesn't seem like this is entirely reproducible with what you've given us. As a result, I'm proposing we close this after a few more days. Let us know if you have further information that points to this being a bug in requests.\r\n\r\nCheers,\r\nIan", "Hi Ian, \r\n\r\nThank you for you help, it is very much appreciated.\r\n\r\nAs discussed above I have satisfied the immediate problem by running curl in a sub process but that seems like a horrible solution.\r\n\r\nI really appreciate your help and I agree with you that it works on some other setups. As evidenced by it working on Python 3. To me this suggests that it is most likely not the server that is at fault (as would be the normal response to a Connection Reset by Peer). Doesn't it seem so very odd to you that I am able to make the request and get a 200 response using lower level functions but get the connection reset if trying to read past char 3704, despite the message clearly being 15000 chars long?\r\n\r\nPlease accept my apologies for the confusion above - with diagnostics. I was trying to show that I had already tried to align my non-working Python 3 system with a working Python 2 system, by showing what I had changed it to. As far as I can see I have managed to sync everything up between the working between them except for the system SSL version which is 1000207f (working) rather than 1010006f (non-working). Everything else is the same according to my version of Beyond Compare (image attached).\r\n\r\nAny help or suggestions for further avenues of inquiry would be very welcome.\r\n\r\nKind regards,\r\n\r\nJames\r\n\r\n![image](https://user-images.githubusercontent.com/2609402/40588261-192492d8-61b1-11e8-9fa7-e63344926193.png)", "So is it correct to say that the \"Broken\" side of your screenshot is what the current state of your system is after trying to make things match?", "Yes, I could not figure out a good way to change the system_ssl version. The words are too common to search well on Google. I would not object to closing the issue if no-one else has reported similar behavior, using curl in a sub-process does solve the problem - even if not in a very pythonic way. If you can think of anything I can do that might help to diagnose the problem I will do so happily but if nothing is immediately coming to mind then I would rather not waste your time. \r\n\r\nThank you for your help.", "@etothepii Can you also share how you've installed the following:\r\n\r\n- python2\r\n- python3\r\n- requests (python 2)\r\n- requests (python 3)\r\n- pyOpenSSL (python 2)\r\n- pyOpenSSL (python 3)\r\n- openssl\r\n\r\nAre both python 2 and python 3 installed on the same system?", "I really appreciate your help.\r\n\r\nI had hoped it would be something obvious and that by talking it out the answer would present itself. It has not, and with curl working as a viable solution I will have to stick with that and move on.\r\n\r\nEverything is running in Docker with installation via pip.", "Thanks for checking back in @etothepii. Since it doesn't look like there is more information to work with, and this seems to be a local configuration issue, I'm going to close this out.\r\n\r\nPlease feel free to reopen if you have more information later. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/4654
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4654/labels{/name}
https://api.github.com/repos/psf/requests/issues/4654/comments
https://api.github.com/repos/psf/requests/issues/4654/events
https://github.com/psf/requests/issues/4654
325,254,950
MDU6SXNzdWUzMjUyNTQ5NTA=
4,654
Windows - SSL Error (certificate verify failed) with bundle
{ "avatar_url": "https://avatars.githubusercontent.com/u/30751516?v=4", "events_url": "https://api.github.com/users/danieldaeschle/events{/privacy}", "followers_url": "https://api.github.com/users/danieldaeschle/followers", "following_url": "https://api.github.com/users/danieldaeschle/following{/other_user}", "gists_url": "https://api.github.com/users/danieldaeschle/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/danieldaeschle", "id": 30751516, "login": "danieldaeschle", "node_id": "MDQ6VXNlcjMwNzUxNTE2", "organizations_url": "https://api.github.com/users/danieldaeschle/orgs", "received_events_url": "https://api.github.com/users/danieldaeschle/received_events", "repos_url": "https://api.github.com/users/danieldaeschle/repos", "site_admin": false, "starred_url": "https://api.github.com/users/danieldaeschle/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/danieldaeschle/subscriptions", "type": "User", "url": "https://api.github.com/users/danieldaeschle", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-22T11:37:16Z
2021-09-08T02:09:55Z
2018-05-22T13:29:44Z
NONE
resolved
**Note** - Under WSL it works, but not under Windows When i use (this also doesn't work on WSL) ``` requests.get('https://domain', verify='/path/to/my/bundle') ``` I get: ``` >>> requests.get('https://google.de', verify='C:/Users/i01002704/Documents/SSL-Certificate_Chain_PEM/k') Traceback (most recent call last): File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\contrib\pyopenssl.py", line 441, in wrap_socket cnx.do_handshake() File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenSSL\SSL.py", line 1806, in do_handshake self._raise_ssl_error(self._ssl, result) File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenSSL\SSL.py", line 1546, in _raise_ssl_error _raise_current_error() File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenSSL\_util.py", line 54, in exception_from_error_queue raise exception_type(errors) OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 595, in urlopen self._prepare_proxy(conn) File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 816, in _prepare_proxy conn.connect() File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connection.py", line 326, in connect ssl_context=context) File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\contrib\pyopenssl.py", line 448, in wrap_socket raise ssl.SSLError('bad handshake: %r' % e) ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\adapters.py", line 440, in send timeout=timeout File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3\util\retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='google.de', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\api.py", line 72, in get return request('get', url, params=params, **kwargs) File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "C:\Users\i01002704\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='google.de', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),)) ``` Another try was using path to directory where certificates are stored instead of bundle (this works on WSL) /path/to/certs/ which looks like: ![image](https://user-images.githubusercontent.com/30751516/40360073-21d5853a-5dc5-11e8-910b-ee83343cd8a5.png) I created the bundle with: ``` cat File1 File2 File3 >> bundle.pem ``` I always get this error. Why? I hope you can help me.
{ "avatar_url": "https://avatars.githubusercontent.com/u/30751516?v=4", "events_url": "https://api.github.com/users/danieldaeschle/events{/privacy}", "followers_url": "https://api.github.com/users/danieldaeschle/followers", "following_url": "https://api.github.com/users/danieldaeschle/following{/other_user}", "gists_url": "https://api.github.com/users/danieldaeschle/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/danieldaeschle", "id": 30751516, "login": "danieldaeschle", "node_id": "MDQ6VXNlcjMwNzUxNTE2", "organizations_url": "https://api.github.com/users/danieldaeschle/orgs", "received_events_url": "https://api.github.com/users/danieldaeschle/received_events", "repos_url": "https://api.github.com/users/danieldaeschle/repos", "site_admin": false, "starred_url": "https://api.github.com/users/danieldaeschle/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/danieldaeschle/subscriptions", "type": "User", "url": "https://api.github.com/users/danieldaeschle", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4654/reactions" }
https://api.github.com/repos/psf/requests/issues/4654/timeline
null
completed
null
null
false
[ "i can make request without cert bundle. nvm. it works now behind proxy....." ]
https://api.github.com/repos/psf/requests/issues/4653
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4653/labels{/name}
https://api.github.com/repos/psf/requests/issues/4653/comments
https://api.github.com/repos/psf/requests/issues/4653/events
https://github.com/psf/requests/issues/4653
324,825,494
MDU6SXNzdWUzMjQ4MjU0OTQ=
4,653
Content-Length is not correct while sending post request
{ "avatar_url": "https://avatars.githubusercontent.com/u/2647332?v=4", "events_url": "https://api.github.com/users/zhanglue/events{/privacy}", "followers_url": "https://api.github.com/users/zhanglue/followers", "following_url": "https://api.github.com/users/zhanglue/following{/other_user}", "gists_url": "https://api.github.com/users/zhanglue/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhanglue", "id": 2647332, "login": "zhanglue", "node_id": "MDQ6VXNlcjI2NDczMzI=", "organizations_url": "https://api.github.com/users/zhanglue/orgs", "received_events_url": "https://api.github.com/users/zhanglue/received_events", "repos_url": "https://api.github.com/users/zhanglue/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhanglue/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhanglue/subscriptions", "type": "User", "url": "https://api.github.com/users/zhanglue", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-05-21T08:08:34Z
2021-09-08T02:09:55Z
2018-05-21T12:34:54Z
NONE
resolved
Hello~ I find the "REAL" CL, by 'tcpdump' the server host, is not according to the 'body data'. The type of data is serialized protobuf string, and I have specified it in headers as "'Content-type': 'application/x-protobuf'". Known point: 1. Content-Length(ab. CL) will be replaced even if it is specified in "headers". 2. CL can be set arbitrarily by Session. After times of failed trying, I send the same PB string by 'httplib' instead, which works well. Comparing the data dumped by tcpdumps, it seems like that data server received has been modified by 'requests' , while 'httplib' did not, even if the string dumped is not human readable. So I found I did it in a wrong way, the point is how to send bytes string by 'requests' but how to set CL. Right?
{ "avatar_url": "https://avatars.githubusercontent.com/u/2647332?v=4", "events_url": "https://api.github.com/users/zhanglue/events{/privacy}", "followers_url": "https://api.github.com/users/zhanglue/followers", "following_url": "https://api.github.com/users/zhanglue/following{/other_user}", "gists_url": "https://api.github.com/users/zhanglue/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhanglue", "id": 2647332, "login": "zhanglue", "node_id": "MDQ6VXNlcjI2NDczMzI=", "organizations_url": "https://api.github.com/users/zhanglue/orgs", "received_events_url": "https://api.github.com/users/zhanglue/received_events", "repos_url": "https://api.github.com/users/zhanglue/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhanglue/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhanglue/subscriptions", "type": "User", "url": "https://api.github.com/users/zhanglue", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4653/reactions" }
https://api.github.com/repos/psf/requests/issues/4653/timeline
null
completed
null
null
false
[ "I tired another way to send data in post: \r\n```\r\n...\r\nfiles = {\r\n 'field_A': (\r\n 'fileName_A', \r\n open('./pbFile.data', 'rb'),\r\n 'application/x-protobuf', \r\n )\r\n }\r\nresponse = requests.post(url, headers = headers, files=files)\r\n```\r\nIt does not work either.", "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).\r\n\r\nWe also need a complete example to reproduce with", "Sorry, I missed the env, and can't reproduce again......" ]
https://api.github.com/repos/psf/requests/issues/4652
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4652/labels{/name}
https://api.github.com/repos/psf/requests/issues/4652/comments
https://api.github.com/repos/psf/requests/issues/4652/events
https://github.com/psf/requests/issues/4652
324,739,070
MDU6SXNzdWUzMjQ3MzkwNzA=
4,652
Non-ASCII filename uploads don't comply with RFC 7578
{ "avatar_url": "https://avatars.githubusercontent.com/u/160562?v=4", "events_url": "https://api.github.com/users/bdarnell/events{/privacy}", "followers_url": "https://api.github.com/users/bdarnell/followers", "following_url": "https://api.github.com/users/bdarnell/following{/other_user}", "gists_url": "https://api.github.com/users/bdarnell/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bdarnell", "id": 160562, "login": "bdarnell", "node_id": "MDQ6VXNlcjE2MDU2Mg==", "organizations_url": "https://api.github.com/users/bdarnell/orgs", "received_events_url": "https://api.github.com/users/bdarnell/received_events", "repos_url": "https://api.github.com/users/bdarnell/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bdarnell/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bdarnell/subscriptions", "type": "User", "url": "https://api.github.com/users/bdarnell", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-05-20T20:20:10Z
2021-09-04T00:06:17Z
2018-05-21T15:33:54Z
NONE
resolved
When uploading a file with a non-ascii filename, that filename is encoded according to the method of RFC 5987 >>> requests.post('http://ya.ru', files={'file': (u'файл', '123')}).request.body b'--5cb06bfe9bc549e09dc080ed257f9555\r\nContent-Disposition: form-data; name="file"; filename*=utf-8\'\'%D1%84%D0%B0%D0%B9%D0%BB\r\n\r\n123\r\n--5cb06bfe9bc549e09dc080ed257f9555--\r\n' However, RFC 7578 (the current version of the `multipart/form-data` spec) explicitly prohibits the use of this encoding for the `filename` field of a `Content-Disposition` header (in a `multipart/form-data` body): > NOTE: The encoding method described in [RFC5987], which would add a > "filename*" parameter to the Content-Disposition header field, MUST > NOT be used. it's unclear to me why RFC 7578 made this decision, especially when its predecessor RFC 2388 said that RFC 2231 (which defines the encoding used in RFC 5987) "might" be used. This may be an example of an RFC that is at odds with practical usage. However, since it is quite explicit on this point we should consider whether following the new RFC would be better than the current implementation. Note that to add to the confusion, `Content-Disposition` when used *as an HTTP header* instead of in `multipart/form-data` is defined by RFC 6266, which specifies the use of RFC 5987. A lot of the references used to argue in favor of the RFC 5987 behavior in #2117 were actually about the HTTP header, not the form-data header (such as [this SO question](https://stackoverflow.com/questions/7967079/special-characters-in-content-disposition-filename)). For context, I'm looking at this as a result of a [PR](https://github.com/tornadoweb/tornado/pull/1898) to add RFC 5987 support to Tornado's multipart/form-data parser. We don't currently decode percent-encoded filenames according to RFC 7578 either, so something has to change on our side either way, but I thought I'd raise this issue since it's not clear that `requests` is handling this the right way. ## Expected Result A `Content-Disposition` header containing `filename=%D1%84%D0%B0%D0%B9%D0%BB` ## Actual Result A `Content-Disposition` header containing a `filename*=` header instead. ## Reproduction Steps ```python import requests print(requests.post('http://ya.ru', files={'file': (u'файл', '123')}).request.body) ``` ## System Information $ python -m requests.help ``` $ /tmp/reqs/bin/python -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.5" }, "platform": { "release": "17.5.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ff" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/160562?v=4", "events_url": "https://api.github.com/users/bdarnell/events{/privacy}", "followers_url": "https://api.github.com/users/bdarnell/followers", "following_url": "https://api.github.com/users/bdarnell/following{/other_user}", "gists_url": "https://api.github.com/users/bdarnell/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bdarnell", "id": 160562, "login": "bdarnell", "node_id": "MDQ6VXNlcjE2MDU2Mg==", "organizations_url": "https://api.github.com/users/bdarnell/orgs", "received_events_url": "https://api.github.com/users/bdarnell/received_events", "repos_url": "https://api.github.com/users/bdarnell/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bdarnell/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bdarnell/subscriptions", "type": "User", "url": "https://api.github.com/users/bdarnell", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4652/reactions" }
https://api.github.com/repos/psf/requests/issues/4652/timeline
null
completed
null
null
false
[ "Thanks for brining this to our attention! This belongs in urllib3/urllib3 however because that is the project that actually handles this encoding logic.", "OK. Looks like there's already an issue for this over there: https://github.com/urllib3/urllib3/issues/303", "(FYI, underlying urllib3 issue was [fixed](https://github.com/urllib3/urllib3/pull/1492) in urllib3 v1.25 (2019-04-22).)\r\n" ]
https://api.github.com/repos/psf/requests/issues/4651
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4651/labels{/name}
https://api.github.com/repos/psf/requests/issues/4651/comments
https://api.github.com/repos/psf/requests/issues/4651/events
https://github.com/psf/requests/issues/4651
324,073,255
MDU6SXNzdWUzMjQwNzMyNTU=
4,651
Could not fetch URL https://pypi.python.org/simple/spacy/: There was a problem confirming the ssl certificate: [Errno 1] _ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version - skipping
{ "avatar_url": "https://avatars.githubusercontent.com/u/32710596?v=4", "events_url": "https://api.github.com/users/AnilJagtap036/events{/privacy}", "followers_url": "https://api.github.com/users/AnilJagtap036/followers", "following_url": "https://api.github.com/users/AnilJagtap036/following{/other_user}", "gists_url": "https://api.github.com/users/AnilJagtap036/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/AnilJagtap036", "id": 32710596, "login": "AnilJagtap036", "node_id": "MDQ6VXNlcjMyNzEwNTk2", "organizations_url": "https://api.github.com/users/AnilJagtap036/orgs", "received_events_url": "https://api.github.com/users/AnilJagtap036/received_events", "repos_url": "https://api.github.com/users/AnilJagtap036/repos", "site_admin": false, "starred_url": "https://api.github.com/users/AnilJagtap036/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AnilJagtap036/subscriptions", "type": "User", "url": "https://api.github.com/users/AnilJagtap036", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-17T15:25:53Z
2018-05-17T16:07:29Z
2018-05-17T16:05:36Z
NONE
off-topic
Please refer to our [StackOverflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance. I'm using Stanford library in my python app. Now, I want to install Spacy library to implement some text parsing logic. When i'm trying to install Spacy library with python 2.7 version and pip 9.0.1 version. getting following error ``` C:\Users\Anil Jagtap>pip install -U spacy Collecting spacy c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning. SNIMissingWarning c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Could not fetch URL https://pypi.python.org/simple/spacy/: There was a problem confirming the ssl certificate: [Errno 1] _ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version - skipping Could not find a version that satisfies the requirement spacy (from versions: ) No matching distribution found for spacy c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning ``` How can I install Spacy library? Please help me. I'm facing this problem last 2 days.
{ "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/4651/reactions" }
https://api.github.com/repos/psf/requests/issues/4651/timeline
null
completed
null
null
false
[ "We ask you to search StackOverflow first because these problems are often already there.\r\n\r\nTo push you in the right direction here's what I've found: https://stackoverflow.com/a/23093834/1953283" ]
https://api.github.com/repos/psf/requests/issues/4650
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4650/labels{/name}
https://api.github.com/repos/psf/requests/issues/4650/comments
https://api.github.com/repos/psf/requests/issues/4650/events
https://github.com/psf/requests/issues/4650
323,979,686
MDU6SXNzdWUzMjM5Nzk2ODY=
4,650
verify in Session object ignored when REQUESTS_CA_BUNDLE is set
{ "avatar_url": "https://avatars.githubusercontent.com/u/7480559?v=4", "events_url": "https://api.github.com/users/jellestoel/events{/privacy}", "followers_url": "https://api.github.com/users/jellestoel/followers", "following_url": "https://api.github.com/users/jellestoel/following{/other_user}", "gists_url": "https://api.github.com/users/jellestoel/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jellestoel", "id": 7480559, "login": "jellestoel", "node_id": "MDQ6VXNlcjc0ODA1NTk=", "organizations_url": "https://api.github.com/users/jellestoel/orgs", "received_events_url": "https://api.github.com/users/jellestoel/received_events", "repos_url": "https://api.github.com/users/jellestoel/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jellestoel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jellestoel/subscriptions", "type": "User", "url": "https://api.github.com/users/jellestoel", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-17T11:19:25Z
2021-09-08T02:09:58Z
2018-05-17T12:15:35Z
NONE
resolved
Summary. When REQUESTS_CA_BUNDLE has been set as an environment variable, the verify property in a requests.Session() will always be ignored. ## Expected Result requests.Session always uses REQUESTS_CA_BUNDLE unless a certificate bundle has been assigned ## Actual Result requests.Session always uses REQUESTS_CA_BUNDLE and overides any certificate bundle set on the Session object. ## Reproduction Steps ```REQUESTS_CA_BUNDLE="/lib/python3.6/site-packages/pip/_vendor/certifi/cacert.pem"``` ```python import requests s = requests.Session() s.verify = "/non_existing_bundle" s.get("https://google.com") ``` Expected result: ```OSError: Could not find a suitable TLS CA certificate bundle, invalid path: /non_existing_bundle``` Actual result: ```<Response [200]>``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "" }, "implementation": { "name": "CPython", "version": "3.6.4" }, "platform": { "release": "3.10.0-693.11.6.el7.x86_64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ``` Not sure if this is a bug, but I now need to unset the environment variable first before I can use a different certificate bundle in a session object or use the following workaround. sessions.py: ``` #if verify is True or verify is None: if verify is True or verify is None and not isinstance(self.verify, str): verify = (os.environ.get('REQUESTS_CA_BUNDLE') or os.environ.get('CURL_CA_BUNDLE')) ```
{ "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/4650/reactions" }
https://api.github.com/repos/psf/requests/issues/4650/timeline
null
completed
null
null
false
[ "In the future, please search **closed and** open issues before creating new ones that are duplicates.\r\n\r\nDuplicate of #3829 " ]
https://api.github.com/repos/psf/requests/issues/4649
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4649/labels{/name}
https://api.github.com/repos/psf/requests/issues/4649/comments
https://api.github.com/repos/psf/requests/issues/4649/events
https://github.com/psf/requests/issues/4649
323,695,232
MDU6SXNzdWUzMjM2OTUyMzI=
4,649
utf-8 passwords in url don't work
{ "avatar_url": "https://avatars.githubusercontent.com/u/8750682?v=4", "events_url": "https://api.github.com/users/emmnx/events{/privacy}", "followers_url": "https://api.github.com/users/emmnx/followers", "following_url": "https://api.github.com/users/emmnx/following{/other_user}", "gists_url": "https://api.github.com/users/emmnx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/emmnx", "id": 8750682, "login": "emmnx", "node_id": "MDQ6VXNlcjg3NTA2ODI=", "organizations_url": "https://api.github.com/users/emmnx/orgs", "received_events_url": "https://api.github.com/users/emmnx/received_events", "repos_url": "https://api.github.com/users/emmnx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/emmnx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/emmnx/subscriptions", "type": "User", "url": "https://api.github.com/users/emmnx", "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
7
2018-05-16T16:25:58Z
2021-09-07T00:06:14Z
2018-10-03T16:11:33Z
NONE
resolved
_Summary:_ ```curl -s --url http://user1:enganaçã[email protected]:8080 --data '{"method": "help"}'``` works ``` #!/usr/bin/env python2 import requests import json payload = {'method': 'help'} url = 'http://user1:enganaçã[email protected]:8080' requests.post(url, headers={'Content-type': 'text/plain; charset=utf-8'}, data=json.dumps(payload)) ``` also works. But... use `#!/usr/bin/env python3` instead, and it doesn't work anymore. requests messes things up. ## Expected Result Work as curl and requests in python2 do. ## Actual Result requests in python3 messes with encoding. ## Reproduction Steps ```python3 import requests import json payload = {'method': 'help'} url = 'http://user1:enganaçã[email protected]:8080' requests.post(url, headers={'Content-type': 'text/plain; charset=utf-8'}, data=json.dumps(payload)) ``` ## System Information ``` Python 3.5.2 ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/8750682?v=4", "events_url": "https://api.github.com/users/emmnx/events{/privacy}", "followers_url": "https://api.github.com/users/emmnx/followers", "following_url": "https://api.github.com/users/emmnx/following{/other_user}", "gists_url": "https://api.github.com/users/emmnx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/emmnx", "id": 8750682, "login": "emmnx", "node_id": "MDQ6VXNlcjg3NTA2ODI=", "organizations_url": "https://api.github.com/users/emmnx/orgs", "received_events_url": "https://api.github.com/users/emmnx/received_events", "repos_url": "https://api.github.com/users/emmnx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/emmnx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/emmnx/subscriptions", "type": "User", "url": "https://api.github.com/users/emmnx", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4649/reactions" }
https://api.github.com/repos/psf/requests/issues/4649/timeline
null
completed
null
null
false
[ "Hi @Emmanux this needs more information. There are many versions of requests in the wild. We cannot begin to help debug this until you provide the information requested in the original issue template.", "`requests==2.9.1`\r\n(python3, this fails)\r\n\r\nand\r\n`requests==2.18.4`\r\n(python2, this is ok)", "I just installed requests-2.18.4 for python3, same behavior, it fails (receives code 401, because of messed up characters). ", "```py\r\nPython 3.6.5 (default, Mar 29 2018, 18:20:46)\r\n[GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import requests\r\n>>> requests.__version__\r\n'2.18.4'\r\n>>> url = 'https://user1:enganaçã[email protected]/get'\r\n>>> requests.get(url)\r\n<Response [200]>\r\n>>> r = _\r\n>>> r.url\r\n'https://user1:engana%C3%A7%C3%[email protected]/get'\r\n>>> r.json()\r\n{'args': {}, 'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Authorization': 'Basic dXNlcjE6ZW5nYW5h5+Nv', 'Connection': 'close', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.18.4'}, 'origin': '174.124.131.64', 'url': 'https://httpbin.org/get'}\r\n>>> r.json()['headers']['Authorization']\r\n'Basic dXNlcjE6ZW5nYW5h5+Nv'\r\n>>> r.json()['headers']['Authorization'].split(' ', 1)[-1]\r\n'dXNlcjE6ZW5nYW5h5+Nv'\r\n>>> auth = _\r\n>>> import base64\r\n>>> base64.b64decode(auth)\r\nb'user1:engana\\xe7\\xe3o'\r\n>>> r.request.url\r\n'https://user1:engana%C3%A7%C3%[email protected]/get'\r\n>>> base64.b64decode(auth).decode('utf-8')\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0xe7 in position 12: invalid continuation byte\r\n```\r\n\r\n```py\r\n>>> import requests\r\n>>> \r\n>>> requests.__version__\r\n'2.18.4'\r\n>>> url = 'https://user1:enganaçã[email protected]/get'\r\n>>> url\r\n'https://user1:engana\\xc3\\xa7\\xc3\\[email protected]/get'\r\n>>> r = requests.get(url)\r\n>>> r\r\n<Response [200]>\r\n>>> r.url\r\nu'https://user1:engana%C3%A7%C3%[email protected]/get'\r\n>>> r.json()\r\n{u'origin': u'174.124.131.64', u'headers': {u'Accept-Encoding': u'gzip, deflate', u'Connection': u'close', u'Accept': u'*/*', u'User-Agent': u'python-requests/2.18.4', u'Host': u'httpbin.org', u'Authorization': u'Basic dXNlcjE6ZW5nYW5hw6fDo28='}, u'args': {}, u'url': u'https://httpbin.org/get'}\r\n>>> r.json()['headers']['Authorization'].split(' ', 1)[-1]\r\nu'dXNlcjE6ZW5nYW5hw6fDo28='\r\n>>> import base64\r\n>>> auth = r.json()['headers']['Authorization'].split(' ', 1)[-1]\r\n>>> base64.b64decode(auth)\r\n'user1:engana\\xc3\\xa7\\xc3\\xa3o'\r\n>>> base64.b64decode(auth).decode('utf-8')\r\nu'user1:engana\\xe7\\xe3o'\r\n```\r\n\r\nSo I started tracing through the code. We prepare the URL first, then we go through a separate method to retrieve the Auth after we've prepared the URL (which is what `r.request.url` is).\r\n\r\n```py\r\n>>> from requests.utils import get_auth_from_url\r\n>>> get_auth_from_url(r.request.url)\r\n('user1', 'enganação')\r\n```\r\n\r\nThat looks okay to me. Let's then see how the `HTTPBasicAuth` class handles this:\r\n\r\n```py\r\n>>> from requests.auth import _basic_auth_str\r\n>>> _basic_auth_str(*get_auth_from_url(r.request.url))\r\n'Basic dXNlcjE6ZW5nYW5h5+Nv'\r\n>>> password.encode('latin1')\r\nb'engana\\xe7\\xe3o'\r\n```\r\n\r\nWhich gives us the wrong Authentication value on Python 3.\r\n\r\nOn Python 2 this looks like:\r\n\r\n```py\r\n>>> from requests.utils import get_auth_from_url\r\n>>> get_auth_from_url(r.request.url)\r\n('user1', 'engana\\xc3\\xa7\\xc3\\xa3o')\r\n>>> base64.b64encode(':'.join([username, password]))\r\n'dXNlcjE6ZW5nYW5hw6fDo28='\r\n```\r\n\r\nSo this is due almost entirely to the fact that we have to deal with old compatibility with HTTP servers and the standard library in Python's behaviour varies between major versions.\r\n\r\nIf instead we encoded to `utf8` this would work fine on Python 3:\r\n\r\n```py\r\n>>> _basic_auth_str(username, password.encode('utf8'))\r\n'Basic dXNlcjE6ZW5nYW5hw6fDo28='\r\n```\r\n\r\n", "Is this up for grabs?\r\n", "@rozuur what do you mean?\r\n", "I was asking to work on fixing it. Nevermind, you have closed it." ]
https://api.github.com/repos/psf/requests/issues/4648
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4648/labels{/name}
https://api.github.com/repos/psf/requests/issues/4648/comments
https://api.github.com/repos/psf/requests/issues/4648/events
https://github.com/psf/requests/pull/4648
323,659,331
MDExOlB1bGxSZXF1ZXN0MTg4NDYyMTYy
4,648
bring Pipfile.lock up to date with current constraints
{ "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
5
2018-05-16T14:57:14Z
2021-09-03T00:10:57Z
2018-05-16T19:31:49Z
MEMBER
resolved
The Pipfile has strayed a bit from our current build constraints and contains information that's no longer consistent with Warehouse. Updating should help with installation and prevent problems like pypa/packaging-problems#147 from reoccurring when users pick Requests as a model for their packages.
{ "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/4648/reactions" }
https://api.github.com/repos/psf/requests/issues/4648/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4648.diff", "html_url": "https://github.com/psf/requests/pull/4648", "merged_at": "2018-05-16T19:31:49Z", "patch_url": "https://github.com/psf/requests/pull/4648.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4648" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4648?src=pr&el=h1) Report\n> Merging [#4648](https://codecov.io/gh/requests/requests/pull/4648?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/f3fc892b901abe2c3605f2669af4f6469b896e88?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/4648/graphs/tree.svg?token=mZGswIiXLa&width=650&height=150&src=pr)](https://codecov.io/gh/requests/requests/pull/4648?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4648 +/- ##\n=======================================\n Coverage 66.53% 66.53% \n=======================================\n Files 15 15 \n Lines 1560 1560 \n=======================================\n Hits 1038 1038 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4648?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/4648?src=pr&el=footer). Last update [f3fc892...c6db879](https://codecov.io/gh/requests/requests/pull/4648?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@nateprewitt if I remember correctly, you're a Pipenv maintainer and the semi-official position is that the project is geared towards applications, not libraries. If that's correct, do you recall the reasoning for adding it to Requests? I'm wondering if we need the hassle of constantly updating the lockfile when we're just a library.", "It's just as valid for libraries as `requirements.txt` is. ", "So Pipenv is pbr + requirements.txt for libraries then?", "@sigmavirus24 I think the reason the term “application dependencies” was chosen is because Pipfile is not (currently) a replacement for setup.py. The Pipfile/Pipfile.lock can be used in a library similar to how requirements.txt is used but won’t be used when installing from Warehouse.\r\n\r\nI agree having to update this is tedious and creates noisy PRs. We should avoid updating it if we don’t have to but I also know Kenneth wants Requests to be an example of good practice. With our current lockfile, we’re not adhereing to that tenant. If we can release a stable lockfile and avoid pushing broken lockfiles in the future this should be a much less common occurrence." ]
https://api.github.com/repos/psf/requests/issues/4647
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4647/labels{/name}
https://api.github.com/repos/psf/requests/issues/4647/comments
https://api.github.com/repos/psf/requests/issues/4647/events
https://github.com/psf/requests/pull/4647
323,479,597
MDExOlB1bGxSZXF1ZXN0MTg4MzI2Nzgx
4,647
fix appveyor
{ "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
3
2018-05-16T06:04:37Z
2021-09-03T00:10:58Z
2018-05-16T13:14:38Z
MEMBER
resolved
I don't know what's going on with Appveyor/Pipenv but it's no longer liking `-e .` installs out of the Pipfile. I went back to a version of Pipenv that we have successful builds for and it's still broken. I'd like to get builds fixed while we determine root cause.
{ "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/4647/reactions" }
https://api.github.com/repos/psf/requests/issues/4647/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4647.diff", "html_url": "https://github.com/psf/requests/pull/4647", "merged_at": "2018-05-16T13:14:38Z", "patch_url": "https://github.com/psf/requests/pull/4647.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4647" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4647?src=pr&el=h1) Report\n> Merging [#4647](https://codecov.io/gh/requests/requests/pull/4647?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/9616f82905f86173477fdb3bf24f2f7228eed3a0?src=pr&el=desc) will **increase** coverage by `0.77%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4647/graphs/tree.svg?src=pr&token=mZGswIiXLa&width=650&height=150)](https://codecov.io/gh/requests/requests/pull/4647?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4647 +/- ##\n==========================================\n+ Coverage 65.43% 66.21% +0.77% \n==========================================\n Files 15 15 \n Lines 1548 1548 \n==========================================\n+ Hits 1013 1025 +12 \n+ Misses 535 523 -12\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4647?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4647/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `70.18% <0%> (+0.45%)` | :arrow_up: |\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/4647/diff?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `77.2% <0%> (+2.25%)` | :arrow_up: |\n| [requests/\\_internal\\_utils.py](https://codecov.io/gh/requests/requests/pull/4647/diff?src=pr&el=tree#diff-cmVxdWVzdHMvX2ludGVybmFsX3V0aWxzLnB5) | `75% <0%> (+6.25%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4647?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/4647?src=pr&el=footer). Last update [9616f82...9055b33](https://codecov.io/gh/requests/requests/pull/4647?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@nateprewitt @sigmavirus24 I’m wondering if the old school format of extras mentioned in https://github.com/requests/requests/issues/4646#issuecomment-389411076 is breaking when parsing with pip10...", "I thought it might be Pip 10 when the builds started failing but we have successful builds with the same Pipfile and Pip 10 from a few weeks ago.\r\n\r\nhttps://ci.appveyor.com/project/kennethreitz/requests/build/1.0.537/job/stejqhugrbl4010i" ]
https://api.github.com/repos/psf/requests/issues/4646
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4646/labels{/name}
https://api.github.com/repos/psf/requests/issues/4646/comments
https://api.github.com/repos/psf/requests/issues/4646/events
https://github.com/psf/requests/pull/4646
323,374,985
MDExOlB1bGxSZXF1ZXN0MTg4MjQ5MjAx
4,646
Add wheel hash for pluggy
{ "avatar_url": "https://avatars.githubusercontent.com/u/954310?v=4", "events_url": "https://api.github.com/users/techalchemy/events{/privacy}", "followers_url": "https://api.github.com/users/techalchemy/followers", "following_url": "https://api.github.com/users/techalchemy/following{/other_user}", "gists_url": "https://api.github.com/users/techalchemy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/techalchemy", "id": 954310, "login": "techalchemy", "node_id": "MDQ6VXNlcjk1NDMxMA==", "organizations_url": "https://api.github.com/users/techalchemy/orgs", "received_events_url": "https://api.github.com/users/techalchemy/received_events", "repos_url": "https://api.github.com/users/techalchemy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/techalchemy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/techalchemy/subscriptions", "type": "User", "url": "https://api.github.com/users/techalchemy", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-05-15T20:40:38Z
2021-09-03T00:10:58Z
2018-05-16T06:38:23Z
NONE
resolved
- Lockfile was created when only the sdist was available
{ "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/4646/reactions" }
https://api.github.com/repos/psf/requests/issues/4646/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4646.diff", "html_url": "https://github.com/psf/requests/pull/4646", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4646.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4646" }
true
[ "Thanks for the PR, @techalchemy. We've had issues in the past with resolution conflicts around this particular extras_requires string.\r\n\r\n`'socks:sys_platform == \"win32\" and (python_version == \"2.7\" or python_version == \"2.6\")': ['win_inet_pton']`\r\n\r\nI got things worked out and have a new lockfile we'll push up tomorrow once #4647 is merged. I'm going to close this out since that will probably cover other edge cases we're missing with our current Pipfile.lock. ", "@nateprewitt is that what was causing the CI issues?", "@techalchemy it is not, we don't use the lockfile in CI. I still have yet to determine what changed in the build environment." ]
https://api.github.com/repos/psf/requests/issues/4645
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4645/labels{/name}
https://api.github.com/repos/psf/requests/issues/4645/comments
https://api.github.com/repos/psf/requests/issues/4645/events
https://github.com/psf/requests/issues/4645
323,317,729
MDU6SXNzdWUzMjMzMTc3Mjk=
4,645
import requests throws ValueError on urllib3.__version__.split
{ "avatar_url": "https://avatars.githubusercontent.com/u/212252?v=4", "events_url": "https://api.github.com/users/synhershko/events{/privacy}", "followers_url": "https://api.github.com/users/synhershko/followers", "following_url": "https://api.github.com/users/synhershko/following{/other_user}", "gists_url": "https://api.github.com/users/synhershko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/synhershko", "id": 212252, "login": "synhershko", "node_id": "MDQ6VXNlcjIxMjI1Mg==", "organizations_url": "https://api.github.com/users/synhershko/orgs", "received_events_url": "https://api.github.com/users/synhershko/received_events", "repos_url": "https://api.github.com/users/synhershko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/synhershko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/synhershko/subscriptions", "type": "User", "url": "https://api.github.com/users/synhershko", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-15T17:44:30Z
2021-09-08T02:09:59Z
2018-05-15T17:49:41Z
NONE
resolved
It may be an environment issue but I keep reproducing this error with latest requests: ``` ➜ python3 Python 3.6.5 (default, Mar 30 2018, 06:41:53) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import requests Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/site-packages/requests/__init__.py", line 49, in <module> major, minor, patch = urllib3.__version__.split('.')[:3] ValueError: not enough values to unpack (expected 3, got 2) ``` Here is a snip from `pip3 freeze`: ``` requests==2.18.4 requests2==2.16.0 rsa==3.4.2 urllib3==1.22 ``` Please advise
{ "avatar_url": "https://avatars.githubusercontent.com/u/212252?v=4", "events_url": "https://api.github.com/users/synhershko/events{/privacy}", "followers_url": "https://api.github.com/users/synhershko/followers", "following_url": "https://api.github.com/users/synhershko/following{/other_user}", "gists_url": "https://api.github.com/users/synhershko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/synhershko", "id": 212252, "login": "synhershko", "node_id": "MDQ6VXNlcjIxMjI1Mg==", "organizations_url": "https://api.github.com/users/synhershko/orgs", "received_events_url": "https://api.github.com/users/synhershko/received_events", "repos_url": "https://api.github.com/users/synhershko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/synhershko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/synhershko/subscriptions", "type": "User", "url": "https://api.github.com/users/synhershko", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4645/reactions" }
https://api.github.com/repos/psf/requests/issues/4645/timeline
null
completed
null
null
false
[ "Was due to version clashes which I just was able to fix, closing" ]
https://api.github.com/repos/psf/requests/issues/4644
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4644/labels{/name}
https://api.github.com/repos/psf/requests/issues/4644/comments
https://api.github.com/repos/psf/requests/issues/4644/events
https://github.com/psf/requests/issues/4644
322,511,290
MDU6SXNzdWUzMjI1MTEyOTA=
4,644
Requests memory leak: Caused computer to crash
{ "avatar_url": "https://avatars.githubusercontent.com/u/39217719?v=4", "events_url": "https://api.github.com/users/Kodingu/events{/privacy}", "followers_url": "https://api.github.com/users/Kodingu/followers", "following_url": "https://api.github.com/users/Kodingu/following{/other_user}", "gists_url": "https://api.github.com/users/Kodingu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Kodingu", "id": 39217719, "login": "Kodingu", "node_id": "MDQ6VXNlcjM5MjE3NzE5", "organizations_url": "https://api.github.com/users/Kodingu/orgs", "received_events_url": "https://api.github.com/users/Kodingu/received_events", "repos_url": "https://api.github.com/users/Kodingu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Kodingu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Kodingu/subscriptions", "type": "User", "url": "https://api.github.com/users/Kodingu", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-05-12T13:23:52Z
2021-09-08T02:09:57Z
2018-05-20T18:49:51Z
NONE
resolved
So as I was working on coding a notifier for a website, I came across an issue where my computer would gradually slow down after a long period of time. I thought it was nothing until my computer crashed. I then decided to look up on this issue by testing every single line of code in my while loop until i finally found out that it was caused by the requests module. I decided to look up on google if anyone else has gotten an issue like this and I actually did manage to find a page with someone who had this exact same problem. My code that I used to create this memory leak was this: ``` import requests ListedItems = {} while True: r = requests.get("urlToGet").json() time.sleep(1) for itm in r: print(itm) del r ``` I even tried to delete the r variable after I got everything I needed, but it still resulted in my computer to crash after a few hours. Please note that I need to have this program running for days.
{ "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/4644/reactions" }
https://api.github.com/repos/psf/requests/issues/4644/timeline
null
completed
null
null
false
[ "Hi @Kodingu, we have another issue open (#4601) for something similar, but haven't been given enough information to identify a problem.\r\n\r\nCould you please provide the information originally requested in the template used to create this ticket? It also looks like you may have been storing items in `ListedItems` at some point since you've included it in your repro. To verify, this is the exact code you've used to repro and you aren't storing anything from these responses?\r\n\r\nWould you also mind testing this with the minimum required amount of code to reproduce? \r\n\r\ne.g. Does this repro the problem for you?\r\n```python\r\nimport requests\r\nimport time\r\n\r\nwhile True:\r\n r = requests.get(\"urlToGet\")\r\n time.sleep(1)\r\n print(r.content)\r\n del r\r\n```", "I've used @nateprewitt's sample code and the memory usage seems stable to me:\r\n\r\n![figure_1](https://user-images.githubusercontent.com/12630151/40275563-b36ba300-5bc0-11e8-87bc-bade4f3c140b.png)\r\n\r\nI'm also curious whether `ListItems` dict was modified to keep historic or memo-istic records of the json elements.\r\n\r\nIf you do want to use a dictionary, nonetheless, and would like to have an upper bound for the contained elements, I would recommend using the following dict implementation:\r\n\r\n```python\r\nfrom collections import OrderedDict\r\n\r\nclass limited_dict(OrderedDict):\r\n\r\n def __init__(self, *a, **kw):\r\n self.limit = kw.pop(\"maxsize\", None)\r\n OrderedDict.__init__(self, *a, **kw)\r\n\r\n def __setitem__(self, key, value):\r\n OrderedDict.__setitem__(self, key, value)\r\n self.__check()\r\n\r\n def __check(self):\r\n if self.limit is not None:\r\n while len(self) > self.limit:\r\n self.popitem(last=False)\r\n\r\n# test\r\n# a = limited_dict(maxsize=10)\r\n# for i in range(20):\r\n# a[str(i)] = i\r\n#\r\n# print a\r\n# limited_dict([('10', 10),\r\n# ('11', 11),\r\n# ('12', 12),\r\n# ('13', 13),\r\n# ('14', 14),\r\n# ('15', 15),\r\n# ('16', 16),\r\n# ('17', 17),\r\n# ('18', 18),\r\n# ('19', 19)])\r\n```", "Thanks so much for taking the time to look into this @initbar! It does look like there may have been more than just Requests code involved in the initial POC with the potential for lingering pointers.\r\n\r\nI think we may need a longer look at memory usage to really rule out a leak, but that should probably be tracked in the main issue. I'm closing this out since @Kodingu hasn't provided any more information, and we'll move forward in #4601." ]
https://api.github.com/repos/psf/requests/issues/4643
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4643/labels{/name}
https://api.github.com/repos/psf/requests/issues/4643/comments
https://api.github.com/repos/psf/requests/issues/4643/events
https://github.com/psf/requests/issues/4643
322,483,356
MDU6SXNzdWUzMjI0ODMzNTY=
4,643
Can not get the cookies from localhost
{ "avatar_url": "https://avatars.githubusercontent.com/u/22488270?v=4", "events_url": "https://api.github.com/users/MrThanlon/events{/privacy}", "followers_url": "https://api.github.com/users/MrThanlon/followers", "following_url": "https://api.github.com/users/MrThanlon/following{/other_user}", "gists_url": "https://api.github.com/users/MrThanlon/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/MrThanlon", "id": 22488270, "login": "MrThanlon", "node_id": "MDQ6VXNlcjIyNDg4Mjcw", "organizations_url": "https://api.github.com/users/MrThanlon/orgs", "received_events_url": "https://api.github.com/users/MrThanlon/received_events", "repos_url": "https://api.github.com/users/MrThanlon/repos", "site_admin": false, "starred_url": "https://api.github.com/users/MrThanlon/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MrThanlon/subscriptions", "type": "User", "url": "https://api.github.com/users/MrThanlon", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-05-12T05:07:32Z
2021-08-28T00:06:01Z
2018-05-20T18:59:28Z
NONE
resolved
Summary. ## Expected Result ``` >>>import requests >>>requests.get('http://localhost/test.php').cookies <RequestsCookieJar[Cookie(....)]> ``` ## Actual Result ``` >>>import requests >>>requests.get('http://localhost/test.php').cookies <RequestsCookieJar[]> ``` ## Reproduction Steps ```python import requests requests.get('http://localhost/test.php').cookies ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.14" }, "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). ---- ### I found it when I test a php script.I put it on IIS and explorer worked.Howerver requests did not got the cookies,response header showed there was a key "Set-Cookie".Strangely,when I put the php script on my site whose domain is not localhost,requests successfully got the cookies. ### The session is the same situation. ### Sorry for my poor English.
{ "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/4643/reactions" }
https://api.github.com/repos/psf/requests/issues/4643/timeline
null
completed
null
null
false
[ "Hi @MrThanlon, can you please show us the value of `history` on the `Response` object? ", "Hi again @MrThanlon, here's a simple POC showing that cookies work fine on localhost. It looks like your IIS instance is doing some kind of redirect which is affecting the cookies on the response object. I'm closing this out since things are working as expected. Thanks again for the report though!\r\n\r\n\r\n```python\r\nimport pytest\r\nimport threading\r\nimport requests\r\n\r\nfrom tests.testserver.server import Server, consume_socket_content\r\n\r\ndef test_cookie_set_for_localhost():\r\n\r\n def response_handler(sock):\r\n consume_socket_content(sock, timeout=0.5)\r\n sock.send(\r\n b'HTTP/1.1 200 OK\\r\\n'\r\n b'Content-Length: 0\\r\\n'\r\n b'Set-Cookie: foo=bar; Max-Age=86400; Secure; HttpOnly\\r\\n\\r\\n'\r\n )\r\n\r\n close_server = threading.Event()\r\n server = Server(response_handler, wait_to_close_event=close_server)\r\n\r\n with server as (host, port):\r\n url = 'http://{0}:{1}/'.format(host, port)\r\n r = requests.get(url)\r\n\r\n assert r.status_code == 200\r\n\r\n # Verify we received our expected cookie\r\n assert r.cookies\r\n assert r.cookies.get('foo') == 'bar'\r\n\r\n close_server.set()\r\n```", "I can still reproduce this. Just like OP, I am using PHP on the server. I can confirm that requests does not see cookies for PHP app running on localhost but it does for the same app running on production server, even though the `r.headers['Set-Cookie']` header is basically identical (modulo the `Domain` key).\r\n\r\nIn fact, I can reproduce it in @nateprewitt’s example if I add the `Domain` tag (with `requests` d3e0f73354051f824cae563aeae215006158da28):\r\n\r\n```python\r\nimport pytest\r\nimport threading\r\nimport requests\r\n\r\nfrom tests.testserver.server import Server, consume_socket_content\r\n\r\ndef test_cookie_set_for_localhost():\r\n\r\n def response_handler(sock):\r\n consume_socket_content(sock, timeout=0.5)\r\n host, port = sock.getsockname()\r\n sock.send(\r\n b'HTTP/1.1 200 OK\\r\\n'\r\n b'Content-Length: 0\\r\\n'\r\n b'Set-Cookie: foo=bar; Max-Age=86400; Domain=localhost; Secure; HttpOnly\\r\\n\\r\\n'\r\n # b'Set-Cookie: foo=bar; Max-Age=86400; Domain=localhost:' + str(port).encode('ascii') + b'; Secure; HttpOnly\\r\\n\\r\\n' # does not help\r\n )\r\n\r\n close_server = threading.Event()\r\n server = Server(response_handler, wait_to_close_event=close_server)\r\n\r\n with server as (host, port):\r\n url = 'http://{0}:{1}/'.format(host, port)\r\n r = requests.get(url)\r\n\r\n assert r.status_code == 200\r\n\r\n print(host, port)\r\n\r\n # Verify we received our expected cookie\r\n assert r.cookies\r\n assert r.cookies.get('foo') == 'bar'\r\n\r\n close_server.set()\r\n``` " ]
https://api.github.com/repos/psf/requests/issues/4642
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4642/labels{/name}
https://api.github.com/repos/psf/requests/issues/4642/comments
https://api.github.com/repos/psf/requests/issues/4642/events
https://github.com/psf/requests/issues/4642
322,067,684
MDU6SXNzdWUzMjIwNjc2ODQ=
4,642
Raise exception if response does not match Content-Type header
{ "avatar_url": "https://avatars.githubusercontent.com/u/1330770?v=4", "events_url": "https://api.github.com/users/Stevoisiak/events{/privacy}", "followers_url": "https://api.github.com/users/Stevoisiak/followers", "following_url": "https://api.github.com/users/Stevoisiak/following{/other_user}", "gists_url": "https://api.github.com/users/Stevoisiak/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Stevoisiak", "id": 1330770, "login": "Stevoisiak", "node_id": "MDQ6VXNlcjEzMzA3NzA=", "organizations_url": "https://api.github.com/users/Stevoisiak/orgs", "received_events_url": "https://api.github.com/users/Stevoisiak/received_events", "repos_url": "https://api.github.com/users/Stevoisiak/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Stevoisiak/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Stevoisiak/subscriptions", "type": "User", "url": "https://api.github.com/users/Stevoisiak", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-05-10T20:12:17Z
2021-09-08T02:10:01Z
2018-05-11T16:43:46Z
CONTRIBUTOR
resolved
After sending a request, there should be an exception if the response Content-Type does not match the request Content-Type. (ie: `text/xml` vs `text/html`) (For backwards compatibility, this could be configurable with with an optional boolean argument) ## Expected Result An Exception should be raised if the response Content-Type does not match the request. ## Actual Result The request will proceed without any warning, even if the response Content-Type does not match. ## Reproduction Steps ```python import requests url = "http://www.example.com" xml_data = "<Request Object='System' Action='Ping'/>" headers = {"Content-Type": "text/xml"} response = requests.post(url, headers=headers, data=xml_data) print(response.headers) # {'Content-Type': 'text/html'} ``` ## System Information ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.4" }, "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/1330770?v=4", "events_url": "https://api.github.com/users/Stevoisiak/events{/privacy}", "followers_url": "https://api.github.com/users/Stevoisiak/followers", "following_url": "https://api.github.com/users/Stevoisiak/following{/other_user}", "gists_url": "https://api.github.com/users/Stevoisiak/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Stevoisiak", "id": 1330770, "login": "Stevoisiak", "node_id": "MDQ6VXNlcjEzMzA3NzA=", "organizations_url": "https://api.github.com/users/Stevoisiak/orgs", "received_events_url": "https://api.github.com/users/Stevoisiak/received_events", "repos_url": "https://api.github.com/users/Stevoisiak/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Stevoisiak/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Stevoisiak/subscriptions", "type": "User", "url": "https://api.github.com/users/Stevoisiak", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4642/reactions" }
https://api.github.com/repos/psf/requests/issues/4642/timeline
null
completed
null
null
false
[ "Correct me if I'm wrong but isn't this fine?\r\n\r\nThe content-type header in the request tells the server what type of data you are posting, the content-type header in the response tells the client what type of data the server returned.\r\n\r\nAre you thinking about the Accept header where the client informs the server of which content-types it can handle?", "@colinfike I did not know there was an Accept header.\r\n\r\nIf I understand correctly, if I specify `text/xml` in the Accept header, an exception will be raised if the server response doesn't match that type?\r\n\r\nEssentially, I have an application that allows the user to send XML data to an arbitrary URL, so I want to validate that the server responds with valid XML data.", "There is an HTTP error code [406](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406) specifically for this situation, it seems though that it's rarely used and a server would much rather serve SOMETHING rather than nothing.\r\n\r\nConsidering that and the current way requests already functions, it probably doesn't make sense to throw an exception if a response header wasn't returned as expected. It would cut down on the flexibility of the library (plus it doesn't strike me as that exceptional of a situation).\r\n\r\nA solution can easily be made though through the data requests exposes to us. You could check headers of the response to see if the `content-type` is `text/xml` as you expect assuming you always expect a xml response. Something like `response.headers['content-type']` would return the value of that header which you could then compare to the expected value and then handle that accordingly.", "@colinfike Thank you for the advice. I was able to verify the content with a manual check.\r\n\r\n```python\r\nimport requests\r\nfrom requests.exceptions import InvalidHeader\r\n\r\nurl = \"http://www.example.com\"\r\nxml_data = \"<Request Object='System' Action='Ping'/>\"\r\nheaders = {'Content-Type': 'text/xml'}\r\nresponse = requests.post(url, headers=headers, data=xml_data)\r\n\r\nactual_type = response.headers['Content-Type']\r\nif 'text/xml' not in actual_type:\r\n raise InvalidHeader(\"Response Content-Type does not match.\\n\"\r\n f\"Expected: 'text/xml'. Received: '{actual_type}'\")\r\n```" ]
https://api.github.com/repos/psf/requests/issues/4641
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4641/labels{/name}
https://api.github.com/repos/psf/requests/issues/4641/comments
https://api.github.com/repos/psf/requests/issues/4641/events
https://github.com/psf/requests/issues/4641
322,021,576
MDU6SXNzdWUzMjIwMjE1NzY=
4,641
Use a more descriptive error message for SSLError
{ "avatar_url": "https://avatars.githubusercontent.com/u/1330770?v=4", "events_url": "https://api.github.com/users/Stevoisiak/events{/privacy}", "followers_url": "https://api.github.com/users/Stevoisiak/followers", "following_url": "https://api.github.com/users/Stevoisiak/following{/other_user}", "gists_url": "https://api.github.com/users/Stevoisiak/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Stevoisiak", "id": 1330770, "login": "Stevoisiak", "node_id": "MDQ6VXNlcjEzMzA3NzA=", "organizations_url": "https://api.github.com/users/Stevoisiak/orgs", "received_events_url": "https://api.github.com/users/Stevoisiak/received_events", "repos_url": "https://api.github.com/users/Stevoisiak/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Stevoisiak/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Stevoisiak/subscriptions", "type": "User", "url": "https://api.github.com/users/Stevoisiak", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-10T17:50:33Z
2021-09-08T02:10:00Z
2018-05-13T10:57:41Z
CONTRIBUTOR
resolved
When a `requests.exceptions.SSLError` is raised due to certificate verification, the error message is inherited from `urllib3`. Unlike other `Requests` errors, the message is difficult to understand for the average user. ## Expected Result The traceback should display a single traceback with an easy to understand error message. Example: > requests.exceptions.SSLError: Secure connection failed. Cannot validate the certificate for 'https://expired.badssl.com/'. ## Actual Result The error message is reused directly from `urllib3`. > requests.exceptions.SSLError: HTTPSConnectionPool(host='expired.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),)) The console log contains 3 separate tracebacks for what are essentially variations of the same error. ``` Traceback (most recent call last): File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3-1.22-py3.6.egg\urllib3\connectionpool.py", line 601, in urlopen chunked=chunked) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3-1.22-py3.6.egg\urllib3\connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3-1.22-py3.6.egg\urllib3\connectionpool.py", line 850, in _validate_conn conn.connect() File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3-1.22-py3.6.egg\urllib3\connection.py", line 326, in connect ssl_context=context) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3-1.22-py3.6.egg\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 407, in wrap_socket _context=self, _session=session) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 814, in __init__ self.do_handshake() File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 1068, in do_handshake self._sslobj.do_handshake() File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\adapters.py", line 440, in send timeout=timeout File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3-1.22-py3.6.egg\urllib3\connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\urllib3-1.22-py3.6.egg\urllib3\util\retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='expired.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:/Users/svascellar/.PyCharmCE2018.1/config/scratches/scratch.py", line 3, in <module> response = requests.get('https://expired.badssl.com/') File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\api.py", line 72, in get return request('get', url, params=params, **kwargs) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "C:\Users\svascellar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='expired.badssl.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),)) ``` ## Reproduction Steps ```python import requests response = requests.get('https://expired.badssl.com/') ``` ## System Information ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.4" }, "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/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": 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/4641/reactions" }
https://api.github.com/repos/psf/requests/issues/4641/timeline
null
completed
null
null
false
[ "Hi @Stevoisiak, thanks for starting the discussion on this. While I agree that the messages generated from the SSL module leave something to be desired, I'm not sure Requests is an ideal place to solve this. We would need to be able to identify and rewrap every type of SSL exception inside the Requests code base which is a lot of surface area.\r\n\r\nThis would need to be addressed at a lower level. Where that would be isn't clear because the ssl module is part of the Python interpreter and changes between versions. The exceptions could in theory be improved there but that would only fix the issue for Python 3.8+. It could also be possible to write some kind of a shim for urllib3 but the overhead for that would likely be hard to justify. For right now, it's a nice to have but likely won't be addressed unless someone is highly motivated to drive a solution." ]
https://api.github.com/repos/psf/requests/issues/4640
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4640/labels{/name}
https://api.github.com/repos/psf/requests/issues/4640/comments
https://api.github.com/repos/psf/requests/issues/4640/events
https://github.com/psf/requests/issues/4640
321,868,546
MDU6SXNzdWUzMjE4Njg1NDY=
4,640
Send http request, header passed dictionary type error
{ "avatar_url": "https://avatars.githubusercontent.com/u/21286480?v=4", "events_url": "https://api.github.com/users/lvorcool/events{/privacy}", "followers_url": "https://api.github.com/users/lvorcool/followers", "following_url": "https://api.github.com/users/lvorcool/following{/other_user}", "gists_url": "https://api.github.com/users/lvorcool/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lvorcool", "id": 21286480, "login": "lvorcool", "node_id": "MDQ6VXNlcjIxMjg2NDgw", "organizations_url": "https://api.github.com/users/lvorcool/orgs", "received_events_url": "https://api.github.com/users/lvorcool/received_events", "repos_url": "https://api.github.com/users/lvorcool/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lvorcool/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lvorcool/subscriptions", "type": "User", "url": "https://api.github.com/users/lvorcool", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-10T09:32:18Z
2021-09-08T02:10:02Z
2018-05-10T10:18:35Z
NONE
resolved
Summary. requests2.18.1 ## Expected Result Send http request, header pass dictionary type OK ## Actual Result The header when sending the http request is a dictionary, but an error occurred ```request.exceptions.InvalidHeader:` header value must be of type str or bytes, not <class 'dict'>``` ## Reproduction Steps The header I send is ``` { "X-L-REQ-HEADER": { "lgId": "aaasssssssssssss", "userToken": "aaasssssssssssss", "appVersion": "1.4.0.1", "deviceType": 102, "reqVersion": 60300 } } ``` ```python import requests url = "https://xxxx.com/v1/aaaaa/bbbbb/cccccc/dddddd" querystring = {"pageNo":"1","pageSize":"20"} headers = {"X-L-REQ-HEADER": {"lgId": "aaasssssssssssss","userToken": "aaasssssssssssss","appVersion": "1.4.0.1","deviceType": 102,"reqVersion": 60300}} response = requests.request("GET", url, headers=headers, params=querystring) print(response.text) ``` ## System Information $ python -m requests.help ``` <paste here> ![image](https://user-images.githubusercontent.com/21286480/39863014-008d7d20-5478-11e8-8c8e-3324d79f958a.png) ``` This command is only available on Requests v2.18.1 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/4640/reactions" }
https://api.github.com/repos/psf/requests/issues/4640/timeline
null
completed
null
null
false
[ "Hi @lvorcool2016, as the exception says we need you to tell us what the header value looks like, either as a string or bytes string. Requests won’t try to serialize ambiguous values like a dictionary. I’m going to close this out since it’s intended behavior. Thanks for checking in!" ]
https://api.github.com/repos/psf/requests/issues/4639
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4639/labels{/name}
https://api.github.com/repos/psf/requests/issues/4639/comments
https://api.github.com/repos/psf/requests/issues/4639/events
https://github.com/psf/requests/issues/4639
321,794,034
MDU6SXNzdWUzMjE3OTQwMzQ=
4,639
if reqeusts is called in while loop, it always return same value even if data has been updated in database.
{ "avatar_url": "https://avatars.githubusercontent.com/u/16734697?v=4", "events_url": "https://api.github.com/users/FrancisJen/events{/privacy}", "followers_url": "https://api.github.com/users/FrancisJen/followers", "following_url": "https://api.github.com/users/FrancisJen/following{/other_user}", "gists_url": "https://api.github.com/users/FrancisJen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/FrancisJen", "id": 16734697, "login": "FrancisJen", "node_id": "MDQ6VXNlcjE2NzM0Njk3", "organizations_url": "https://api.github.com/users/FrancisJen/orgs", "received_events_url": "https://api.github.com/users/FrancisJen/received_events", "repos_url": "https://api.github.com/users/FrancisJen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/FrancisJen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/FrancisJen/subscriptions", "type": "User", "url": "https://api.github.com/users/FrancisJen", "user_view_type": "public" }
[]
closed
true
null
[]
null
11
2018-05-10T03:06:06Z
2021-09-08T02:09:58Z
2018-05-12T13:42:28Z
NONE
resolved
Summary. if reqeuests is called in while loop, it always return same value even if data has been updated in database. the request content is: "res = json.loads(requests.get(url, data, verify=False).text)" after stop the call to test_deposit and call again the return value "res = json.loads(requests.get(url, data, verify=False).text)", then the value was updated ## Expected Result the return value of res = json.loads(requests.get(url, data, verify=False).text) should be updated immediately because of the value in database has been updated. ## Actual Result the return value of res = json.loads(requests.get(url, data, verify=False).text) always be same even if the value in database has been updated. ## Reproduction Steps ``` def test_deposit(self): receipt = self.kovan.send_ether_to_contract(0.0001) self.assertEqual(receipt['status'], 'added', "充值交易进入区块成功") txn_receipt = receipt['txn_receipt'] block_number = txn_receipt['blockNumber'] print(txn_receipt) print('first block is:' + str(block_number)) # 轮询6个区块来测试着期间充值不到账 # current_block_number = self.w3.eth.blockNumber balance_before_deposit = self.test_get_balance() print('before is:' + str(balance_before_deposit)) count = 0 while self.w3.eth.blockNumber < (block_number + 16 - 1) and count < 30: print(self.w3.eth.blockNumber) # # test_get_balance缓存清理 # cache_info = self.test_get_balance.cache_info() # print(cache_info) # self.test_get_balance.cache_clear # balance_after_deposit = self.test_get_balance() # print(balance_after_deposit) url = self.prefix + 'balance' data = { 'address': self.wallet_address } # res = self.run.request(url, 'GET', data=data) res = json.loads(requests.get(url, data, verify=False).text) self.assertIn('Success', res['message'], "测试成功") balance_after_deposit = res['data']['result'][0]['tokenAmount'] print('after is ' + str(balance_after_deposit)) self.assertEqual(balance_before_deposit, balance_after_deposit, '未经过6个区块充值不应到账') gc_status = gc.isenabled() print(gc_status) # 内存释放 del balance_after_deposit gc.collect() time.sleep(10) count = count + 1 print('到账时间总计花费:' + str(count * 20)) # if self.w3.eth.blockNumber >= block_number + 6 - 1: # balance_after_deposit = self.test_get_balance() # if balance_after_deposit > ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.5" }, "platform": { "release": "17.4.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ff" }, "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/4639/reactions" }
https://api.github.com/repos/psf/requests/issues/4639/timeline
null
completed
null
null
false
[ "Unless I'm missing something, I don't see you update the value of `data` or `url` in your while loop.\r\n\r\nI'm not sure what framework you are using but if you have an instance of a record and that record is updated in the database, you probably need to fetch the object again to get the updates.\r\n\r\nThat being said, where in the while loop are you updating anything in the database?", "Hi @FrancisJen, this is an issue with your server setup. Either something isn't being communicated to update the database as you're expecting, or your server isn't updating the response how you'd expect. As @colinfike pointed out, you may not be updating your requests as you're expecting to, so I'd suggest reviewing your code.\r\n\r\nA very simple POC shows that Requests will update the response without issues. We don't do any cacheing and only relay what the server has sent to us.\r\n\r\n```python\r\nimport requests\r\nimport time\r\n\r\nwhile True:\r\n r = requests.get('https://now.httpbin.org/')\r\n print(r.json())\r\n time.sleep(1)\r\n```", "I'm suffering exactly the same problem. I'm hosting content on Github (configuration data), and requests fetches the current raw data just fine upon starting the program fresh. But, if I git commit && git push to update the configuration data in the repository, then instruct my program to refetch the data hosted in Github, it gets *exactly* the same data it first fetched when the program was first launched. Nothing I can do, save restarting my program, can cause it to get the most recent data. Meanwhile, using `curl -X GET` to retrieve the same resource on Github returns the properly updated information. By process of elimination, requests is the only component which seems responsible for this caching behavior.\r\n\r\nSomewhere, somehow, requests is caching data. This cache needs to be exposed so that we can somehow flush its contents under program control. ", "Hi @sam-falvo, Requests doesn’t really have a mechanism to cache content. The example that was provided above shows we will update inside of a while loop if the response content from the server changes. It’s possible you’re being routed to a server side cache by github.\r\n\r\nWe’ll need a minimal poc of how you produced this and the same poc with curl. It would also be helpful if you can provide the output of `pip freeze`. Do you have anything like `cache-control` installed?", "Should I open a new ticket with this information, or can I re-use this one? Thanks for responding so quickly. :)", "@sam-falvo also check that you're not being redirected as part of the process and running into the `redirect_cache`", "(That's the only cache we have)", "@sam-falvo You can see if https://github.com/requests/requests/issues/2409#issuecomment-70159804 fixes this for you", "@sam-falvo Ian is correct, this is likely a redirect from Github. If you can confirm you’re not receiving a redirect though, feel free to open a new issue with more details.", "It is not a redirect from Github. As mentioned earlier, I used curl and it\ndelivers the updated content.\n\nI am trying to create a POC for this issue, but am so far not successful,\nwhich is frustrating to me, since it **literally** is the same code as my\nproduction code, sans handlers for my production work. I don't understand\nhow code that has *zero* to do with configuration has any influence at all\non whether request('GET', ...) returns the same content. This is extremely\nfrustrating, and without visibility into why this is happening, I no longer\nhave anything to go on.\n\nOn Tue, May 15, 2018 at 4:02 PM, Nate Prewitt <[email protected]>\nwrote:\n\n> @sam-falvo <https://github.com/sam-falvo> Ian is correct, this is likely\n> a redirect from Github. If you can confirm you’re not receiving a redirect\n> though, feel free to open a new issue with more details.\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/4639#issuecomment-389341012>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ABbP-K3JDYNsinioTDqyrikpzbQ3vJsaks5ty16LgaJpZM4T5SyZ>\n> .\n>\n\n\n\n-- \nSamuel A. Falvo II\n", "@sam-falvo This absolutely sounds frustrating. Unfortunately, there doesn't appear much for @nateprewitt or myself to do to help you without looking directly at your code and seeing the curl request you're making.\r\n\r\nI can suggest that there is some logging that you can enable which will cause urllib3 to log details. That might offer you some insight into what may be happening." ]
https://api.github.com/repos/psf/requests/issues/4638
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4638/labels{/name}
https://api.github.com/repos/psf/requests/issues/4638/comments
https://api.github.com/repos/psf/requests/issues/4638/events
https://github.com/psf/requests/issues/4638
321,582,926
MDU6SXNzdWUzMjE1ODI5MjY=
4,638
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')
{ "avatar_url": "https://avatars.githubusercontent.com/u/8337939?v=4", "events_url": "https://api.github.com/users/fygul/events{/privacy}", "followers_url": "https://api.github.com/users/fygul/followers", "following_url": "https://api.github.com/users/fygul/following{/other_user}", "gists_url": "https://api.github.com/users/fygul/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fygul", "id": 8337939, "login": "fygul", "node_id": "MDQ6VXNlcjgzMzc5Mzk=", "organizations_url": "https://api.github.com/users/fygul/orgs", "received_events_url": "https://api.github.com/users/fygul/received_events", "repos_url": "https://api.github.com/users/fygul/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fygul/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fygul/subscriptions", "type": "User", "url": "https://api.github.com/users/fygul", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2018-05-09T14:00:53Z
2021-09-08T02:10:01Z
2018-05-12T14:47:55Z
NONE
resolved
I run following code to retrieve a page on www.cnyes.com ```python import requests url = 'https://www.cnyes.com/global/IndexImmediateQuotedPrice/' r = requests.get(url) ``` Following errors occur ## Actual Result C:\ProgramData\Anaconda3\envs\p36\python.exe D:/projects/DailyReport/scripts/test/test_requests.py Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\urllib3\contrib\pyopenssl.py", line 441, in wrap_socket cnx.do_handshake() File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\OpenSSL\SSL.py", line 1806, in do_handshake self._raise_ssl_error(self._ssl, result) File "C:\ProgramData\Anaconda3\envs\p36\lib\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 "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen chunked=chunked) File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn conn.connect() File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\urllib3\connection.py", line 326, in connect ssl_context=context) File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "C:\ProgramData\Anaconda3\envs\p36\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:\ProgramData\Anaconda3\envs\p36\lib\site-packages\requests\adapters.py", line 440, in send timeout=timeout File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\urllib3\util\retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.cnyes.com', port=443): Max retries exceeded with url: /global/IndexImmediateQuotedPrice/ (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 "D:/projects/DailyReport/scripts/test/test_requests.py", line 9, in <module> r = requests.get(url) File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\requests\api.py", line 72, in get return request('get', url, params=params, **kwargs) File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\requests\api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\requests\sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\requests\sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "C:\ProgramData\Anaconda3\envs\p36\lib\site-packages\requests\adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='www.cnyes.com', port=443): Max retries exceeded with url: /global/IndexImmediateQuotedPrice/ (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)) ### Some Information on Security Panel of Google Chrome DevTools I use DevTools to Inspect www.cnyes.com: Connection Protocol TLS 1.0 Key exchange RSA Cipher 3DES_EDE_CBC with HMAC-SHA1 Refer to the red circle on attach image. ![devtools](https://user-images.githubusercontent.com/8337939/39818749-30a542da-53d4-11e8-9bf4-569f5eb87de2.png) Firefox Developer Tools shows Cipher suite: TLS_RSA_WITH_3DES_EDE_CBC_SHA ![firefox](https://user-images.githubusercontent.com/8337939/39869525-6b30adce-5490-11e8-9e93-62ab76666fe9.png) ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.2.2" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.5" }, "platform": { "release": "8.1", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "1010008f", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ``` Windows 8.1 Python 3.6.5 pip install request[security] pip list Package Version ------------ --------- asn1crypto 0.24.0 certifi 2018.4.16 cffi 1.11.5 chardet 3.0.4 cryptography 2.2.2 idna 2.6 pip 10.0.1 pycparser 2.18 pyOpenSSL 17.5.0 requests 2.18.4 setuptools 39.1.0 six 1.11.0 urllib3 1.22 wheel 0.31.0 wincertstore 0.2
{ "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/4638/reactions" }
https://api.github.com/repos/psf/requests/issues/4638/timeline
null
completed
null
null
false
[ "I try to add DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA to CIPHERS, but it doesn't work.\r\n\r\n``` python\r\nimport requests\r\nfrom requests.adapters import HTTPAdapter\r\nfrom urllib3.poolmanager import PoolManager\r\nfrom 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:DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA'\r\n)\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 self.poolmanager = PoolManager(\r\n *args, ** kwargs)\r\n\r\n\r\ns = requests.Session()\r\ns.mount('https://www.cnyes.com', DESAdapter())\r\nres = s.get('https://www.cnyes.com/global/IndexImmediateQuotedPrice/')\r\n```", "Have you found the solution ? I am facing the same problem with you.\r\nThanks!", "@wty1143\r\nI use Selenium/PhantomJs instead, temporarily.", "@fygul Haha, I am using selenium too, let's keep in touch to see if there's an update.", "Hi @fygul, have you tried adding TLS_RSA_WITH_3DES_EDE_CBC_SHA to your cipher list and uninstalling PyOpenSSL as suggested in #3774? It also looks like you may not have tried the suggested cipher suite at the top of that issue. Would you mind checking that as well?\r\n\r\n3DES ciphers are not secure and have been removed from the default Requests cipher suite. It’s highly advisable to contact the server administrator about this to get the service fixed.", "@nateprewitt\r\n\r\nI tried to uninstall pyOpenSSL, and added more cipher suites, but none of them helped.\r\n\r\nTLS_RSA_WITH_3DES_EDE_CBC_SHA ==> DES-CBC3-SHA. I already added it.\r\n\r\nSeveral cipher suited was found in [SSL Report for www.cnyes.com](https://www.ssllabs.com/ssltest/analyze.html?d=www.cnyes.com)\r\n\r\nI searched their names on the following pages:\r\n* https://wiki.mozilla.org/Security/Server_Side_TLS\r\n* https://www.openssl.org/docs/man1.1.0/apps/ciphers.html\r\n\r\nFollowing is my packages, code and error message:\r\n\r\npip freeze\r\nasn1crypto==0.24.0\r\ncertifi==2018.4.16\r\ncffi==1.11.5\r\nchardet==3.0.4\r\ncryptography==2.2.2\r\nidna==2.6\r\npycparser==2.18\r\nrequests==2.18.4\r\nsix==1.11.0\r\nurllib3==1.22\r\nwincertstore==0.2\r\n\r\n``` python\r\nimport ssl\r\nimport requests\r\nfrom requests.adapters import HTTPAdapter\r\nfrom urllib3.poolmanager import PoolManager\r\nfrom 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:DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:'\r\n 'RC4-MD5:RC4-SHA'\r\n)\r\n\r\n\r\nclass DESAdapter(HTTPAdapter):\r\n # def init_poolmanager(self, *args, **kwargs):\r\n def init_poolmanager(self, connections, maxsize, block=False, *args, **kwargs):\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs['ssl_context'] = context\r\n # self.poolmanager = PoolManager(*args, ** kwargs)\r\n # self.poolmanager = PoolManager(ssl_version=ssl.PROTOCOL_SSLv3, *args, ** kwargs)\r\n self.poolmanager = PoolManager(\r\n num_pools=connections, maxsize=maxsize,\r\n # block=block, ssl_version=ssl.PROTOCOL_SSLv3, *args, **kwargs)\r\n block=block, *args, **kwargs)\r\n\r\n\r\ns = requests.Session()\r\ns.mount('https://www.cnyes.com', DESAdapter())\r\nres = s.get('https://www.cnyes.com/global/IndexImmediateQuotedPrice/')\r\n```\r\n\r\nTraceback (most recent call last):\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\urllib3\\connectionpool.py\", line 601, in urlopen\r\n chunked=chunked)\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\urllib3\\connectionpool.py\", line 346, in _make_request\r\n self._validate_conn(conn)\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\urllib3\\connectionpool.py\", line 850, in _validate_conn\r\n conn.connect()\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\urllib3\\connection.py\", line 326, in connect\r\n ssl_context=context)\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-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 \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\ssl.py\", line 407, in wrap_socket\r\n _context=self, _session=session)\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\ssl.py\", line 814, in __init__\r\n self.do_handshake()\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\ssl.py\", line 1068, in do_handshake\r\n self._sslobj.do_handshake()\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\ssl.py\", line 689, in do_handshake\r\n self._sslobj.do_handshake()\r\nssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:833)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\requests\\adapters.py\", line 440, in send\r\n timeout=timeout\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\urllib3\\connectionpool.py\", line 639, in urlopen\r\n _stacktrace=sys.exc_info()[2])\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-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='www.cnyes.com', port=443): Max retries exceeded with url: /global/IndexImmediateQuotedPrice/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:833)'),))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"D:/projects/DailyReport/scripts/test/test_requests_3.py\", line 50, in <module>\r\n res = s.get('https://www.cnyes.com/global/IndexImmediateQuotedPrice/')\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\requests\\sessions.py\", line 521, in get\r\n return self.request('GET', url, **kwargs)\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\requests\\sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\requests\\sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"C:\\ProgramData\\Anaconda3\\envs\\p36\\lib\\site-packages\\requests\\adapters.py\", line 506, in send\r\n raise SSLError(e, request=request)\r\nrequests.exceptions.SSLError: HTTPSConnectionPool(host='www.cnyes.com', port=443): Max retries exceeded with url: /global/IndexImmediateQuotedPrice/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:833)'),))\r\n\r\n\r\n---\r\nI'll try to contact cnyes.com to improve their web site.", "@nateprewitt \r\nI also have tried the method you mentioned, but none of them fixed this issue.\r\nHowever, when I tested the same code with my old version requests (2.0.1 I think) with old version urllib3, the issue was gone.\r\n\r\nSo I am wondering what's the critical difference between these two versions and why the manual cipher solution did not work well in this case.\r\n\r\nAgain, thanks for your help.\r\n", "@fygul, so this server is in a pretty sad state [(ssl labs report)](https://www.ssllabs.com/ssltest/analyze.html?d=www.cnyes.com). It's primary cipher suites are `RC4-MD5` and `RC4-SHA` which aren't secure and it supports 3DES_EDE_CBC with HMAC-SHA1 with TLS1.0 to appease browsers. If you change the cipher string to only `CIPHERS = 'DES-CBC3-SHA'` it will connect, so there's something else in the cipher string that the server is hanging on.\r\n\r\nSince this isn't supported with Requests default cipher suite and there's a path forward for debugging, I'm going to close this out.\r\n\r\n@wty1143, I'd suggest taking a look at your cipher string and seeing if this fixes your issue. If not, you can either use your browsers developer tools or `openssl s_client -connect yourdomainhere.com:443` to determine what cipher suite is being negotiated." ]
https://api.github.com/repos/psf/requests/issues/4637
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4637/labels{/name}
https://api.github.com/repos/psf/requests/issues/4637/comments
https://api.github.com/repos/psf/requests/issues/4637/events
https://github.com/psf/requests/issues/4637
321,480,327
MDU6SXNzdWUzMjE0ODAzMjc=
4,637
requests unexpectedly decode gzip content in some case
{ "avatar_url": "https://avatars.githubusercontent.com/u/1853708?v=4", "events_url": "https://api.github.com/users/sthenault/events{/privacy}", "followers_url": "https://api.github.com/users/sthenault/followers", "following_url": "https://api.github.com/users/sthenault/following{/other_user}", "gists_url": "https://api.github.com/users/sthenault/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sthenault", "id": 1853708, "login": "sthenault", "node_id": "MDQ6VXNlcjE4NTM3MDg=", "organizations_url": "https://api.github.com/users/sthenault/orgs", "received_events_url": "https://api.github.com/users/sthenault/received_events", "repos_url": "https://api.github.com/users/sthenault/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sthenault/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sthenault/subscriptions", "type": "User", "url": "https://api.github.com/users/sthenault", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-05-09T08:37:57Z
2021-09-08T02:10:02Z
2018-05-09T11:26:24Z
NONE
resolved
I'm attempting to retrieve https://donneespubliques.meteofrance.fr/donnees_libres/Txt/Synop/Archive/synop.201803.csv.gz using python requests. However, when accessing response's content I get the csv data, not the gzipped-csv data like I would have expected. ## Actual Result >>> url 'https://donneespubliques.meteofrance.fr/donnees_libres/Txt/Synop/Archive/synop.201803.csv.gz' >>> resp = requests.get(url) >>> resp.headers {'Date': 'Thu, 19 Apr 2018 10:48:11 GMT', 'Server': 'MFWS', 'Last-Modified': 'Sat, 31 Mar 2018 21:10:09 GMT', 'ETag': '"3066bd-a2dce-568bbc81bee40"', 'Accept-Ranges': 'bytes', 'Content-Length': '667086', 'Content-Type': 'application/x-gzip', 'Content-Encoding': 'gzip', 'Content-Disposition': 'attachment', 'Keep-Alive': 'timeout=5, max=300', 'Connection': 'Keep-Alive'} >>> resp.content[:30] b'numer_sta;date;pmer;tend;cod_t' >>> requests.__version__ '2.18.4' ## Expected Result I would have expected to get the gzip file, consistently with the 'Content-Type' header. If I access the same URL with e.g. curl I get the gzipped content as expected: $ curl https://donneespubliques.meteofrance.fr/donnees_libres/Txt/Synop/Archive/synop.201803.csv.gz -s > data $ file data data: gzip compressed data, was "synop.201803.csv", last modified: Sat Mar 31 21:10:08 2018, from Unix Same thing with direct use of urllib3: >>> http = urllib3.PoolManager() >>> resp = http.request('GET', 'https://donneespubliques.meteofrance.fr/donnees_libres/Txt/Synop/Archive/synop.201804.csv.gz') >>> resp.data[:30] b'\x1f\x8b\x08\x081\x86\xe7Z\x00\x03synop.201804.csv\x00\xcc\xfd\xd9' Is this a requests feature I don't get? A server misconfiguration? ## System Information ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.5rc1" }, "platform": { "release": "4.16.0-1-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1010008f" }, "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/4637/reactions" }
https://api.github.com/repos/psf/requests/issues/4637/timeline
null
completed
null
null
false
[ "The server specified the content encoding and we pass `decode_content` to urllib3. This checks the content encoding and decodes it for you. \r\n\r\nYou can disable this by passing stream=True to requests. However it seems that the server doesn’t want the file decoded on the client side natively so maybe this is also server misconfiguration", "sorry if I'm missing something, but how come I don't get the same behaviour\r\nwhen using urllib3 directly?\r\n\r\nI also thought it was a server misconfiguration at first, but digged deeper\r\nsince curl and wget were working as expected.\r\n", "As I said, we pass decode_content=True which you are not passing", "Digging a bit deeper...\r\n\r\nurllib3's decode_content doesn't seem to be the explanation, as it's True by default. \r\n\r\nThis seems rather due to difference with the 'Accept-encoding' setting: if 'gzip' is specified as accepted encoding, then the server send back a 'Content-encoding=gzip' , if not it's sending 'Content-encocindg=x-gzip'::\r\n\r\n syt@volt:/tmp$ curl https://donneespubliques.meteofrance.fr/donnees_libres/Txt/Synop/Archive/synop.201804.csv.gz --compressed -s > test_data\r\n syt@volt:/tmp$ file test_data\r\n test_data: ASCII text, with very long lines\r\n syt@volt:/tmp$ curl https://donneespubliques.meteofrance.fr/donnees_libres/Txt/Synop/Archive/synop.201804.csv.gz -s > test_data\r\n syt@volt:/tmp$ file test_data\r\n test_data: gzip compressed data, was \"synop.201804.csv\", last modified: Mon Apr 30 21:10:09 2018, from Unix, original size 3387471\r\n\r\n\r\nSo in my example I guess raw urllib3 doesn't send Accept-encoding, while requests does. In the former case, content isn't decoded because 'x-gzip' encoding is not known, while it is in the former since 'gzip' is.\r\n\r\nIt definitly looks like a weird server configuration...\r\n\r\n@sigmavirus24 thank you for looking a this and sorry for wasting your time" ]
https://api.github.com/repos/psf/requests/issues/4636
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4636/labels{/name}
https://api.github.com/repos/psf/requests/issues/4636/comments
https://api.github.com/repos/psf/requests/issues/4636/events
https://github.com/psf/requests/pull/4636
321,065,605
MDExOlB1bGxSZXF1ZXN0MTg2NTQzNDI2
4,636
Add check proxies not none in line 683
{ "avatar_url": "https://avatars.githubusercontent.com/u/14043779?v=4", "events_url": "https://api.github.com/users/kartikeyaj0/events{/privacy}", "followers_url": "https://api.github.com/users/kartikeyaj0/followers", "following_url": "https://api.github.com/users/kartikeyaj0/following{/other_user}", "gists_url": "https://api.github.com/users/kartikeyaj0/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kartikeyaj0", "id": 14043779, "login": "kartikeyaj0", "node_id": "MDQ6VXNlcjE0MDQzNzc5", "organizations_url": "https://api.github.com/users/kartikeyaj0/orgs", "received_events_url": "https://api.github.com/users/kartikeyaj0/received_events", "repos_url": "https://api.github.com/users/kartikeyaj0/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kartikeyaj0/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kartikeyaj0/subscriptions", "type": "User", "url": "https://api.github.com/users/kartikeyaj0", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-08T07:01:47Z
2021-09-03T00:11:00Z
2018-05-12T14:53:35Z
NONE
resolved
fixes #4635 In function merge_environment_settings before entering the loop
{ "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/4636/reactions" }
https://api.github.com/repos/psf/requests/issues/4636/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4636.diff", "html_url": "https://github.com/psf/requests/pull/4636", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4636.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4636" }
true
[ "Hi @kartikeyaj0, thanks for contributing to Requests. From the issue and this pull request it's not immediately clear how you're entering this state. Proxies will be assigned to an empty dictionary if `None` is passed to the session, and the docstring explicitly states it must be a dictionary.\r\n\r\nIn the event a user somehow circumvents this, I think it's better to make sure we blow up here rather than silently failing. For that reason, I don't think we're going to accept this patch at this time. If you have more information on your issue, or believe there's a compelling reason we're missing, please feel free to let us know. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/4635
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4635/labels{/name}
https://api.github.com/repos/psf/requests/issues/4635/comments
https://api.github.com/repos/psf/requests/issues/4635/events
https://github.com/psf/requests/issues/4635
321,058,819
MDU6SXNzdWUzMjEwNTg4MTk=
4,635
Loop if 'proxies' is not None in requests/sessions.py line 679
{ "avatar_url": "https://avatars.githubusercontent.com/u/14778970?v=4", "events_url": "https://api.github.com/users/Harshish/events{/privacy}", "followers_url": "https://api.github.com/users/Harshish/followers", "following_url": "https://api.github.com/users/Harshish/following{/other_user}", "gists_url": "https://api.github.com/users/Harshish/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Harshish", "id": 14778970, "login": "Harshish", "node_id": "MDQ6VXNlcjE0Nzc4OTcw", "organizations_url": "https://api.github.com/users/Harshish/orgs", "received_events_url": "https://api.github.com/users/Harshish/received_events", "repos_url": "https://api.github.com/users/Harshish/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Harshish/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Harshish/subscriptions", "type": "User", "url": "https://api.github.com/users/Harshish", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-08T06:32:21Z
2021-09-08T02:10:00Z
2018-05-12T14:55:34Z
NONE
resolved
function merge_environment_settings
{ "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/4635/reactions" }
https://api.github.com/repos/psf/requests/issues/4635/timeline
null
completed
null
null
false
[ "Closing with [this response](https://github.com/requests/requests/pull/4636#issuecomment-388560509) in the associated PR. We need more info to do anything actionable with this and the proposed solution will mask problems." ]
https://api.github.com/repos/psf/requests/issues/4634
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4634/labels{/name}
https://api.github.com/repos/psf/requests/issues/4634/comments
https://api.github.com/repos/psf/requests/issues/4634/events
https://github.com/psf/requests/pull/4634
320,894,838
MDExOlB1bGxSZXF1ZXN0MTg2NDE4MDI3
4,634
Spelling.
{ "avatar_url": "https://avatars.githubusercontent.com/u/52390?v=4", "events_url": "https://api.github.com/users/vshih/events{/privacy}", "followers_url": "https://api.github.com/users/vshih/followers", "following_url": "https://api.github.com/users/vshih/following{/other_user}", "gists_url": "https://api.github.com/users/vshih/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vshih", "id": 52390, "login": "vshih", "node_id": "MDQ6VXNlcjUyMzkw", "organizations_url": "https://api.github.com/users/vshih/orgs", "received_events_url": "https://api.github.com/users/vshih/received_events", "repos_url": "https://api.github.com/users/vshih/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vshih/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vshih/subscriptions", "type": "User", "url": "https://api.github.com/users/vshih", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-07T17:52:02Z
2021-09-03T00:11:01Z
2018-05-08T11:12:33Z
CONTRIBUTOR
resolved
{ "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/4634/reactions" }
https://api.github.com/repos/psf/requests/issues/4634/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4634.diff", "html_url": "https://github.com/psf/requests/pull/4634", "merged_at": "2018-05-08T11:12:33Z", "patch_url": "https://github.com/psf/requests/pull/4634.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4634" }
true
[ "Thank you @vshih!" ]
https://api.github.com/repos/psf/requests/issues/4633
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4633/labels{/name}
https://api.github.com/repos/psf/requests/issues/4633/comments
https://api.github.com/repos/psf/requests/issues/4633/events
https://github.com/psf/requests/issues/4633
320,548,826
MDU6SXNzdWUzMjA1NDg4MjY=
4,633
Humans
{ "avatar_url": "https://avatars.githubusercontent.com/u/35662044?v=4", "events_url": "https://api.github.com/users/lgjmac/events{/privacy}", "followers_url": "https://api.github.com/users/lgjmac/followers", "following_url": "https://api.github.com/users/lgjmac/following{/other_user}", "gists_url": "https://api.github.com/users/lgjmac/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lgjmac", "id": 35662044, "login": "lgjmac", "node_id": "MDQ6VXNlcjM1NjYyMDQ0", "organizations_url": "https://api.github.com/users/lgjmac/orgs", "received_events_url": "https://api.github.com/users/lgjmac/received_events", "repos_url": "https://api.github.com/users/lgjmac/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lgjmac/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lgjmac/subscriptions", "type": "User", "url": "https://api.github.com/users/lgjmac", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2018-05-05T23:18:58Z
2021-09-08T02:10:03Z
2018-05-06T14:08:29Z
NONE
resolved
Kenneth, Could you please do a 'Humans Guide for Humans'. Everything else you do is so simple, efficient and perfect that I feel I could really benefit. Thanks,
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4633/reactions" }
https://api.github.com/repos/psf/requests/issues/4633/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/4632
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4632/labels{/name}
https://api.github.com/repos/psf/requests/issues/4632/comments
https://api.github.com/repos/psf/requests/issues/4632/events
https://github.com/psf/requests/pull/4632
320,466,777
MDExOlB1bGxSZXF1ZXN0MTg2MTMxMzU3
4,632
Update license copyright to 2018
{ "avatar_url": "https://avatars.githubusercontent.com/u/6178510?v=4", "events_url": "https://api.github.com/users/mingrammer/events{/privacy}", "followers_url": "https://api.github.com/users/mingrammer/followers", "following_url": "https://api.github.com/users/mingrammer/following{/other_user}", "gists_url": "https://api.github.com/users/mingrammer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mingrammer", "id": 6178510, "login": "mingrammer", "node_id": "MDQ6VXNlcjYxNzg1MTA=", "organizations_url": "https://api.github.com/users/mingrammer/orgs", "received_events_url": "https://api.github.com/users/mingrammer/received_events", "repos_url": "https://api.github.com/users/mingrammer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mingrammer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mingrammer/subscriptions", "type": "User", "url": "https://api.github.com/users/mingrammer", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2018-05-05T00:58:18Z
2021-09-03T00:11:00Z
2018-05-13T17:30:58Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4632/reactions" }
https://api.github.com/repos/psf/requests/issues/4632/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4632.diff", "html_url": "https://github.com/psf/requests/pull/4632", "merged_at": "2018-05-13T17:30:58Z", "patch_url": "https://github.com/psf/requests/pull/4632.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4632" }
true
[]
https://api.github.com/repos/psf/requests/issues/4631
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4631/labels{/name}
https://api.github.com/repos/psf/requests/issues/4631/comments
https://api.github.com/repos/psf/requests/issues/4631/events
https://github.com/psf/requests/pull/4631
320,236,936
MDExOlB1bGxSZXF1ZXN0MTg1OTU0NDU4
4,631
Add long_description_content_type to setup.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/3275593?v=4", "events_url": "https://api.github.com/users/pradyunsg/events{/privacy}", "followers_url": "https://api.github.com/users/pradyunsg/followers", "following_url": "https://api.github.com/users/pradyunsg/following{/other_user}", "gists_url": "https://api.github.com/users/pradyunsg/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pradyunsg", "id": 3275593, "login": "pradyunsg", "node_id": "MDQ6VXNlcjMyNzU1OTM=", "organizations_url": "https://api.github.com/users/pradyunsg/orgs", "received_events_url": "https://api.github.com/users/pradyunsg/received_events", "repos_url": "https://api.github.com/users/pradyunsg/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pradyunsg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pradyunsg/subscriptions", "type": "User", "url": "https://api.github.com/users/pradyunsg", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2018-05-04T11:13:35Z
2021-09-03T00:10:57Z
2018-05-17T14:34:07Z
CONTRIBUTOR
resolved
See: - https://packaging.python.org/guides/making-a-pypi-friendly-readme/ - https://pypi.org/p/requests/
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4631/reactions" }
https://api.github.com/repos/psf/requests/issues/4631/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4631.diff", "html_url": "https://github.com/psf/requests/pull/4631", "merged_at": "2018-05-17T14:34:07Z", "patch_url": "https://github.com/psf/requests/pull/4631.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4631" }
true
[ "Duplicate of #4623 ", "Oh. Wait, it should be `text/x-rst`. Do you want me to open a new PR?", "Or update this one!", "My understanding was that if the readme is in RST, this isn't necessary to specify. Did the PEP change?", "I think it's nice-to-have. ", "I'll certianly reference it a lot, and it'll be educational for our users. ", "@sigmavirus24 if you'd reopen, I'll make the change. :)", ":crossed_fingers: this starts a new build on Travis", "# [Codecov](https://codecov.io/gh/requests/requests/pull/4631?src=pr&el=h1) Report\n> Merging [#4631](https://codecov.io/gh/requests/requests/pull/4631?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/9b5071cdb666ba9e9b9444f8cd81a15bdf79349e?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/4631/graphs/tree.svg?src=pr&token=mZGswIiXLa&width=650&height=150)](https://codecov.io/gh/requests/requests/pull/4631?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4631 +/- ##\n=======================================\n Coverage 66.53% 66.53% \n=======================================\n Files 15 15 \n Lines 1560 1560 \n=======================================\n Hits 1038 1038 \n Misses 522 522\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4631?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/4631?src=pr&el=footer). Last update [9b5071c...8bffd3d](https://codecov.io/gh/requests/requests/pull/4631?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/4630
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4630/labels{/name}
https://api.github.com/repos/psf/requests/issues/4630/comments
https://api.github.com/repos/psf/requests/issues/4630/events
https://github.com/psf/requests/issues/4630
320,167,729
MDU6SXNzdWUzMjAxNjc3Mjk=
4,630
Error reading Proxy certificates. (tlsv1 alert unknown ca)
{ "avatar_url": "https://avatars.githubusercontent.com/u/4972699?v=4", "events_url": "https://api.github.com/users/micafer/events{/privacy}", "followers_url": "https://api.github.com/users/micafer/followers", "following_url": "https://api.github.com/users/micafer/following{/other_user}", "gists_url": "https://api.github.com/users/micafer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/micafer", "id": 4972699, "login": "micafer", "node_id": "MDQ6VXNlcjQ5NzI2OTk=", "organizations_url": "https://api.github.com/users/micafer/orgs", "received_events_url": "https://api.github.com/users/micafer/received_events", "repos_url": "https://api.github.com/users/micafer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/micafer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/micafer/subscriptions", "type": "User", "url": "https://api.github.com/users/micafer", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-05-04T06:42:14Z
2021-09-08T02:09:51Z
2018-05-04T11:41:07Z
NONE
resolved
Error reading Proxy certificates. It works for requests versions 2.11.1 and older. But it does not work for 2.12.0 and newer versions. ## Expected Result ``` <Response [200]> ``` ## Actual Result ``` requests.exceptions.ConnectionError: HTTPSConnectionPool(host='cloud.recas.ba.infn.it', port=5000): Max retries exceeded with url: /v2.0/tokens (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert unknown ca')],)",),)) ``` ## Reproduction Steps ```python import requests body = '{"auth":{"voms":true}}' headers = {'Accept': 'application/json', 'Connection': 'close', 'Content-Type': 'application/json'} url = "https://<keystone_server>:5000/v2.0/tokens" # it is a grid proxy certificate cert = "/tmp/proxy.pem" # or cert = ("/tmp/proxy.pem", "/tmp/proxy.pem") requests.request('POST', url, verify=False, cert=cert, headers=headers, data=body) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.2.2" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.13" }, "platform": { "release": "4.4.0-121-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010008f", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1010006f" }, "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/4630/reactions" }
https://api.github.com/repos/psf/requests/issues/4630/timeline
null
completed
null
null
false
[ "The primary difference that looks potentially relevant to this [between 2.11.1 and 2.12.0](https://github.com/requests/requests/compare/v2.11.1...v2.12.0) is in urllib3. I believe that if the certificate authority file is false, we attempt to load the default file for the operating system. It seems that the code in [question](https://github.com/urllib3/urllib3/blob/30e9855307aaa9f9f09651f2bbddeb7350eed666/urllib3/util/ssl_.py#L334..L347) doesn't check the `cert_reqs` parameter which we [set to bypass verification](https://github.com/urllib3/urllib3/blob/30e9855307aaa9f9f09651f2bbddeb7350eed666/urllib3/util/ssl_.py#L334..L347). It also seems plausible to me that `load_default_certs` is resetting `cert_reqs` so that we do try to verify the TLS certificate when connecting.\r\n\r\nEither way, this needs further investigation in urllib3.", "This isssue is solved in urllib 1.23.\r\nAnd it seems that you have updated you code to use update the urllib3 version in this commit\r\nhttps://github.com/requests/requests/commit/ac944b7439009ffbf7a10dfee35202f1ac090e76.\r\nI'm waiting it to be released." ]
https://api.github.com/repos/psf/requests/issues/4629
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4629/labels{/name}
https://api.github.com/repos/psf/requests/issues/4629/comments
https://api.github.com/repos/psf/requests/issues/4629/events
https://github.com/psf/requests/pull/4629
320,151,821
MDExOlB1bGxSZXF1ZXN0MTg1ODkxMTQ5
4,629
Fix iter_lines boundary bug when CRLF straddles two chunks
{ "avatar_url": "https://avatars.githubusercontent.com/u/282869?v=4", "events_url": "https://api.github.com/users/nanotone/events{/privacy}", "followers_url": "https://api.github.com/users/nanotone/followers", "following_url": "https://api.github.com/users/nanotone/following{/other_user}", "gists_url": "https://api.github.com/users/nanotone/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nanotone", "id": 282869, "login": "nanotone", "node_id": "MDQ6VXNlcjI4Mjg2OQ==", "organizations_url": "https://api.github.com/users/nanotone/orgs", "received_events_url": "https://api.github.com/users/nanotone/received_events", "repos_url": "https://api.github.com/users/nanotone/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nanotone/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nanotone/subscriptions", "type": "User", "url": "https://api.github.com/users/nanotone", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-04T04:36:22Z
2021-09-03T00:11:01Z
2018-05-04T13:42:58Z
NONE
resolved
In `Response.iter_lines`, if a `\r\n` sequence (the only multi-character line boundary) straddles two chunks, the `\r` and `\n` are treated as two separate boundaries. Consequently, `iter_lines` will yield one extra blank line, as an empty string. This addresses the issue by checking if a chunk ends with `\r`, and when appropriate, leaving the trailing line in `pending` until the next chunk or EOF arrives.
{ "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/4629/reactions" }
https://api.github.com/repos/psf/requests/issues/4629/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4629.diff", "html_url": "https://github.com/psf/requests/pull/4629", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4629.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4629" }
true
[ "Hi @nanotone, thanks for putting this together! This has actually already been addressed and is patched for Requests-3.0 (#3984). We won't be able to merge this into the current master branch because it's a breaking change for some users which isn't backwards compatible." ]
https://api.github.com/repos/psf/requests/issues/4628
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4628/labels{/name}
https://api.github.com/repos/psf/requests/issues/4628/comments
https://api.github.com/repos/psf/requests/issues/4628/events
https://github.com/psf/requests/issues/4628
320,144,100
MDU6SXNzdWUzMjAxNDQxMDA=
4,628
Booleans in form data are being incorrectly encoded in post requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/5299236?v=4", "events_url": "https://api.github.com/users/dteh/events{/privacy}", "followers_url": "https://api.github.com/users/dteh/followers", "following_url": "https://api.github.com/users/dteh/following{/other_user}", "gists_url": "https://api.github.com/users/dteh/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dteh", "id": 5299236, "login": "dteh", "node_id": "MDQ6VXNlcjUyOTkyMzY=", "organizations_url": "https://api.github.com/users/dteh/orgs", "received_events_url": "https://api.github.com/users/dteh/received_events", "repos_url": "https://api.github.com/users/dteh/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dteh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dteh/subscriptions", "type": "User", "url": "https://api.github.com/users/dteh", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-04T03:27:35Z
2021-09-08T02:10:03Z
2018-05-04T13:50:58Z
NONE
resolved
When sending form data, values which are booleans are encoded as "True" and "False" as opposed to "true" and "false". This is because of the urllib.parse.urlencode function. Perhaps it is non standard to pass a boolean as form data, but I think this is non obvious to regular users. Maybe it should raise an exception or perform a conversion to lowercase. ## Expected Result ``` >>> data = {"key": True, "key2": "true"} >>> req = requests.post("http://www.google.com", data=data) >>> req.request.body 'key=true&key2=true' ``` ## Actual Result ``` >>> data = {"key": True, "key2": "true"} >>> req = requests.post("http://www.google.com", data=data) >>> req.request.body 'key=True&key2=true' ``` ## Reproduction Steps Pass a dictionary with a key/value pair with a boolean value to the data param of a post.
{ "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/4628/reactions" }
https://api.github.com/repos/psf/requests/issues/4628/timeline
null
completed
null
null
false
[ "In the future, please search **closed and** open issues before creating new ones that are duplicates. I'm not going to go find the duplicates right now. Given all of the possible representations of \"True\" on the internet, we can't really just pick one. Further, we rely on the stdlib to provide the serialization for this particular content type so we don't even do this directly. You should be thinking about how you want to pre-process the data you send. Feeding everything into requests and expecting it to magic its way to what you want isn't reasonable." ]
https://api.github.com/repos/psf/requests/issues/4627
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4627/labels{/name}
https://api.github.com/repos/psf/requests/issues/4627/comments
https://api.github.com/repos/psf/requests/issues/4627/events
https://github.com/psf/requests/pull/4627
320,134,200
MDExOlB1bGxSZXF1ZXN0MTg1ODc4NjAw
4,627
Strip whitespace for proxy urls, test for same. #4613
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
false
null
[]
{ "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-05-04T02:02:04Z
2024-05-20T14:35:51Z
2024-05-20T14:35:51Z
NONE
null
I'm not sure this is the right place to do this operation, but it does solve the problem. Or at least it passes the test that I wrote for it. Quite likely I'm not reading them correctly, but as far as I can tell the other test methods related to proxies don't test something like a `requests.get()` call with the expectation of a successful result. I found a ton of tests for error cases, though, and modeled the test for this situation on those, but it seems like there would be a better way.
{ "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/4627/reactions" }
https://api.github.com/repos/psf/requests/issues/4627/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4627.diff", "html_url": "https://github.com/psf/requests/pull/4627", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4627.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4627" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4627?src=pr&el=h1) Report\n> Merging [#4627](https://codecov.io/gh/requests/requests/pull/4627?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/fe8290b3d0ca21dd8ae5471a59a8bf13d3dcb31e?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `100%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4627/graphs/tree.svg?height=150&width=650&token=mZGswIiXLa&src=pr)](https://codecov.io/gh/requests/requests/pull/4627?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4627 +/- ##\n=======================================\n Coverage 66.62% 66.62% \n=======================================\n Files 15 15 \n Lines 1564 1564 \n=======================================\n Hits 1042 1042 \n Misses 522 522\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4627?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4627/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `70.18% <100%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4627?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/4627?src=pr&el=footer). Last update [fe8290b...a3091c6](https://codecov.io/gh/requests/requests/pull/4627?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/4626
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4626/labels{/name}
https://api.github.com/repos/psf/requests/issues/4626/comments
https://api.github.com/repos/psf/requests/issues/4626/events
https://github.com/psf/requests/pull/4626
320,133,517
MDExOlB1bGxSZXF1ZXN0MTg1ODc4MTMy
4,626
Add test for stripping of proxy url.
{ "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
0
2018-05-04T01:56:17Z
2021-09-03T00:11:02Z
2018-05-04T01:59:08Z
NONE
resolved
Strip whitespace from proxy URLs in get_connection to resolve #4613. I'm not sure this is the right place to do this operation, but it does solve the problem. Or at least it passes the test that I wrote for it. Quite likely I'm not reading them correctly, but as far as I can tell the other test methods related to proxies don't test something like a `requests.get()` call with the expectation of a successful result. I found a ton of tests for error cases, though and modeled the test for this situation on those, but it seems like there would be a better way.
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/4626/reactions" }
https://api.github.com/repos/psf/requests/issues/4626/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4626.diff", "html_url": "https://github.com/psf/requests/pull/4626", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4626.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4626" }
true
[]
https://api.github.com/repos/psf/requests/issues/4625
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4625/labels{/name}
https://api.github.com/repos/psf/requests/issues/4625/comments
https://api.github.com/repos/psf/requests/issues/4625/events
https://github.com/psf/requests/pull/4625
319,977,963
MDExOlB1bGxSZXF1ZXN0MTg1NzYwMTQ0
4,625
Certifi.io broken
{ "avatar_url": "https://avatars.githubusercontent.com/u/5297556?v=4", "events_url": "https://api.github.com/users/nicktimko/events{/privacy}", "followers_url": "https://api.github.com/users/nicktimko/followers", "following_url": "https://api.github.com/users/nicktimko/following{/other_user}", "gists_url": "https://api.github.com/users/nicktimko/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nicktimko", "id": 5297556, "login": "nicktimko", "node_id": "MDQ6VXNlcjUyOTc1NTY=", "organizations_url": "https://api.github.com/users/nicktimko/orgs", "received_events_url": "https://api.github.com/users/nicktimko/received_events", "repos_url": "https://api.github.com/users/nicktimko/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nicktimko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicktimko/subscriptions", "type": "User", "url": "https://api.github.com/users/nicktimko", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-05-03T15:48:07Z
2021-09-03T00:10:59Z
2018-05-14T16:22:11Z
CONTRIBUTOR
resolved
http://certifi.io/ -> https://certifiio.readthedocs.io/
{ "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/4625/reactions" }
https://api.github.com/repos/psf/requests/issues/4625/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4625.diff", "html_url": "https://github.com/psf/requests/pull/4625", "merged_at": "2018-05-14T16:22:11Z", "patch_url": "https://github.com/psf/requests/pull/4625.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4625" }
true
[ "Hey @nicktimko, thanks for this! Would you mind rebasing this onto the current master branch?", "Thanks @nicktimko!" ]
https://api.github.com/repos/psf/requests/issues/4624
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4624/labels{/name}
https://api.github.com/repos/psf/requests/issues/4624/comments
https://api.github.com/repos/psf/requests/issues/4624/events
https://github.com/psf/requests/issues/4624
319,847,877
MDU6SXNzdWUzMTk4NDc4Nzc=
4,624
recv block forever
{ "avatar_url": "https://avatars.githubusercontent.com/u/6950099?v=4", "events_url": "https://api.github.com/users/zhangyuchun/events{/privacy}", "followers_url": "https://api.github.com/users/zhangyuchun/followers", "following_url": "https://api.github.com/users/zhangyuchun/following{/other_user}", "gists_url": "https://api.github.com/users/zhangyuchun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhangyuchun", "id": 6950099, "login": "zhangyuchun", "node_id": "MDQ6VXNlcjY5NTAwOTk=", "organizations_url": "https://api.github.com/users/zhangyuchun/orgs", "received_events_url": "https://api.github.com/users/zhangyuchun/received_events", "repos_url": "https://api.github.com/users/zhangyuchun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhangyuchun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhangyuchun/subscriptions", "type": "User", "url": "https://api.github.com/users/zhangyuchun", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-05-03T09:31:10Z
2021-09-04T00:06:21Z
2018-05-03T09:40:37Z
NONE
resolved
Summary. ## Expected Result don't block forever. ## Actual Result block forever ## Reproduction Steps i write a python3 spider using requests . it can run for a long time normally. but sometimes it block recv data forever . i don't this is either a python3's bug or a requests's bug. can you help me ? please ask me for more info if need, info below: strace -p 12585: strace: Process 12585 attached recvfrom(5, strack 12585: #0 0x00007f16e10b9a3d in recv () from /lib64/libpthread.so.0 #1 0x00007f16d99d3da1 in sock_recv_impl (data=0x7ffec7c72170, s=0x7f16d3df8b28) at /root/deploy/Python-3.6.5/Modules/socketmodule.c:3064 #2 sock_call_ex (s=s@entry=0x7f16d3df8b28, data=data@entry=0x7ffec7c72170, timeout=-1000000000, err=0x0, connect=0, sock_func=0x7f16d99d1c60 <sock_recv_impl>, writing=0) at /root/deploy/Python-3.6.5/Modules/socketmodule.c:898 #3 0x00007f16d99d3f18 in sock_call (data=0x7ffec7c72170, func=0x7f16d99d1c60 <sock_recv_impl>, writing=0, s=0x7f16d3df8b28) at /root/deploy/Python-3.6.5/Modules/socketmodule.c:950 #4 sock_recv_guts (flags=<optimized out>, len=<optimized out>, cbuf=<optimized out>, s=0x7f16d3df8b28) at /root/deploy/Python-3.6.5/Modules/socketmodule.c:3096 #5 sock_recv_into (s=0x7f16d3df8b28, args=<optimized out>, kwds=<optimized out>) at /root/deploy/Python-3.6.5/Modules/socketmodule.c:3191 #6 0x00000000004aa107 in _PyCFunction_FastCallDict (kwargs=0x0, nargs=1, args=0x7f16d99d3e50 <sock_recv_into>, func_obj=0x7f16d3a5c9d8) at Objects/methodobject.c:231 #7 _PyCFunction_FastCallKeywords (func=func@entry=0x7f16d3a5c9d8, stack=stack@entry=0x15741d0, nargs=1, kwnames=kwnames@entry=0x0) at Objects/methodobject.c:294 #8 0x0000000000540e84 in call_function (pp_stack=pp_stack@entry=0x7ffec7c723a0, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:4824 #9 0x0000000000545cdc in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3322 #10 0x000000000053fe31 in PyEval_EvalFrameEx (throwflag=0, f=0x1574038) at Python/ceval.c:753 #11 _PyFunction_FastCall (co=co@entry=0x7f16da0a7d20, args=<optimized out>, args@entry=0x7ffec7c725a0, nargs=nargs@entry=2, globals=globals@entry=0x7f16da0a50d8) at Python/ceval.c:4906 #12 0x0000000000549d86 in _PyFunction_FastCallDict (func=func@entry=0x7f16da0546a8, args=args@entry=0x7ffec7c725a0, nargs=nargs@entry=2, kwargs=kwargs@entry=0x0) at Python/ceval.c:5008 #13 0x000000000045214f in _PyObject_FastCallDict (func=0x7f16da0546a8, args=0x7ffec7c725a0, nargs=2, kwargs=0x0) at Objects/abstract.c:2310 #14 0x000000000045224b in _PyObject_Call_Prepend (func=0x7f16da0546a8, obj=0x7f16d35983c8, args=0x7f16d3c77160, kwargs=0x0) at Objects/abstract.c:2373 #15 0x0000000000452002 in _PyObject_FastCallDict (func=0x7f16d3a82088, args=0x7ffec7c72690, nargs=1, kwargs=0x0) at Objects/abstract.c:2331 #16 0x0000000000453186 in PyObject_CallMethodObjArgs (callable=0x7f16d3a82088, name=<optimized out>) at Objects/abstract.c:2759 #17 0x00000000005bc155 in _bufferedreader_raw_read (self=self@entry=0x7f16d575dca8, start=<optimized out>, len=8192) at ./Modules/_io/bufferedio.c:1498 #18 0x00000000005be99c in _bufferedreader_fill_buffer (self=0x7f16d575dca8) at ./Modules/_io/bufferedio.c:1530 #19 _buffered_readline (self=self@entry=0x7f16d575dca8, limit=65537) at ./Modules/_io/bufferedio.c:1159 #20 0x00000000005bed61 in _io__Buffered_readline_impl (size=<optimized out>, self=0x7f16d575dca8) at ./Modules/_io/bufferedio.c:1219 #21 _io__Buffered_readline (self=0x7f16d575dca8, args=<optimized out>) at ./Modules/_io/clinic/bufferedio.c.h:251 #22 0x00000000004a9f89 in _PyCFunction_FastCallDict (kwargs=0x0, nargs=1, args=0x5bed20 <_io__Buffered_readline>, func_obj=0x7f16d34c9dc8) at Objects/methodobject.c:234 #23 _PyCFunction_FastCallKeywords (func=func@entry=0x7f16d34c9dc8, stack=stack@entry=0x1573f58, nargs=1, kwnames=kwnames@entry=0x0) at Objects/methodobject.c:294 #24 0x0000000000540e84 in call_function (pp_stack=pp_stack@entry=0x7ffec7c72a80, oparg=oparg@entry=1, kwnames=kwnames@entry=0x0) at Python/ceval.c:4824 #25 0x0000000000545cdc in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3322 #26 0x000000000053fe31 in PyEval_EvalFrameEx (throwflag=0, f=0x1573da8) at Python/ceval.c:753 #27 _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=1, globals=globals@entry=0x7f16d9519240) at Python/ceval.c:4906 #28 0x0000000000540fc7 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f16d6415f28) at Python/ceval.c:4941 #29 call_function (pp_stack=pp_stack@entry=0x7ffec7c72ca0, oparg=oparg@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:4845 #30 0x0000000000545cdc in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3322 #31 0x000000000053fe31 in PyEval_EvalFrameEx (throwflag=0, f=0x1573b68) at Python/ceval.c:753 #32 _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=1, globals=globals@entry=0x7f16d9519240) at Python/ceval.c:4906 #33 0x0000000000540fc7 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f16d6419048) at Python/ceval.c:4941 #34 call_function (pp_stack=pp_stack@entry=0x7ffec7c72ec0, oparg=oparg@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:4845 #35 0x0000000000545cdc in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3322 #36 0x000000000053fe31 in PyEval_EvalFrameEx (throwflag=0, f=0x1571498) at Python/ceval.c:753 #37 _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=1, globals=globals@entry=0x7f16d9519240) at Python/ceval.c:4906 #38 0x0000000000540fc7 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f16d641bae8) at Python/ceval.c:4941 #39 call_function (pp_stack=pp_stack@entry=0x7ffec7c730e0, oparg=oparg@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:4845 #40 0x0000000000545cdc in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3322 #41 0x0000000000540aa1 in PyEval_EvalFrameEx (throwflag=0, f=0x1570058) at Python/ceval.c:753 #42 _PyEval_EvalCodeWithName (_co=0x7f16da061810, globals=globals@entry=0x7f16da05f048, locals=locals@entry=0x0, args=<optimized out>, argcount=4, kwnames=0x7f16da06a0b0, kwargs=kwargs@entry=0x156f418, kwcount=4, kwstep=kwstep@entry=1, defs=0x7f16d5d1e0e0, defcount=defcount@entry=2, kwdefs=0x0, closure=0x0, name=name@entry=0x7f16da062fb0, qualname=0x7f16da068138) at Python/ceval.c:4153 #43 0x0000000000540d9f in fast_function (kwnames=0x156f418, nargs=<optimized out>, stack=<optimized out>, func=0x7f16d5d31bf8) at Python/ceval.c:4965 #44 call_function (pp_stack=pp_stack@entry=0x7ffec7c73380, oparg=oparg@entry=7, kwnames=kwnames@entry=0x7f16da06a098) at Python/ceval.c:4845 #45 0x00000000005461cb in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3338 #46 0x0000000000540aa1 in PyEval_EvalFrameEx (throwflag=0, f=0x156f1a8) at Python/ceval.c:753 #47 _PyEval_EvalCodeWithName (_co=0x7f16da061ae0, globals=globals@entry=0x7f16da05f048, locals=locals@entry=0x0, args=<optimized out>, argcount=1, kwnames=0x7f16d56b71e0, kwargs=kwargs@entry=0x156d4e8, kwcount=10, kwstep=kwstep@entry=1, defs=0x7f16d638e8e0, defcount=defcount@entry=10, kwdefs=0x0, closure=0x0, name=name@entry=0x7f16da064ae8, qualname=0x7f16da06a170) at Python/ceval.c:4153 #48 0x0000000000540d9f in fast_function (kwnames=0x156d4e8, nargs=<optimized out>, stack=<optimized out>, func=0x7f16d5d31e18) at Python/ceval.c:4965 #49 call_function (pp_stack=pp_stack@entry=0x7ffec7c73610, oparg=oparg@entry=10, kwnames=kwnames@entry=0x7f16d56b71c8) at Python/ceval.c:4845 #50 0x00000000005461cb in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3338 #51 0x0000000000540aa1 in PyEval_EvalFrameEx (throwflag=0, f=0x156d2c8) at Python/ceval.c:753 #52 _PyEval_EvalCodeWithName (_co=_co@entry=0x7f16d539f660, globals=globals@entry=0x7f16d539c5a0, locals=locals@entry=0x0, args=args@entry=0x7ffec7c73870, argcount=argcount@entry=2, kwnames=kwnames@entry=0x7f16d538cee0, kwargs=kwargs@entry=0x7f16d538cee8, kwcount=10, kwcount@entry=5, kwstep=kwstep@entry=2, defs=0x7f16d53a21c0, defcount=5, kwdefs=0x0, closure=0x0, name=0x7f16e14bc420, qualname=0x7f16d539cc90) at Python/ceval.c:4153 #53 0x0000000000549ca6 in _PyFunction_FastCallDict (func=func@entry=0x7f16d53a9598, args=args@entry=0x7ffec7c73870, nargs=nargs@entry=2, kwargs=kwargs@entry=0x7f16d36d61f8) at Python/ceval.c:5057 #54 0x000000000045214f in _PyObject_FastCallDict (func=0x7f16d53a9598, args=0x7ffec7c73870, nargs=2, kwargs=0x7f16d36d61f8) at Objects/abstract.c:2310 #55 0x000000000045224b in _PyObject_Call_Prepend (func=0x7f16d53a9598, obj=0x7f16d3e052b0, args=0x7f16d38709e8, kwargs=0x7f16d36d61f8) at Objects/abstract.c:2373 #56 0x0000000000451e20 in PyObject_Call (func=func@entry=0x7f16d5337b88, args=args@entry=0x7f16d38709e8, kwargs=kwargs@entry=0x7f16d36d61f8) at Objects/abstract.c:2261 #57 0x00000000005460d2 in do_call_core (kwdict=0x7f16d36d61f8, callargs=0x7f16d38709e8, func=0x7f16d5337b88) at Python/ceval.c:5093 #58 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3391 #59 0x0000000000540aa1 in PyEval_EvalFrameEx (throwflag=0, f=0x15bde38) at Python/ceval.c:753 #60 _PyEval_EvalCodeWithName (_co=_co@entry=0x7f16d539b420, globals=globals@entry=0x7f16d5394900, locals=locals@entry=0x0, args=args@entry=0x7ffec7c73c20, argcount=argcount@entry=2, kwnames=kwnames@entry=0x7f16d534e690, kwargs=kwargs@entry=0x7f16d534e698, kwcount=12, kwcount@entry=6, kwstep=kwstep@entry=2, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x7f16e14bc420, qualname=0x7f16d539a9f0) at Python/ceval.c:4153 #61 0x0000000000549ca6 in _PyFunction_FastCallDict (func=func@entry=0x7f16d53aa048, args=args@entry=0x7ffec7c73c20, nargs=nargs@entry=2, kwargs=kwargs@entry=0x7f16d36d63f0) at Python/ceval.c:5057 #62 0x000000000045214f in _PyObject_FastCallDict (func=0x7f16d53aa048, args=0x7ffec7c73c20, nargs=2, kwargs=0x7f16d36d63f0) at Objects/abstract.c:2310 #63 0x000000000045224b in _PyObject_Call_Prepend (func=0x7f16d53aa048, obj=0x7f16e133c5c0, args=0x7f16d3c770f0, kwargs=0x7f16d36d63f0) at Objects/abstract.c:2373 #64 0x0000000000451e20 in PyObject_Call (func=func@entry=0x7f16d3a82a88, args=args@entry=0x7f16d3c770f0, kwargs=kwargs@entry=0x7f16d36d63f0) at Objects/abstract.c:2261 #65 0x00000000005460d2 in do_call_core (kwdict=0x7f16d36d63f0, callargs=0x7f16d3c770f0, func=0x7f16d3a82a88) at Python/ceval.c:5093 #66 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3391 #67 0x0000000000540aa1 in PyEval_EvalFrameEx (throwflag=0, f=0x1568dd8) at Python/ceval.c:753 #68 _PyEval_EvalCodeWithName (_co=_co@entry=0x7f16d538eed0, globals=globals@entry=0x7f16d5394900, locals=locals@entry=0x0, args=args@entry=0x7ffec7c73fd0, argcount=argcount@entry=3, kwnames=kwnames@entry=0x7f16d34f6b00, kwargs=kwargs@entry=0x7f16d34f6b08, kwcount=4, kwcount@entry=2, kwstep=kwstep@entry=2, defs=0x7f16d5744600, defcount=14, kwdefs=0x0, closure=0x0, name=0x7f16da0a45a8, qualname=0x7f16d539a470) at Python/ceval.c:4153 #69 0x0000000000549ca6 in _PyFunction_FastCallDict (func=func@entry=0x7f16d53a9b70, args=args@entry=0x7ffec7c73fd0, nargs=nargs@entry=3, kwargs=kwargs@entry=0x7f16d36d6ea0) at Python/ceval.c:5057 #70 0x000000000045214f in _PyObject_FastCallDict (func=0x7f16d53a9b70, args=0x7ffec7c73fd0, nargs=3, kwargs=0x7f16d36d6ea0) at Objects/abstract.c:2310 #71 0x000000000045224b in _PyObject_Call_Prepend (func=0x7f16d53a9b70, obj=0x7f16e133c5c0, args=0x7f16d3b744c8, kwargs=0x7f16d36d6ea0) at Objects/abstract.c:2373 #72 0x0000000000451e20 in PyObject_Call (func=func@entry=0x7f16d3a42888, args=args@entry=0x7f16d3b744c8, kwargs=kwargs@entry=0x7f16d36d6ea0) at Objects/abstract.c:2261 #73 0x00000000005460d2 in do_call_core (kwdict=0x7f16d36d6ea0, callargs=0x7f16d3b744c8, func=0x7f16d3a42888) at Python/ceval.c:5093 #74 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3391 #75 0x0000000000540aa1 in PyEval_EvalFrameEx (throwflag=0, f=0x7f16d5331768) at Python/ceval.c:753 #76 _PyEval_EvalCodeWithName (_co=0x7f16d538ef60, globals=globals@entry=0x7f16d5394900, locals=locals@entry=0x0, args=<optimized out>, argcount=2, kwnames=0x7f16e12fd1b0, kwargs=kwargs@entry=0x15c2238, kwcount=1, kwstep=kwstep@entry=1, defs=0x0, defcount=defcount@entry=0, kwdefs=0x0, closure=0x0, name=name@entry=0x7f16e14a5490, qualname=0x7f16d539a530) at Python/ceval.c:4153 #77 0x0000000000540d9f in fast_function (kwnames=0x15c2238, nargs=<optimized out>, stack=<optimized out>, func=0x7f16d53a9bf8) at Python/ceval.c:4965 #78 call_function (pp_stack=pp_stack@entry=0x7ffec7c743b0, oparg=oparg@entry=2, kwnames=kwnames@entry=0x7f16e12fd198) at Python/ceval.c:4845 #79 0x00000000005461cb in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3338 #80 0x000000000053fe31 in PyEval_EvalFrameEx (throwflag=0, f=0x15c2058) at Python/ceval.c:753 #81 _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=4, globals=globals@entry=0x7f16e144c1b0) at Python/ceval.c:4906 #82 0x0000000000540fc7 in fast_function (kwnames=0x0, nargs=<optimized out>, stack=<optimized out>, func=0x7f16d531a378) at Python/ceval.c:4941 #83 call_function (pp_stack=pp_stack@entry=0x7ffec7c745c0, oparg=oparg@entry=4, kwnames=kwnames@entry=0x0) at Python/ceval.c:4845 #84 0x0000000000545cdc in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3322 #85 0x0000000000540aa1 in PyEval_EvalFrameEx (throwflag=0, f=0x12d7ab8) at Python/ceval.c:753 #86 _PyEval_EvalCodeWithName (_co=_co@entry=0x7f16e13cac00, globals=globals@entry=0x7f16e1338828, locals=locals@entry=0x7f16e1359d18, args=args@entry=0x0, argcount=argcount@entry=0, kwnames=kwnames@entry=0x0, kwargs=kwargs@entry=0x0, kwcount=kwcount@entry=0, kwstep=kwstep@entry=2, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name=name@entry=0x0, qualname=qualname@entry=0x0) at Python/ceval.c:4153 #87 0x00000000005418e0 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, locals=locals@entry=0x7f16e1359d18, globals=globals@entry=0x7f16e1338828, _co=_co@entry=0x7f16e13cac00) at Python/ceval.c:4174 #88 PyEval_EvalCode (co=co@entry=0x7f16e13cac00, globals=globals@entry=0x7f16e144c1b0, locals=locals@entry=0x7f16e144c1b0) at Python/ceval.c:730 #89 0x0000000000426768 in run_mod (arena=0x7f16e1466150, flags=0x7ffec7c748d0, locals=0x7f16e144c1b0, globals=0x7f16e144c1b0, filename=0x7f16e1359d18, mod=0x12e3e38) at Python/pythonrun.c:1025 #90 PyRun_FileExFlags (fp=0x1276480, filename_str=<optimized out>, start=<optimized out>, globals=0x7f16e144c1b0, locals=0x7f16e144c1b0, closeit=1, flags=0x7ffec7c748d0) at Python/pythonrun.c:978 #91 0x000000000042694d in PyRun_SimpleFileExFlags (fp=0x1276480, filename=<optimized out>, closeit=1, flags=0x7ffec7c748d0) at Python/pythonrun.c:420 #92 0x000000000043baea in run_file (p_cf=0x7ffec7c748d0, filename=0x12352a0 L"main.py", fp=0x1276480) at Modules/main.c:340 #93 Py_Main (argc=argc@entry=3, argv=argv@entry=0x1234010) at Modules/main.c:810 #94 0x000000000041d962 in main (argc=3, argv=<optimized out>) at ./Programs/python.c:69 ## System Information $ python -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.5" }, "platform": { "release": "3.10.0-693.el7.x86_64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ls -al /proc/12585/fd: total 0 dr-x------ 2 root root 0 May 3 16:55 . dr-xr-xr-x 9 root root 0 Apr 26 20:50 .. l-wx------ 1 root root 64 May 3 16:55 0 -> /dev/null l-wx------ 1 root root 64 May 3 16:55 1 -> /root/server/data.log l-wx------ 1 root root 64 May 3 16:55 2 -> /root/server/data.log lrwx------ 1 root root 64 May 3 16:55 3 -> socket:[168821] lrwx------ 1 root root 64 May 3 16:55 4 -> socket:[168836] lrwx------ 1 root root 64 May 3 16:55 5 -> socket:[170894] cat /proc/12585/net/tcp: sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 0: 00000000:006F 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 15883 1 ffff8800b6168000 100 0 0 10 0 1: 0100007F:0019 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 19668 1 ffff8800b61687c0 100 0 0 10 0 2: 00000000:E49A 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 0 17210 1 ffff880137f60000 100 0 0 10 0 3: E5C6230A:B0D6 E6D0210A:0050 08 00000000:00000001 00:00000000 00000000 0 0 168821 1 ffff8800b616ae80 22 4 0 10 -1 4: E5C6230A:97D0 CCDB200A:0050 01 00000000:00000000 00:00000000 00000000 0 0 170894 1 ffff8800b616cd80 20 0 0 10 -1 5: E5C6230A:E49A C3C6230A:C525 01 00000000:00000000 02:0009A9F7 00000000 0 0 366844 4 ffff8800b6169f00 20 4 31 10 -1 netstat -anlp | grep python3: tcp 1 0 10.35.198.229:45270 10.33.208.230:80 CLOSE_WAIT 12585/python3 tcp 0 0 10.35.198.229:38864 10.32.219.204:80 ESTABLISHED 12585/python3 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/6950099?v=4", "events_url": "https://api.github.com/users/zhangyuchun/events{/privacy}", "followers_url": "https://api.github.com/users/zhangyuchun/followers", "following_url": "https://api.github.com/users/zhangyuchun/following{/other_user}", "gists_url": "https://api.github.com/users/zhangyuchun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/zhangyuchun", "id": 6950099, "login": "zhangyuchun", "node_id": "MDQ6VXNlcjY5NTAwOTk=", "organizations_url": "https://api.github.com/users/zhangyuchun/orgs", "received_events_url": "https://api.github.com/users/zhangyuchun/received_events", "repos_url": "https://api.github.com/users/zhangyuchun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/zhangyuchun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zhangyuchun/subscriptions", "type": "User", "url": "https://api.github.com/users/zhangyuchun", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4624/reactions" }
https://api.github.com/repos/psf/requests/issues/4624/timeline
null
completed
null
null
false
[ "use timeout arg.", "I'm seeing the same issue, and I am using the timeout arg.\r\n\r\n```\r\nsudo strace -p 68636\r\nstrace: Process 68636 attached\r\nrecvfrom(4, \r\n```\r\n\r\nAnd as far as I can tell this is happening during:\r\n```\r\n r = requests.post(config.get('ad_url'), oauth_params, timeout=10)\r\n```\r\nin the following larger context:\r\n```\r\n print('Fetching access token...')\r\n r = requests.post(config.get('ad_url'), oauth_params, timeout=10)\r\n data = r.json()\r\n if 'access_token' not in data:\r\n print('could not get access token', r)\r\n\r\n access_token = data['access_token']\r\n print(access_token)\r\n```\r\n\r\nMy reasoning being, in my logs, I see:\r\n```\r\nFetching access token...\r\n```\r\n\r\nAnd then silence.\r\n\r\nI guess I should try to reproduce with my own client/server setup. And maybe at this point it's more likely that there's something wrong with my logging than that there's a bug like this in requests." ]
https://api.github.com/repos/psf/requests/issues/4623
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4623/labels{/name}
https://api.github.com/repos/psf/requests/issues/4623/comments
https://api.github.com/repos/psf/requests/issues/4623/events
https://github.com/psf/requests/pull/4623
319,785,285
MDExOlB1bGxSZXF1ZXN0MTg1NjE1MTc0
4,623
add long_description_content_type to setup.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/3126246?v=4", "events_url": "https://api.github.com/users/ngoldbaum/events{/privacy}", "followers_url": "https://api.github.com/users/ngoldbaum/followers", "following_url": "https://api.github.com/users/ngoldbaum/following{/other_user}", "gists_url": "https://api.github.com/users/ngoldbaum/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ngoldbaum", "id": 3126246, "login": "ngoldbaum", "node_id": "MDQ6VXNlcjMxMjYyNDY=", "organizations_url": "https://api.github.com/users/ngoldbaum/orgs", "received_events_url": "https://api.github.com/users/ngoldbaum/received_events", "repos_url": "https://api.github.com/users/ngoldbaum/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ngoldbaum/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ngoldbaum/subscriptions", "type": "User", "url": "https://api.github.com/users/ngoldbaum", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2018-05-03T04:31:17Z
2021-09-03T00:11:02Z
2018-05-03T14:16:38Z
NONE
resolved
This will make the readme render correctly on pypi. https://packaging.python.org/tutorials/distributing-packages/#description
{ "avatar_url": "https://avatars.githubusercontent.com/u/3126246?v=4", "events_url": "https://api.github.com/users/ngoldbaum/events{/privacy}", "followers_url": "https://api.github.com/users/ngoldbaum/followers", "following_url": "https://api.github.com/users/ngoldbaum/following{/other_user}", "gists_url": "https://api.github.com/users/ngoldbaum/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ngoldbaum", "id": 3126246, "login": "ngoldbaum", "node_id": "MDQ6VXNlcjMxMjYyNDY=", "organizations_url": "https://api.github.com/users/ngoldbaum/orgs", "received_events_url": "https://api.github.com/users/ngoldbaum/received_events", "repos_url": "https://api.github.com/users/ngoldbaum/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ngoldbaum/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ngoldbaum/subscriptions", "type": "User", "url": "https://api.github.com/users/ngoldbaum", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4623/reactions" }
https://api.github.com/repos/psf/requests/issues/4623/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4623.diff", "html_url": "https://github.com/psf/requests/pull/4623", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4623.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4623" }
true
[]
https://api.github.com/repos/psf/requests/issues/4622
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4622/labels{/name}
https://api.github.com/repos/psf/requests/issues/4622/comments
https://api.github.com/repos/psf/requests/issues/4622/events
https://github.com/psf/requests/issues/4622
319,722,773
MDU6SXNzdWUzMTk3MjI3NzM=
4,622
.. is not interpreted correctly with redirections
{ "avatar_url": "https://avatars.githubusercontent.com/u/2804645?v=4", "events_url": "https://api.github.com/users/hydrargyrum/events{/privacy}", "followers_url": "https://api.github.com/users/hydrargyrum/followers", "following_url": "https://api.github.com/users/hydrargyrum/following{/other_user}", "gists_url": "https://api.github.com/users/hydrargyrum/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hydrargyrum", "id": 2804645, "login": "hydrargyrum", "node_id": "MDQ6VXNlcjI4MDQ2NDU=", "organizations_url": "https://api.github.com/users/hydrargyrum/orgs", "received_events_url": "https://api.github.com/users/hydrargyrum/received_events", "repos_url": "https://api.github.com/users/hydrargyrum/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hydrargyrum/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hydrargyrum/subscriptions", "type": "User", "url": "https://api.github.com/users/hydrargyrum", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-05-02T21:43:23Z
2021-09-08T02:10:04Z
2018-05-02T23:08:54Z
NONE
resolved
When a site redirects to an URL containing "/../", requests passes it verbatim instead of interpreting it. ## Expected Result requests should remove the ".." component and the previous component, by interpreting the ".." as meaning "parent folder". All real browsers do it. libcurl/curl (and wget) does it too. Test for example https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org%2Ffoo%2F%2E%2E%2Fget ## Actual Result requests fails to interpret it like other HTTP clients do and passes the "/../" verbatim, leading to errors on servers, ranging from 500 errors to 404 errors (as for httpbin). ## Reproduction Steps ```python import requests r = requests.get('https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org%2Ffoo%2F%2E%2E%2Fget') print(r.status_code, r.url) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.15" }, "platform": { "release": "4.15.0-1-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1010008f" }, "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/4622/reactions" }
https://api.github.com/repos/psf/requests/issues/4622/timeline
null
completed
null
null
false
[ "Hi @hydrargyrum, thanks for taking the time to bring this to our attention. This is actually a known issue and duplicate of #2982. We can’t currently resolve it in the Requests 2.x branch for backwards compatibility reasons. We have a todo for Requests 3.0 to resolve it, either by moving to the rfc3986 library for url parsing, or finding another alternative. For consolidation purposes I’m closing this in favor of the original ticket." ]
https://api.github.com/repos/psf/requests/issues/4621
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4621/labels{/name}
https://api.github.com/repos/psf/requests/issues/4621/comments
https://api.github.com/repos/psf/requests/issues/4621/events
https://github.com/psf/requests/pull/4621
319,067,955
MDExOlB1bGxSZXF1ZXN0MTg1MDg4ODE1
4,621
Fix: safe proxies reading
{ "avatar_url": "https://avatars.githubusercontent.com/u/19318157?v=4", "events_url": "https://api.github.com/users/bradsbrown/events{/privacy}", "followers_url": "https://api.github.com/users/bradsbrown/followers", "following_url": "https://api.github.com/users/bradsbrown/following{/other_user}", "gists_url": "https://api.github.com/users/bradsbrown/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bradsbrown", "id": 19318157, "login": "bradsbrown", "node_id": "MDQ6VXNlcjE5MzE4MTU3", "organizations_url": "https://api.github.com/users/bradsbrown/orgs", "received_events_url": "https://api.github.com/users/bradsbrown/received_events", "repos_url": "https://api.github.com/users/bradsbrown/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bradsbrown/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bradsbrown/subscriptions", "type": "User", "url": "https://api.github.com/users/bradsbrown", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-04-30T23:19:08Z
2022-02-26T04:00:40Z
2021-11-28T03:27:30Z
NONE
resolved
Set up `proxies` safely for the `.setdefault()` call a few lines below by coercing it into a dict if passed in as `None`, and adjust the one line that was potentially expecting a `None`.
{ "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": 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/4621/reactions" }
https://api.github.com/repos/psf/requests/issues/4621/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4621.diff", "html_url": "https://github.com/psf/requests/pull/4621", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4621.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4621" }
true
[ "Hi @bradsbrown it sounds like you ran into a bug that you're trying to fix here. Could you share the code you used to encounter it and what the stack trace was?", "@sigmavirus24 Absolutely! Meant to add this last night, and got pulled away. Here's what triggered this for me - I was running some work that relies on `python-jenkins`, and that library calls out to `requests` with a call to `merge_environment_settings` that hard-codes `None` as the value for `proxies`. Here's what I kept running into on that call:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/bin/jenkins-jobs\", line 11, in <module>\r\n sys.exit(main())\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/cli/entry.py\", line 146, in main\r\n jjb.execute()\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/cli/entry.py\", line 140, in execute\r\n ext.obj.execute(self.options, self.jjb_config)\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/cli/subcommand/update.py\", line 148, in execute\r\n n = builder.delete_old_managed(keep=keep_jobs)\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/builder.py\", line 187, in delete_old_managed\r\n jobs = self.get_jobs()\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/builder.py\", line 168, in get_jobs\r\n return self.jobs\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/builder.py\", line 96, in jobs\r\n self._jobs = self.jenkins.get_all_jobs()\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py\", line 951, in get_all_jobs\r\n jobs = [(0, \"\", self.get_info(query=JOBS_QUERY)['jobs'])]\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py\", line 694, in get_info\r\n requests.Request('GET', self._build_url(INFO))\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py\", line 533, in jenkins_open\r\n return self.jenkins_request(req, add_crumb, resolve_auth).text\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py\", line 549, in jenkins_request\r\n self.maybe_add_crumb(req)\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py\", line 347, in maybe_add_crumb\r\n 'GET', self._build_url(CRUMB_URL)), add_crumb=False)\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py\", line 533, in jenkins_open\r\n return self.jenkins_request(req, add_crumb, resolve_auth).text\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py\", line 552, in jenkins_request\r\n self._request(req))\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py\", line 524, in _request\r\n r.url, None, None, self._session.verify, None)\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py\", line 278, in merge_environment_settings\r\n **kwargs)\r\n File \"/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/requests/sessions.py\", line 674, in merge_environment_settings\r\n proxies.setdefault(k, v)\r\nAttributeError: 'NoneType' object has no attribute 'setdefault'\r\nBuild step 'Virtualenv Builder' marked build as failure\r\n```\r\n\r\nI did some digging into the `requests.sessions` code and found that we assume `proxies` is a dict [right here](https://github.com/requests/requests/blob/master/requests/sessions.py#L679) despite treating as though a value of `None` is possible [just a few lines above](https://github.com/requests/requests/blob/master/requests/sessions.py#L676).\r\n\r\nThis PR is an attempt to safeguard against that error by coercing a `proxies=None` into an empty dict, which looks to play nicely with the usage of `proxies` throughout the rest of the function.\r\n\r\nSide note: I'm also working on a PR to `python-jenkins` to pass in an empty dict instead of `None`, so that hard-coding a value at least uses one that is more reasonable.", "Hey @bradsbrown, to follow up, we probably don't want to unconditionally set proxies to a dict because it triggers extra code paths we don't want in the common case. Specifically in `merge_settings` and `should_bypass_proxies`.\r\n\r\nThat said, I do agree there is a gap here. We have a more elegant fix for this in the 3.0.0 branch (#2839), but that is slow moving at the moment. If we want to solve for the current issue, we may want to set `proxy` to `{}` just before the loop, but only if `env_proxies` is set and `proxy` is None. I'd like @sigmavirus24 to chime in before we make any changes, but that's the only solution I see at the moment that won't create a cascade of possibly breaking changes elsewhere.", "Resolving this as we have the longer term fix available in the next major version. I think it’s unlikely we’ll introduce the partial fix in the short term due to the side effects." ]
https://api.github.com/repos/psf/requests/issues/4620
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4620/labels{/name}
https://api.github.com/repos/psf/requests/issues/4620/comments
https://api.github.com/repos/psf/requests/issues/4620/events
https://github.com/psf/requests/pull/4620
318,734,874
MDExOlB1bGxSZXF1ZXN0MTg0ODQ1NDcx
4,620
fix windows builds
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2018-04-29T17:38:03Z
2021-09-03T00:10:59Z
2018-04-29T23:56:10Z
MEMBER
resolved
Appveyor isn't able to replace the running executable. We'll run it from inside the interpreter to fix build issues. This is lifted from the fix over on urllib3/urllib3#1369 which was configured to run the same way.
{ "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/4620/reactions" }
https://api.github.com/repos/psf/requests/issues/4620/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4620.diff", "html_url": "https://github.com/psf/requests/pull/4620", "merged_at": "2018-04-29T23:56:10Z", "patch_url": "https://github.com/psf/requests/pull/4620.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4620" }
true
[]
https://api.github.com/repos/psf/requests/issues/4619
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4619/labels{/name}
https://api.github.com/repos/psf/requests/issues/4619/comments
https://api.github.com/repos/psf/requests/issues/4619/events
https://github.com/psf/requests/issues/4619
318,561,976
MDU6SXNzdWUzMTg1NjE5NzY=
4,619
request to https server fails with bad handshake
{ "avatar_url": "https://avatars.githubusercontent.com/u/874719?v=4", "events_url": "https://api.github.com/users/jacob-keller/events{/privacy}", "followers_url": "https://api.github.com/users/jacob-keller/followers", "following_url": "https://api.github.com/users/jacob-keller/following{/other_user}", "gists_url": "https://api.github.com/users/jacob-keller/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jacob-keller", "id": 874719, "login": "jacob-keller", "node_id": "MDQ6VXNlcjg3NDcxOQ==", "organizations_url": "https://api.github.com/users/jacob-keller/orgs", "received_events_url": "https://api.github.com/users/jacob-keller/received_events", "repos_url": "https://api.github.com/users/jacob-keller/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jacob-keller/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jacob-keller/subscriptions", "type": "User", "url": "https://api.github.com/users/jacob-keller", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-27T21:59:52Z
2021-09-08T02:10:06Z
2018-04-29T17:45:17Z
NONE
resolved
Summary. I am attempting to connect to an https server (unfortunately private internal server) which request.get() fails to connect, but curl succeeds. Specifically, I'm using gertty and attempting to connect to an internal gerrit server. ## Expected Result python requests library succeeds to connect and allows me to work with the server. ## Actual Result the connection fails with: requests.exceptions.SSLError: HTTPSConnectionPool(host='<gerrit server>', port=443): Max retries exceeded with url: /gerrit/a/config/server/version (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert handshake failure')],)",),)) ## Reproduction Steps ```python import requests requests.get("gerrit-server") ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.0.2" }, "idna": { "version": "" }, "implementation": { "name": "CPython", "version": "2.7.14" }, "platform": { "release": "4.15.15-300.fc27.x86_64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010006f", "version": "17.2.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1010008f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ``` At first, I thought this was because the certificate was invalid, but I tried using curl, and it succeeded (well, ok it failed with unauthorized, since I haven't provided login credentials yet, but it did succeed the TLS handshake). I used wireshark to compare the client hello message with the one from curl, and I found that the only major difference was that the successful curl request included more cipher suites, and the server appears to want to select one of those, so when the requests base client hello message is sent, it gets rejected. Specifically, the server wants to use TLS_RSA_WITH_3DES_EDE_CBC_SHA, which is supported by curl, but not by the requests connection. Any idea what is going on here, or whether there's a way to work around this issue in gertty? I am unable to use gertty with my internal server unless this is fixed.
{ "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/4619/reactions" }
https://api.github.com/repos/psf/requests/issues/4619/timeline
null
completed
null
null
false
[ "I *believe* this issue is very similar to an issue in scrapy: https://github.com/scrapy/scrapy/issues/2717 as that was what led me down the path of checking the cipher suite to see if it was sending the same values.", "Hi @jacob-keller, Requests no longer supports 3DES out of the box because of the known security vulnerabilities with it. There are several issues in the closed section (most notable #3774) describing how to work around this if you must. There's also a [blog post](https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/) one of the maintainers wrote with more detailed information.\r\n\r\nI would suggest talking with whomever is in charge of your infrastructure about updating the server, otherwise, the above solution will work." ]
https://api.github.com/repos/psf/requests/issues/4618
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4618/labels{/name}
https://api.github.com/repos/psf/requests/issues/4618/comments
https://api.github.com/repos/psf/requests/issues/4618/events
https://github.com/psf/requests/pull/4618
318,551,543
MDExOlB1bGxSZXF1ZXN0MTg0NzI5MjAy
4,618
Use multi-line import for __version__
{ "avatar_url": "https://avatars.githubusercontent.com/u/1330770?v=4", "events_url": "https://api.github.com/users/Stevoisiak/events{/privacy}", "followers_url": "https://api.github.com/users/Stevoisiak/followers", "following_url": "https://api.github.com/users/Stevoisiak/following{/other_user}", "gists_url": "https://api.github.com/users/Stevoisiak/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Stevoisiak", "id": 1330770, "login": "Stevoisiak", "node_id": "MDQ6VXNlcjEzMzA3NzA=", "organizations_url": "https://api.github.com/users/Stevoisiak/orgs", "received_events_url": "https://api.github.com/users/Stevoisiak/received_events", "repos_url": "https://api.github.com/users/Stevoisiak/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Stevoisiak/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Stevoisiak/subscriptions", "type": "User", "url": "https://api.github.com/users/Stevoisiak", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-04-27T21:12:55Z
2021-09-02T00:07:43Z
2018-04-27T21:57:53Z
CONTRIBUTOR
resolved
{ "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/4618/reactions" }
https://api.github.com/repos/psf/requests/issues/4618/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4618.diff", "html_url": "https://github.com/psf/requests/pull/4618", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4618.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4618" }
true
[ "Hi there @Stevoisiak ! Thanks for sending this PR along. We don’t accept stylistic changes, unfortunately as this project has its own style guide that we haven’t had a chance to document. ", "@sigmavirus24 Should single-line imports over 100 characters be left alone as well?\r\n\r\nhttps://github.com/requests/requests/blob/943a5c8e89db1758ae24adbbedacb3b05c32df4a/requests/compat.py#L58-L59", "@Stevoisiak you can find the documentation on Kenneth Reitz’s code style [here]http://docs.python-requests.org/en/master/dev/contributing/#kenneth-reitz-s-code-style). We do allow lines over 100 and typically will not adjust the code base with linter changes unless there’s something significantly abnormal." ]
https://api.github.com/repos/psf/requests/issues/4617
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4617/labels{/name}
https://api.github.com/repos/psf/requests/issues/4617/comments
https://api.github.com/repos/psf/requests/issues/4617/events
https://github.com/psf/requests/issues/4617
318,548,831
MDU6SXNzdWUzMTg1NDg4MzE=
4,617
AppVeyor builds failing on master
{ "avatar_url": "https://avatars.githubusercontent.com/u/1330770?v=4", "events_url": "https://api.github.com/users/Stevoisiak/events{/privacy}", "followers_url": "https://api.github.com/users/Stevoisiak/followers", "following_url": "https://api.github.com/users/Stevoisiak/following{/other_user}", "gists_url": "https://api.github.com/users/Stevoisiak/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Stevoisiak", "id": 1330770, "login": "Stevoisiak", "node_id": "MDQ6VXNlcjEzMzA3NzA=", "organizations_url": "https://api.github.com/users/Stevoisiak/orgs", "received_events_url": "https://api.github.com/users/Stevoisiak/received_events", "repos_url": "https://api.github.com/users/Stevoisiak/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Stevoisiak/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Stevoisiak/subscriptions", "type": "User", "url": "https://api.github.com/users/Stevoisiak", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-04-27T21:02:18Z
2021-09-08T02:10:04Z
2018-04-30T20:02:52Z
CONTRIBUTOR
resolved
For the past month, all pull requests to `master` have been [failing to build on AppVeyor](https://ci.appveyor.com/project/kennethreitz/requests/history). From what I can tell, the build [started failing sometime around March 8th](https://ci.appveyor.com/project/kennethreitz/requests/build/1.0.383). Commit https://github.com/requests/requests/commit/8f3f022c54db7c8348c84c079dfe7f7c354f1062 may have fixed the issue in the `3.0` branch, but the fix does not seem to have been merged to `master`. ## Expected Result Pull requests should report a successful build. ## Actual Result All pull requests report a build status of failure. ## Reproduction Steps 1. Submit a pull request to `master`. 2. Wait for AppVeyor to finish building 3. [Check the build status](https://github.com/requests/requests/pull/4616).
{ "avatar_url": "https://avatars.githubusercontent.com/u/1330770?v=4", "events_url": "https://api.github.com/users/Stevoisiak/events{/privacy}", "followers_url": "https://api.github.com/users/Stevoisiak/followers", "following_url": "https://api.github.com/users/Stevoisiak/following{/other_user}", "gists_url": "https://api.github.com/users/Stevoisiak/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Stevoisiak", "id": 1330770, "login": "Stevoisiak", "node_id": "MDQ6VXNlcjEzMzA3NzA=", "organizations_url": "https://api.github.com/users/Stevoisiak/orgs", "received_events_url": "https://api.github.com/users/Stevoisiak/received_events", "repos_url": "https://api.github.com/users/Stevoisiak/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Stevoisiak/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Stevoisiak/subscriptions", "type": "User", "url": "https://api.github.com/users/Stevoisiak", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4617/reactions" }
https://api.github.com/repos/psf/requests/issues/4617/timeline
null
completed
null
null
false
[ "Hi @Stevoisiak, thanks for reporting this. We have a solution to address this in #4620.", "@nateprewitt This seems to have fixed Appveyor, but now it looks like [Travis CI builds](https://github.com/requests/requests/pull/4616) may be failing.", "@Stevoisiak, yes, we're aware. This is an issue with the recent release of Flask 1.0.1 which broke some pieces of the testing infrastructure due to external dependencies. It's currently being tracked in requests/httpbin#442.", "@nateprewitt Thank you for the update. Closing this as resolved by #4620." ]
https://api.github.com/repos/psf/requests/issues/4616
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4616/labels{/name}
https://api.github.com/repos/psf/requests/issues/4616/comments
https://api.github.com/repos/psf/requests/issues/4616/events
https://github.com/psf/requests/pull/4616
318,460,228
MDExOlB1bGxSZXF1ZXN0MTg0NjYwNTA5
4,616
Add module docstring to __version__.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/1330770?v=4", "events_url": "https://api.github.com/users/Stevoisiak/events{/privacy}", "followers_url": "https://api.github.com/users/Stevoisiak/followers", "following_url": "https://api.github.com/users/Stevoisiak/following{/other_user}", "gists_url": "https://api.github.com/users/Stevoisiak/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Stevoisiak", "id": 1330770, "login": "Stevoisiak", "node_id": "MDQ6VXNlcjEzMzA3NzA=", "organizations_url": "https://api.github.com/users/Stevoisiak/orgs", "received_events_url": "https://api.github.com/users/Stevoisiak/received_events", "repos_url": "https://api.github.com/users/Stevoisiak/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Stevoisiak/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Stevoisiak/subscriptions", "type": "User", "url": "https://api.github.com/users/Stevoisiak", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-27T15:48:46Z
2021-09-02T00:07:42Z
2018-05-23T19:07:08Z
CONTRIBUTOR
resolved
Adds a docstring to `__version__.py`.
{ "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/4616/reactions" }
https://api.github.com/repos/psf/requests/issues/4616/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4616.diff", "html_url": "https://github.com/psf/requests/pull/4616", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4616.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4616" }
true
[ "# [Codecov](https://codecov.io/gh/requests/requests/pull/4616?src=pr&el=h1) Report\n> Merging [#4616](https://codecov.io/gh/requests/requests/pull/4616?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/fe8290b3d0ca21dd8ae5471a59a8bf13d3dcb31e?src=pr&el=desc) will **decrease** coverage by `0.04%`.\n> The diff coverage is `0%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4616/graphs/tree.svg?width=650&height=150&src=pr&token=mZGswIiXLa)](https://codecov.io/gh/requests/requests/pull/4616?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4616 +/- ##\n==========================================\n- Coverage 66.62% 66.58% -0.05% \n==========================================\n Files 15 15 \n Lines 1564 1565 +1 \n==========================================\n Hits 1042 1042 \n- Misses 522 523 +1\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4616?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/\\_\\_version\\_\\_.py](https://codecov.io/gh/requests/requests/pull/4616/diff?src=pr&el=tree#diff-cmVxdWVzdHMvX192ZXJzaW9uX18ucHk=) | `0% <0%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4616?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/4616?src=pr&el=footer). Last update [fe8290b...5d5fb43](https://codecov.io/gh/requests/requests/pull/4616?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "this module is fine as–is, but thank you for you contribution!" ]
https://api.github.com/repos/psf/requests/issues/4615
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4615/labels{/name}
https://api.github.com/repos/psf/requests/issues/4615/comments
https://api.github.com/repos/psf/requests/issues/4615/events
https://github.com/psf/requests/issues/4615
318,345,069
MDU6SXNzdWUzMTgzNDUwNjk=
4,615
problem with parsing: HTTPSConnectionPool
{ "avatar_url": "https://avatars.githubusercontent.com/u/38782539?v=4", "events_url": "https://api.github.com/users/tomasbaviera/events{/privacy}", "followers_url": "https://api.github.com/users/tomasbaviera/followers", "following_url": "https://api.github.com/users/tomasbaviera/following{/other_user}", "gists_url": "https://api.github.com/users/tomasbaviera/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tomasbaviera", "id": 38782539, "login": "tomasbaviera", "node_id": "MDQ6VXNlcjM4NzgyNTM5", "organizations_url": "https://api.github.com/users/tomasbaviera/orgs", "received_events_url": "https://api.github.com/users/tomasbaviera/received_events", "repos_url": "https://api.github.com/users/tomasbaviera/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tomasbaviera/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tomasbaviera/subscriptions", "type": "User", "url": "https://api.github.com/users/tomasbaviera", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2018-04-27T09:46:02Z
2021-09-08T02:10:06Z
2018-04-28T11:21:48Z
NONE
resolved
I am trying to parse several news webpages. I have no problem with them using requests.get, except with one website: www.redaccionmedica.com. ## Expected Result I would expect that requests.get() worked as expected, with no excepction. ## Actual Result However, this is what really happens when I try to get a webpage from that particular site: ``` Traceback (most recent call last): File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn conn.connect() File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connection.py", line 326, in connect ssl_context=context) File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 376, in wrap_socket _context=self) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 747, in __init__ self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 983, in do_handshake self._sslobj.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 628, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/adapters.py", line 440, in send timeout=timeout File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/util/retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.redaccionmedica.com', port=443): Max retries exceeded with url: /noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938 (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)'),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/tomasbaviera/PycharmProjects/Scienceflows/prueba_redaccion_medica.py", line 9, in <module> r = requests.get(url) File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 640, in send history = [resp for resp in gen] if allow_redirects else [] File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 640, in <listcomp> history = [resp for resp in gen] if allow_redirects else [] File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 218, in resolve_redirects **adapter_kwargs File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/adapters.py", line 506, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='www.redaccionmedica.com', port=443): Max retries exceeded with url: /noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938 (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)'),)) Process finished with exit code 1 ``` ## Reproduction Steps The code executed is this one: ```python import requests url = "http://www.redaccionmedica.com/noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938" r = requests.get(url) ``` I have tried also with this other code, but I got the same result: ```python import requests url = "http://www.redaccionmedica.com/noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938" r = requests.get(url, Verify=False) ``` ## System Information $ python -m requests.help ``` /usr/bin/python: No module named requests ``` My python version is 2.18.4, and I work with a Mac OSX. Any help would be appreciated very much. Thanks in advance.
{ "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/4615/reactions" }
https://api.github.com/repos/psf/requests/issues/4615/timeline
null
completed
null
null
false
[ "I'm having trouble reproducing this, what version of python are you using? \r\n\r\n```bash\r\npython -m requests.help\r\n```\r\n\r\n```python\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n }, \r\n \"cryptography\": {\r\n \"version\": \"\"\r\n }, \r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n }, \r\n \"implementation\": {\r\n \"name\": \"CPython\", \r\n \"version\": \"2.7.10\"\r\n }, \r\n \"platform\": {\r\n \"release\": \"17.5.0\", \r\n \"system\": \"Darwin\"\r\n }, \r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\", \r\n \"version\": null\r\n }, \r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n }, \r\n \"system_ssl\": {\r\n \"version\": \"20000000\"\r\n }, \r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n }, \r\n \"using_pyopenssl\": false\r\n}\r\n```\r\n```python\r\n>>> url = \"http://www.redaccionmedica.com/noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938\"\r\n>>> r = requests.get(url)\r\n>>> r\r\n<Response [200]>\r\n>>> r = requests.get(url, verify=False)\r\n/private/tmp/.r/lib/python2.7/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\n>>> r\r\n<Response [200]>\r\n```\r\n\r\nThat's with Python 2.7.10 on MacOS High Sierra.\r\n\r\nPerhaps their web server was temporarily having trouble with SSL.", "I run the command:\r\n```\r\npython -m requests.help\r\n```\r\nAnd this is what I get:\r\n```\r\n/usr/bin/python: No module named requests\r\n```\r\nIt seems a little odds, as I can work with the module in PyCharm.\r\nI work with Python 3.5 on MacOS El Capitan.\r\n", "@tomasbaviera from within PyCharm, try running `import requests.help; requests.help.main()`", "Thanks, @sigmavirus24! This time we got it!\r\nThis is what the system tells us:\r\n\r\n```\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.5.1\"\r\n },\r\n \"platform\": {\r\n \"release\": \"15.5.0\",\r\n \"system\": \"Darwin\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"9081df\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n },\r\n \"using_pyopenssl\": false\r\n}\r\n```\r\n", "Oh dear, `system_ssl` is the important thing here. That looks to be an *incredibly* old version of OpenSSL. You can verify this with `import ssl; print(ssl.OPENSSL_VERSION)`. In short, your OpenSSL library appears to be too old to properly handle the TLS configuration of that server. I'd recommend upgrading from El Capitan (I think for most people the upgrade is free at this point). Alternatively, install `requests[security]` as that will shepherd a new version of OpenSSL onto your system via pyOpenSSL.", "Also, welcome to GitHub @tomasbaviera! :tada: ", "Thank you very much for your clarifying comments, @sigmavirus24!!!\r\n" ]
https://api.github.com/repos/psf/requests/issues/4614
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4614/labels{/name}
https://api.github.com/repos/psf/requests/issues/4614/comments
https://api.github.com/repos/psf/requests/issues/4614/events
https://github.com/psf/requests/issues/4614
318,151,091
MDU6SXNzdWUzMTgxNTEwOTE=
4,614
AttribueError at iter_content
{ "avatar_url": "https://avatars.githubusercontent.com/u/5700057?v=4", "events_url": "https://api.github.com/users/andrewshokhin/events{/privacy}", "followers_url": "https://api.github.com/users/andrewshokhin/followers", "following_url": "https://api.github.com/users/andrewshokhin/following{/other_user}", "gists_url": "https://api.github.com/users/andrewshokhin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/andrewshokhin", "id": 5700057, "login": "andrewshokhin", "node_id": "MDQ6VXNlcjU3MDAwNTc=", "organizations_url": "https://api.github.com/users/andrewshokhin/orgs", "received_events_url": "https://api.github.com/users/andrewshokhin/received_events", "repos_url": "https://api.github.com/users/andrewshokhin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/andrewshokhin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/andrewshokhin/subscriptions", "type": "User", "url": "https://api.github.com/users/andrewshokhin", "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
5
2018-04-26T18:40:59Z
2021-09-08T02:10:03Z
2018-05-05T23:40:39Z
NONE
resolved
I don't know who to blame (requests or urllib3), but though you guys can be interested: ``` Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> requests.get('http://imodules.com/') DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): imodules.com DEBUG:urllib3.connectionpool:http://imodules.com:80 "GET / HTTP/1.1" 301 0 DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): www.imodules.com DEBUG:urllib3.connectionpool:http://www.imodules.com:80 "GET / HTTP/1.1" 302 None Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/requests/sessions.py", line 640, in send history = [resp for resp in gen] if allow_redirects else [] File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/requests/sessions.py", line 640, in <listcomp> history = [resp for resp in gen] if allow_redirects else [] File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/requests/sessions.py", line 218, in resolve_redirects **adapter_kwargs File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/requests/sessions.py", line 658, in send r.content File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/requests/models.py", line 823, in content self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/requests/models.py", line 745, in generate for chunk in self.raw.stream(chunk_size, decode_content=True): File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/urllib3/response.py", line 432, in stream for line in self.read_chunked(amt, decode_content=decode_content): File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/urllib3/response.py", line 598, in read_chunked self._update_chunk_length() File "/Users/ashokhin/.venv/adstxt/lib/python3.6/site-packages/urllib3/response.py", line 540, in _update_chunk_length line = self._fp.fp.readline() AttributeError: 'NoneType' object has no attribute 'readline' ``` $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.4" }, "platform": { "release": "17.5.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020df" }, "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/4614/reactions" }
https://api.github.com/repos/psf/requests/issues/4614/timeline
null
completed
null
null
false
[ "This issue is occurring when the redirects are being followed. Entering `https://www.imodules.com` works fine.", "@colinfike, this occurs when the underlying connection in urllib3 has been closed but the Request objects content field hasn’t been populated correctly.\r\n\r\nYou can find a couple similar issues that were closed due to IDEs or mocking frameworks modifying the object inappropriately. If you’re seeing this around redirects, my gut feeling is this may be related to the `.next` attribute which was added in a recent version. It’s had a few other issues logged against it that haven’t been examined enough yet.", "OK, I'll take a look and see if anything shakes out", "So I investigated this a bit more and while I haven't found the root cause as to why this is happening in requests, urllib3 seems to have been updated recently to fix this bug.\r\n\r\nSeems to be this commit https://github.com/urllib3/urllib3/commit/997280928daf6e440511baf75d60d25d0813d88a#diff-01955f24bc4d0d621454698a584ab854 that fixes the issue. ", "@colinfike, yep, that looks right. I ran a quick test with the master branch of urllib3 and the issue is resolved. This should be addressed in the next minor release of Requests following a urllib3 release. Closing since the issue is resolved. Thanks everyone!" ]
https://api.github.com/repos/psf/requests/issues/4613
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4613/labels{/name}
https://api.github.com/repos/psf/requests/issues/4613/comments
https://api.github.com/repos/psf/requests/issues/4613/events
https://github.com/psf/requests/issues/4613
318,065,875
MDU6SXNzdWUzMTgwNjU4NzU=
4,613
Proxies from environment parsing problem
{ "avatar_url": "https://avatars.githubusercontent.com/u/8102549?v=4", "events_url": "https://api.github.com/users/pbelskiy/events{/privacy}", "followers_url": "https://api.github.com/users/pbelskiy/followers", "following_url": "https://api.github.com/users/pbelskiy/following{/other_user}", "gists_url": "https://api.github.com/users/pbelskiy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pbelskiy", "id": 8102549, "login": "pbelskiy", "node_id": "MDQ6VXNlcjgxMDI1NDk=", "organizations_url": "https://api.github.com/users/pbelskiy/orgs", "received_events_url": "https://api.github.com/users/pbelskiy/received_events", "repos_url": "https://api.github.com/users/pbelskiy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pbelskiy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pbelskiy/subscriptions", "type": "User", "url": "https://api.github.com/users/pbelskiy", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2018-04-26T14:53:13Z
2021-08-31T00:07:02Z
2020-04-27T15:40:50Z
NONE
resolved
Hello, I've faced with a stupid problem, in my Ubuntu 16.04 in `/etc/environment` I wrote http proxy with end with one invisible space char at the end: `http_proxy=http://1.2.3.4:8080 `,and of course I didn't notice it when I just copy past proxies for my machines. And then when I used `requests.get()` I get a strange error: ``` Traceback (most recent call last): File "./t.py", line 5, in <module> x = requests.get("http://test/api") File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 72, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 405, in send conn = self.get_connection(request.url, proxies) File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 303, in get_connection proxy_manager = self.proxy_manager_for(proxy) File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 197, in proxy_manager_for **proxy_kwargs) File "/usr/local/lib/python3.6/site-packages/urllib3/poolmanager.py", line 440, in proxy_from_url return ProxyManager(proxy_url=url, **kw) File "/usr/local/lib/python3.6/site-packages/urllib3/poolmanager.py", line 385, in __init__ proxy = parse_url(proxy_url) File "/usr/local/lib/python3.6/site-packages/urllib3/util/url.py", line 199, in parse_url raise LocationParseError(url) urllib3.exceptions.LocationParseError: Failed to parse: 1.2.3.4:8080 ``` And then I found out that problem with `getproxies()` from `urllib` which used by `requests` for getting proxies. **Maybe we can just `strip()` each proxy string? It will be conveniently.** ## Expected Result {'http': 'http://1.2.3.4:8080'} ## Actual Result {'http': 'http://1.2.3.4:8080 '} I got the string which ends with one space ## Reproduction Steps See above ## System Information ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.2" }, "platform": { "release": "4.4.0-112-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000207f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/8102549?v=4", "events_url": "https://api.github.com/users/pbelskiy/events{/privacy}", "followers_url": "https://api.github.com/users/pbelskiy/followers", "following_url": "https://api.github.com/users/pbelskiy/following{/other_user}", "gists_url": "https://api.github.com/users/pbelskiy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pbelskiy", "id": 8102549, "login": "pbelskiy", "node_id": "MDQ6VXNlcjgxMDI1NDk=", "organizations_url": "https://api.github.com/users/pbelskiy/orgs", "received_events_url": "https://api.github.com/users/pbelskiy/received_events", "repos_url": "https://api.github.com/users/pbelskiy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pbelskiy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pbelskiy/subscriptions", "type": "User", "url": "https://api.github.com/users/pbelskiy", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4613/reactions" }
https://api.github.com/repos/psf/requests/issues/4613/timeline
null
completed
null
null
false
[ "Hi @th3mis, it does look like we could be a bit more tolerant of bad input here. We don't actually do much with the proxies dictionary before sending it, unless we preform a redirect. It might be possible to add some cleaning to what we're passed in the `send` function, but we want to make sure not to modify what users actually intended to send. I feel like leading and trailing whitespace *may* be safe to make assumptions about though.\r\n\r\n@sigmavirus24 any thoughts on this? Would this be better handled at the urllib3 level?", "Sligthly related, I am on Windows and my http_proxy is set as :\r\n`set http_proxy=\"http://xx.xx.xx.xx/\"`\r\n\r\nThe problem is that the quotes are actually retained in the variable name\r\n```\r\n\r\n>>> os.environ['https_proxy']\r\n'\"http://xx.xx.xx.xx:80/\"'\r\n```\r\n\r\nThis confuses requests. Stripping the quotes could be helpful.", "> Sligthly related, I am on Windows and my http_proxy is set as :\r\n> `set http_proxy=\"http://xx.xx.xx.xx/\"`\r\n> \r\n> The problem is that the quotes are actually retained in the variable name\r\n> \r\n> ```\r\n> \r\n> >>> os.environ['https_proxy']\r\n> '\"http://xx.xx.xx.xx:80/\"'\r\n> ```\r\n> \r\n> This confuses requests. Stripping the quotes could be helpful.\r\n\r\nhey man, you perfectly helped to locate my problem!!\r\nrequests kept raising the InvalidURL exception but I just could not locate the error. \r\nbut when I run os.environ['https_proxy'], I found it returned '\"http://xx.xx.xx.xx:80\\rexport\"', then I know this must be THE ERROR I had been looking for..\r\nvery stupid error..thanks a lot man!!", "So as I see strip proxies was merged and this issue should be closed. Thanks. 🥳", "Contrary to what is said, the code to strip whitespace from proxy was not merged. Quoting from the PR : \r\n\r\n> Xander Harris added 2 commits on 4 May 2018\r\n> Xander Harris Add test for proxy url strip and strip proxy urls. #4613 6cb55e2\r\n> Xander Harris Merge branch 'master' into iss4613 08336ad\r\n> @ghost ghost closed this on 4 May 2018\r\n> @ghost ghost deleted the edwardtheharris:iss4613 branch on 4 May 2018 \r\n\r\nThere is no merging into master. It looks like a mistake. You can also checkout the code, you will see that there is no such test as \"test_proxy_strip_spaces()\"\r\n\r\nAlso, quoting from the same PR : \r\n\r\n> I'm not sure this is the right place to do this operation, but it does solve the problem. Or at least it passes the test that I wrote for it.\r\n\r\nI worked on a similar issue, but I spent several days analysing the requests codebase to make sure that all paths where a proxy environment variable is read would go through my proposed change in #5441 . That's why I believe it is a better location to do any adjustment on the proxy setting that the PR #4626 \r\n\r\n" ]
https://api.github.com/repos/psf/requests/issues/4612
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4612/labels{/name}
https://api.github.com/repos/psf/requests/issues/4612/comments
https://api.github.com/repos/psf/requests/issues/4612/events
https://github.com/psf/requests/pull/4612
318,045,302
MDExOlB1bGxSZXF1ZXN0MTg0MzUxNzg3
4,612
update json param's description to avoid confusion
{ "avatar_url": "https://avatars.githubusercontent.com/u/2292121?v=4", "events_url": "https://api.github.com/users/Obeyed/events{/privacy}", "followers_url": "https://api.github.com/users/Obeyed/followers", "following_url": "https://api.github.com/users/Obeyed/following{/other_user}", "gists_url": "https://api.github.com/users/Obeyed/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Obeyed", "id": 2292121, "login": "Obeyed", "node_id": "MDQ6VXNlcjIyOTIxMjE=", "organizations_url": "https://api.github.com/users/Obeyed/orgs", "received_events_url": "https://api.github.com/users/Obeyed/received_events", "repos_url": "https://api.github.com/users/Obeyed/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Obeyed/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Obeyed/subscriptions", "type": "User", "url": "https://api.github.com/users/Obeyed", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2018-04-26T14:05:23Z
2021-09-03T00:11:02Z
2018-04-30T15:00:20Z
CONTRIBUTOR
resolved
- the Request class doesn't accept JSON, but a JSON serializable object
{ "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/4612/reactions" }
https://api.github.com/repos/psf/requests/issues/4612/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4612.diff", "html_url": "https://github.com/psf/requests/pull/4612", "merged_at": "2018-04-30T15:00:20Z", "patch_url": "https://github.com/psf/requests/pull/4612.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4612" }
true
[ "Closing and re-opening to trigger a rebuild on AppVeyor", "# [Codecov](https://codecov.io/gh/requests/requests/pull/4612?src=pr&el=h1) Report\n> Merging [#4612](https://codecov.io/gh/requests/requests/pull/4612?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/2de907ad778de270911acaffe93883f0e2729a4a?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/4612/graphs/tree.svg?token=mZGswIiXLa&src=pr&width=650&height=150)](https://codecov.io/gh/requests/requests/pull/4612?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4612 +/- ##\n=======================================\n Coverage 90.18% 90.18% \n=======================================\n Files 15 15 \n Lines 1548 1548 \n=======================================\n Hits 1396 1396 \n Misses 152 152\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4612?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/api.py](https://codecov.io/gh/requests/requests/pull/4612/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYXBpLnB5) | `81.81% <ø> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4612?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/4612?src=pr&el=footer). Last update [2de907a...1a93b7a](https://codecov.io/gh/requests/requests/pull/4612?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Actually, @Obeyed would you mind rebasing this onto the current master branch?", "Done! :+1: ", "Since we don't need to worry about the tests with this change, I'm going to merge so it doesn't get out of sync again. Thanks again for contributing to Requests, @Obeyed!" ]
https://api.github.com/repos/psf/requests/issues/4611
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4611/labels{/name}
https://api.github.com/repos/psf/requests/issues/4611/comments
https://api.github.com/repos/psf/requests/issues/4611/events
https://github.com/psf/requests/issues/4611
317,683,867
MDU6SXNzdWUzMTc2ODM4Njc=
4,611
Global timeout?
{ "avatar_url": "https://avatars.githubusercontent.com/u/37349562?v=4", "events_url": "https://api.github.com/users/vuiiscci/events{/privacy}", "followers_url": "https://api.github.com/users/vuiiscci/followers", "following_url": "https://api.github.com/users/vuiiscci/following{/other_user}", "gists_url": "https://api.github.com/users/vuiiscci/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vuiiscci", "id": 37349562, "login": "vuiiscci", "node_id": "MDQ6VXNlcjM3MzQ5NTYy", "organizations_url": "https://api.github.com/users/vuiiscci/orgs", "received_events_url": "https://api.github.com/users/vuiiscci/received_events", "repos_url": "https://api.github.com/users/vuiiscci/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vuiiscci/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vuiiscci/subscriptions", "type": "User", "url": "https://api.github.com/users/vuiiscci", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-04-25T15:38:36Z
2021-09-08T02:10:07Z
2018-04-25T22:51:41Z
NONE
resolved
Is there a way to set a global timeout? Googling/stackoverflow resulted in hacky patches. I was wondering if this is a feature 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/4611/reactions" }
https://api.github.com/repos/psf/requests/issues/4611/timeline
null
completed
null
null
false
[ "It is not." ]
https://api.github.com/repos/psf/requests/issues/4610
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4610/labels{/name}
https://api.github.com/repos/psf/requests/issues/4610/comments
https://api.github.com/repos/psf/requests/issues/4610/events
https://github.com/psf/requests/issues/4610
317,649,911
MDU6SXNzdWUzMTc2NDk5MTE=
4,610
HTTPSConnectionPool(host='www.google.com', port=443): Read timed out. (read timeout=None)
{ "avatar_url": "https://avatars.githubusercontent.com/u/939594?v=4", "events_url": "https://api.github.com/users/allmoney/events{/privacy}", "followers_url": "https://api.github.com/users/allmoney/followers", "following_url": "https://api.github.com/users/allmoney/following{/other_user}", "gists_url": "https://api.github.com/users/allmoney/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/allmoney", "id": 939594, "login": "allmoney", "node_id": "MDQ6VXNlcjkzOTU5NA==", "organizations_url": "https://api.github.com/users/allmoney/orgs", "received_events_url": "https://api.github.com/users/allmoney/received_events", "repos_url": "https://api.github.com/users/allmoney/repos", "site_admin": false, "starred_url": "https://api.github.com/users/allmoney/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/allmoney/subscriptions", "type": "User", "url": "https://api.github.com/users/allmoney", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-25T14:20:16Z
2018-11-08T13:59:22Z
2018-04-25T14:31:35Z
NONE
resolved
See this error in Logs. I have no proxy, VPN. Direct Internet. ## Expected Result No errors ## Actual Result Log Details (ERROR) Wed Apr 25 2018 17:13:39 GMT+0300 (RTZ 2 (зима)) Error doing job: Future exception was never retrieved Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request six.raise_from(e, None) File "<string>", line 2, in raise_from File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse response.begin() File "/usr/lib/python3.6/http/client.py", line 297, in begin version, status, reason = self._read_status() File "/usr/lib/python3.6/http/client.py", line 258, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/usr/lib/python3.6/socket.py", line 586, in readinto return self._sock.recv_into(b) File "/usr/lib/python3.6/ssl.py", line 1009, in recv_into return self.read(nbytes, buffer) File "/usr/lib/python3.6/ssl.py", line 871, in read return self._sslobj.read(len, buffer) File "/usr/lib/python3.6/ssl.py", line 631, in read v = self._sslobj.read(len, buffer) TimeoutError: [Errno 110] Operation timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 440, in send timeout=timeout File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/lib/python3.6/site-packages/urllib3/util/retry.py", line 357, in increment raise six.reraise(type(error), error, _stacktrace) File "/usr/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise raise value File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request self._raise_timeout(err=e, url=url, timeout_value=read_timeout) File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 320, in _raise_timeout raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='www.google.com', port=443): Read timed out. (read timeout=None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/google_maps.py", line 67, in _update_info for person in self.service.get_all_people(): File "/usr/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 292, in get_all_people return self._get_data() File "/usr/lib/python3.6/site-packages/cachetools/__init__.py", line 46, in wrapper v = func(*args, **kwargs) File "/usr/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 281, in _get_data response = self._session.get(url, params=payload) File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 521, in get return self.request('GET', url, **kwargs) File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 521, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='www.google.com', port=443): Read timed out. (read timeout=None) ## Reproduction Steps ```python import requests ``` ## System Information Home Assistant 0.67.1
{ "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/4610/reactions" }
https://api.github.com/repos/psf/requests/issues/4610/timeline
null
completed
null
null
false
[ "Hi @allmoney, google isn’t responding in time which is why you’re getting a timeout. If you’re positive you’re not behind a vpn or proxy, I’d suggest following up with HomeAssitant first. There isn’t anything here that suggests a defect in Requests.", "I met the question too, can you tell us how to solve this problem?" ]
https://api.github.com/repos/psf/requests/issues/4609
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4609/labels{/name}
https://api.github.com/repos/psf/requests/issues/4609/comments
https://api.github.com/repos/psf/requests/issues/4609/events
https://github.com/psf/requests/pull/4609
317,159,690
MDExOlB1bGxSZXF1ZXN0MTgzNjg2MTY2
4,609
Fix handling of zero-length files
{ "avatar_url": "https://avatars.githubusercontent.com/u/3186654?v=4", "events_url": "https://api.github.com/users/mschmitzer/events{/privacy}", "followers_url": "https://api.github.com/users/mschmitzer/followers", "following_url": "https://api.github.com/users/mschmitzer/following{/other_user}", "gists_url": "https://api.github.com/users/mschmitzer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mschmitzer", "id": 3186654, "login": "mschmitzer", "node_id": "MDQ6VXNlcjMxODY2NTQ=", "organizations_url": "https://api.github.com/users/mschmitzer/orgs", "received_events_url": "https://api.github.com/users/mschmitzer/received_events", "repos_url": "https://api.github.com/users/mschmitzer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mschmitzer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mschmitzer/subscriptions", "type": "User", "url": "https://api.github.com/users/mschmitzer", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2018-04-24T10:13:17Z
2021-09-03T00:11:04Z
2018-04-24T13:59:07Z
NONE
resolved
This was previously fixed in e7c9bbb96 and broken again in 4c82dbab6fc. Add a comment this time to prevent people from breaking it again.
{ "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/4609/reactions" }
https://api.github.com/repos/psf/requests/issues/4609/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4609.diff", "html_url": "https://github.com/psf/requests/pull/4609", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4609.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4609" }
true
[ "Ok, this actually runs afoul of some tests. Interesting.", "Hi @MarcSchmitzer, we use content-length of 0 internally to represent data of indeterminate size. This is sent using `Transfer-Encoding: chunked`. It's advised you don't provide a Content-Length when using Requests, since it should always be handled internally. As we say in the [docs](http://docs.python-requests.org/en/master/user/quickstart/#custom-headers), we will override the Content-Length header at will.\r\n\r\nIf you MUST pass a custom content length for some reason, I'd suggest using the PreparedRequests workflow. You can modify the headers on the PreparedRequest to be what you'd like and then send it.\r\n\r\nThanks for taking the initiative to try to fix this though. I'm going to close this out since it's something we won't be changing in the near future.", "I guess to clarify, if you've found what you think is an actual bug around zero length files, please feel free to open an issue. A few initial tests suggest everything is handled fine and we send `Content-Length: 0` when it's possible to determine.", "Yes, I do believe this is a bug in requests. I am not setting the content-length header from the outside, but rather providing an empty file object as the request body. Will open an issue.\r\n\r\nThanks for looking at this anyway.", "@MarcSchmitzer, \"empty\" file objects aren't necessarily always empty in Python, which is why we use `Transfer-Encoding: chunked`. This is a valid method for transferring the file to the server.\r\n\r\nIf your server or use case requires that a Content-Length must be passed, modifying the PreparedRequest is likely what you'll need.\r\n\r\nSome other issues for reference before opening a new one:\r\n#4404\r\n#3977", "Ok, thanks again for your responses.\r\n\r\nIf you're interested, the problem is in combination with boto3/s3transfer. You could say it is really their bug, only they're currently vendoring a requests version (2.7.0) that behaves differently and doesn't trigger the bug. I'm only running into it because Debian undoes the vendoring and the requests version on Stretch (2.12) triggers it. Guess I'm going to go talk to the boto3 people.", "That sounds like the boto3 are being explicit in what they're supporting and your linux distribution packager is ignoring that and saying \"Hey this configuration seems to work!\" which means that you're not really getting boto3. I'd be unsurprised if there were odd custom patches attached to your packages that you're getting as well such that requests isn't really requests either." ]
https://api.github.com/repos/psf/requests/issues/4608
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4608/labels{/name}
https://api.github.com/repos/psf/requests/issues/4608/comments
https://api.github.com/repos/psf/requests/issues/4608/events
https://github.com/psf/requests/issues/4608
316,642,895
MDU6SXNzdWUzMTY2NDI4OTU=
4,608
When POST , A dictionary type data will auto urlencode
{ "avatar_url": "https://avatars.githubusercontent.com/u/18510780?v=4", "events_url": "https://api.github.com/users/FuckTheLife/events{/privacy}", "followers_url": "https://api.github.com/users/FuckTheLife/followers", "following_url": "https://api.github.com/users/FuckTheLife/following{/other_user}", "gists_url": "https://api.github.com/users/FuckTheLife/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/FuckTheLife", "id": 18510780, "login": "FuckTheLife", "node_id": "MDQ6VXNlcjE4NTEwNzgw", "organizations_url": "https://api.github.com/users/FuckTheLife/orgs", "received_events_url": "https://api.github.com/users/FuckTheLife/received_events", "repos_url": "https://api.github.com/users/FuckTheLife/repos", "site_admin": false, "starred_url": "https://api.github.com/users/FuckTheLife/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/FuckTheLife/subscriptions", "type": "User", "url": "https://api.github.com/users/FuckTheLife", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-23T02:40:46Z
2021-09-08T02:10:08Z
2018-04-23T06:20:29Z
NONE
resolved
Summary. ## When the POST data is a dictionary type Requests will aoto URLencode it. For example : ``` postdata = { "url" : "https%3A%2f%2fwww.google.com" } ``` ## Actual Result When my post data have URLencoded data what include URL . The actual post data is ``` url=https%253A%252f%252fwww.google.com ``` ## Search source code models.py ```python def _encode_params(data): """Encode parameters in a piece of data. Will successfully encode parameters when passed as a dict or a list of 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary if parameters are supplied as a dict. """ if isinstance(data, (str, bytes)): return data elif hasattr(data, 'read'): return data elif hasattr(data, '__iter__'): result = [] for k, vs in to_key_val_list(data): if isinstance(vs, basestring) or not hasattr(vs, '__iter__'): vs = [vs] for v in vs: if v is not None: result.append( (k.encode('utf-8') if isinstance(k, str) else k, v.encode('utf-8') if isinstance(v, str) else v)) return urlencode(result, doseq=True) else: return data ```
{ "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/4608/reactions" }
https://api.github.com/repos/psf/requests/issues/4608/timeline
null
completed
null
null
false
[ "Hi @FuckTheLife, the default functionality of Requests is to treat dictionaries passed to the `data` param as multi-part form data which will end up urlencoded. This is what you’re seeing here and what we’d expect. I would suggest either passing strings that aren’t pre-escaped or making a string representation of exactly what you want and passing that in place of a dictionary.\r\n\r\nI’m going to close this out since there doesn’t appear to be an issue.", "@nateprewitt `multipart/form-data` only happens when `data` and `files` are present. When a dict is passed to `data` we `application/x-www-form-urlencoded` it. The behaviour is still correct, though." ]
https://api.github.com/repos/psf/requests/issues/4607
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4607/labels{/name}
https://api.github.com/repos/psf/requests/issues/4607/comments
https://api.github.com/repos/psf/requests/issues/4607/events
https://github.com/psf/requests/issues/4607
316,605,856
MDU6SXNzdWUzMTY2MDU4NTY=
4,607
Unable to install tensorflow
{ "avatar_url": "https://avatars.githubusercontent.com/u/23218848?v=4", "events_url": "https://api.github.com/users/dafinest/events{/privacy}", "followers_url": "https://api.github.com/users/dafinest/followers", "following_url": "https://api.github.com/users/dafinest/following{/other_user}", "gists_url": "https://api.github.com/users/dafinest/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dafinest", "id": 23218848, "login": "dafinest", "node_id": "MDQ6VXNlcjIzMjE4ODQ4", "organizations_url": "https://api.github.com/users/dafinest/orgs", "received_events_url": "https://api.github.com/users/dafinest/received_events", "repos_url": "https://api.github.com/users/dafinest/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dafinest/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dafinest/subscriptions", "type": "User", "url": "https://api.github.com/users/dafinest", "user_view_type": "public" }
[ { "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" } ]
closed
true
null
[]
null
4
2018-04-22T19:25:57Z
2021-09-08T02:10:07Z
2018-04-23T17:06:31Z
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/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/4607/reactions" }
https://api.github.com/repos/psf/requests/issues/4607/timeline
null
completed
null
null
false
[ "pip install tensorflow\r\nCollecting tensorflow\r\n Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B1FCB5A160>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/tensorflow/\r\n Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B1FCB5A6D8>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/tensorflow/\r\n Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B1FCB5A438>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/tensorflow/\r\n Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B1FCB5AA90>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/tensorflow/\r\n Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B1FCB5AD30>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/tensorflow/\r\n Could not find a version that satisfies the requirement tensorflow (from versions: )\r\nNo matching distribution found for tensorflow", "Can you share why you've filed this here? It seems that your proxy settings are incorrect.", "thank you for getting back....it seems l had put a proxy in my environment\nthat was hindering me from installing tensorflow\n\n\nOn Sun, Apr 22, 2018 at 12:31 PM, Ian Stapleton Cordasco <\[email protected]> wrote:\n\n> Can you share why you've filed this here? It seems that your proxy\n> settings are incorrect.\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/4607#issuecomment-383406297>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AWJKoCzUjFgrx4Bnlzf2TAbR5ntG-CKeks5trNqOgaJpZM4Te_e1>\n> .\n>\n", "Thanks for the response @dafinest. Since it sounds like this was a configuration issue and is unrelated to Requests, I’m going to close this out." ]
https://api.github.com/repos/psf/requests/issues/4606
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4606/labels{/name}
https://api.github.com/repos/psf/requests/issues/4606/comments
https://api.github.com/repos/psf/requests/issues/4606/events
https://github.com/psf/requests/pull/4606
316,602,922
MDExOlB1bGxSZXF1ZXN0MTgzMjg3Nzc0
4,606
Create requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/38631692?v=4", "events_url": "https://api.github.com/users/nivek444/events{/privacy}", "followers_url": "https://api.github.com/users/nivek444/followers", "following_url": "https://api.github.com/users/nivek444/following{/other_user}", "gists_url": "https://api.github.com/users/nivek444/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nivek444", "id": 38631692, "login": "nivek444", "node_id": "MDQ6VXNlcjM4NjMxNjky", "organizations_url": "https://api.github.com/users/nivek444/orgs", "received_events_url": "https://api.github.com/users/nivek444/received_events", "repos_url": "https://api.github.com/users/nivek444/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nivek444/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nivek444/subscriptions", "type": "User", "url": "https://api.github.com/users/nivek444", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2018-04-22T18:46:28Z
2021-09-03T00:11:04Z
2018-04-22T19:15:35Z
NONE
resolved
asdas
{ "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/4606/reactions" }
https://api.github.com/repos/psf/requests/issues/4606/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4606.diff", "html_url": "https://github.com/psf/requests/pull/4606", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4606.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4606" }
true
[]
https://api.github.com/repos/psf/requests/issues/4605
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4605/labels{/name}
https://api.github.com/repos/psf/requests/issues/4605/comments
https://api.github.com/repos/psf/requests/issues/4605/events
https://github.com/psf/requests/issues/4605
316,560,059
MDU6SXNzdWUzMTY1NjAwNTk=
4,605
Request freezes when doing 'r.text'
{ "avatar_url": "https://avatars.githubusercontent.com/u/8395443?v=4", "events_url": "https://api.github.com/users/PuneetKohli/events{/privacy}", "followers_url": "https://api.github.com/users/PuneetKohli/followers", "following_url": "https://api.github.com/users/PuneetKohli/following{/other_user}", "gists_url": "https://api.github.com/users/PuneetKohli/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/PuneetKohli", "id": 8395443, "login": "PuneetKohli", "node_id": "MDQ6VXNlcjgzOTU0NDM=", "organizations_url": "https://api.github.com/users/PuneetKohli/orgs", "received_events_url": "https://api.github.com/users/PuneetKohli/received_events", "repos_url": "https://api.github.com/users/PuneetKohli/repos", "site_admin": false, "starred_url": "https://api.github.com/users/PuneetKohli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/PuneetKohli/subscriptions", "type": "User", "url": "https://api.github.com/users/PuneetKohli", "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
2018-04-22T08:27:27Z
2021-09-08T02:09:59Z
2018-05-13T13:13:20Z
NONE
resolved
Summary. I am trying to use Requests to access a URL. This URL requires certain headers, and values in the cookies. I am able to access the URL fine using Hurl.it/Postman but when using Requests, my laptop freezes up and all my RAM is eaten when I do r.text, r.json() or r.content ## Expected Result Print out the content of the returned HTML page ## Actual Result Laptop Freezes - all RAM used up, need to shutdown Jupyter notebook ## Reproduction Steps ```python import requests url = "http://www.asinlab.com/php/convertfromasin.php?asin_num=B006OC2ANS,B00HWD2OE8,B00J06HWC4,B00CH87HF4,B00B7ERH04&id_type=UPC&bulk=true&x=false" header = {} cookie = {} header["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" header["Accept-Encoding"] = "gzip, deflate" header["Accept-Language"] = "en-US,en;q=0.9" cookie["PHPSESSID"] = "7265269b431e4d9d9e4edd079f8da21c" cookie["sc_is_visitor_unique"] = "rx11430932.1524382929.F7A1330878D04FF9DF09539FE782C5B9.1.1.1.1.1.1.1.1.1" header["Referer"] = "http://www.asinlab.com/asin-to-upc-bulk-lookup/" header["User-Agent"] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" r = requests.get(url=url, headers=header, cookies=cookie, allow_redirects=False) r.text ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.14" }, "platform": { "release": "17.4.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ef" }, "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/4605/reactions" }
https://api.github.com/repos/psf/requests/issues/4605/timeline
null
completed
null
null
false
[ "```py\r\n>>> r.status_code\r\n200\r\n>>> r.headers\r\n{'Date': 'Sun, 22 Apr 2018 13:04:55 GMT', 'Server': 'Apache', 'X-Powered-By': 'PHP/7.1.14', 'Expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'Cache-Control': 'no-store, no-cache, must-revalidate', 'Pragma': 'no-cache', 'Vary': 'Accept-Encoding,User-Agent', 'Content-Encoding': 'gzip', 'Keep-Alive': 'timeout=5', 'Connection': 'Keep-Alive', 'Transfer-Encoding': 'chunked', 'Content-Type': 'text/html; charset=UTF-8'}\r\n```\r\n\r\nThis indicates to me that it's a very large file that you're attempting to decode in memory. Regardless, `r.text` does not consume all of my memory.\r\n\r\n```py\r\n>>> len(r.content)\r\n2100859\r\n>>> len(r.text)\r\n2100859\r\n```", "Hi!\r\n\r\nThanks for your reply. Is there any suggested solution to this?\r\n\r\nI'm trying to build a real-time application that can fetch the data from the URL and then use BeautifulSoup to scrape the returned HTML for what I need.\r\n\r\nI've let the r.text and r.content sit for almost 10 mins before I inevitably had to kill the process.", "I just noticed you mentioned you were using Jupyter Notebook. Can you try in a regular python shell?", "And testing in Jupyter notebook (v4.4.0) I can't reproduce this with the cod eyou've provided. Without knowing what is happening here, I can't provide a suggested solution.", "How much RAM do you have?", "Hi!\n\nTo be honest I'm not sure what the issue was. I was running it on an 8GB\nMacbook Pro 2015. Ran the same exact code on another 8GB Macbook Pro (2016)\nand it worked fine.\n\n\n\n\n\n‌\n\nOn Sat, May 12, 2018 at 2:24 PM, PokestarFan <[email protected]>\nwrote:\n\n> How much RAM do you have?\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/4605#issuecomment-388577227>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AIAas_ugyiRAGM44Pvq1Fcxp-IqvfHuIks5txzcDgaJpZM4Texra>\n> .\n>\n\n\n\n-- \nThank you,\nPuneet Kohli\n", "Hey @PuneetKohli, since this appears to be localized to a single machine and unreproducible, I'm going close this out. Please feel free to update this issue if you find further information. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/4604
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4604/labels{/name}
https://api.github.com/repos/psf/requests/issues/4604/comments
https://api.github.com/repos/psf/requests/issues/4604/events
https://github.com/psf/requests/issues/4604
316,498,988
MDU6SXNzdWUzMTY0OTg5ODg=
4,604
now we support H2?
{ "avatar_url": "https://avatars.githubusercontent.com/u/16604643?v=4", "events_url": "https://api.github.com/users/kmahyyg/events{/privacy}", "followers_url": "https://api.github.com/users/kmahyyg/followers", "following_url": "https://api.github.com/users/kmahyyg/following{/other_user}", "gists_url": "https://api.github.com/users/kmahyyg/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kmahyyg", "id": 16604643, "login": "kmahyyg", "node_id": "MDQ6VXNlcjE2NjA0NjQz", "organizations_url": "https://api.github.com/users/kmahyyg/orgs", "received_events_url": "https://api.github.com/users/kmahyyg/received_events", "repos_url": "https://api.github.com/users/kmahyyg/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kmahyyg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kmahyyg/subscriptions", "type": "User", "url": "https://api.github.com/users/kmahyyg", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-04-21T15:03:27Z
2021-09-05T00:06:49Z
2018-04-21T15:30:34Z
NONE
resolved
- [X] | I checked #2451 #2082 #2584 According to the issue above, does we support HTTP/2 now?
{ "avatar_url": "https://avatars.githubusercontent.com/u/16604643?v=4", "events_url": "https://api.github.com/users/kmahyyg/events{/privacy}", "followers_url": "https://api.github.com/users/kmahyyg/followers", "following_url": "https://api.github.com/users/kmahyyg/following{/other_user}", "gists_url": "https://api.github.com/users/kmahyyg/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kmahyyg", "id": 16604643, "login": "kmahyyg", "node_id": "MDQ6VXNlcjE2NjA0NjQz", "organizations_url": "https://api.github.com/users/kmahyyg/orgs", "received_events_url": "https://api.github.com/users/kmahyyg/received_events", "repos_url": "https://api.github.com/users/kmahyyg/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kmahyyg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kmahyyg/subscriptions", "type": "User", "url": "https://api.github.com/users/kmahyyg", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4604/reactions" }
https://api.github.com/repos/psf/requests/issues/4604/timeline
null
completed
null
null
false
[ "I urgently hope to support the http2.0 protocol as soon as possible." ]
https://api.github.com/repos/psf/requests/issues/4603
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4603/labels{/name}
https://api.github.com/repos/psf/requests/issues/4603/comments
https://api.github.com/repos/psf/requests/issues/4603/events
https://github.com/psf/requests/pull/4603
316,469,382
MDExOlB1bGxSZXF1ZXN0MTgzMjEwNTUy
4,603
Nicer URL formatting with lists
{ "avatar_url": "https://avatars.githubusercontent.com/u/11632726?v=4", "events_url": "https://api.github.com/users/sayanarijit/events{/privacy}", "followers_url": "https://api.github.com/users/sayanarijit/followers", "following_url": "https://api.github.com/users/sayanarijit/following{/other_user}", "gists_url": "https://api.github.com/users/sayanarijit/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sayanarijit", "id": 11632726, "login": "sayanarijit", "node_id": "MDQ6VXNlcjExNjMyNzI2", "organizations_url": "https://api.github.com/users/sayanarijit/orgs", "received_events_url": "https://api.github.com/users/sayanarijit/received_events", "repos_url": "https://api.github.com/users/sayanarijit/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sayanarijit/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sayanarijit/subscriptions", "type": "User", "url": "https://api.github.com/users/sayanarijit", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-04-21T07:16:59Z
2021-09-03T00:11:04Z
2018-04-21T08:31:20Z
NONE
resolved
# Nicer URL formatting with lists ### Purpose Using `['https://example.com', route1, route2]` as URL parameter as compared to `'https://example.com/{}/{}'.format(route1, route2)` or `'https://example.com/'+route1+'/'+route2` ### Examples ```python import requests slug = 1 r = requests.get(['https://api.jikan.me/anime', slug]) r.url # 'https://api.jikan.me/anime/1' category, item = 'jokes', 'random' r = requests.get(['https://api.chucknorris.io', category, item]) r.url # 'https://api.chucknorris.io/jokes/random' ```
{ "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/4603/reactions" }
https://api.github.com/repos/psf/requests/issues/4603/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4603.diff", "html_url": "https://github.com/psf/requests/pull/4603", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4603.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4603" }
true
[ "Hi @sayanarijit, thanks for the interest in contributing to Requests! Unfortunately, the Requests API is more or less frozen at this point, so I don't believe we'll be able to merge this. It should be easy to accomplish what you're looking for by wrapping the list in a join though, so the additional overhead for users wishing to do this is minimal. Thanks again for putting this out there!" ]
https://api.github.com/repos/psf/requests/issues/4602
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4602/labels{/name}
https://api.github.com/repos/psf/requests/issues/4602/comments
https://api.github.com/repos/psf/requests/issues/4602/events
https://github.com/psf/requests/issues/4602
316,241,870
MDU6SXNzdWUzMTYyNDE4NzA=
4,602
Chunk-encoded request doesn't recognize iter_content generator
{ "avatar_url": "https://avatars.githubusercontent.com/u/38559523?v=4", "events_url": "https://api.github.com/users/fmerkel/events{/privacy}", "followers_url": "https://api.github.com/users/fmerkel/followers", "following_url": "https://api.github.com/users/fmerkel/following{/other_user}", "gists_url": "https://api.github.com/users/fmerkel/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fmerkel", "id": 38559523, "login": "fmerkel", "node_id": "MDQ6VXNlcjM4NTU5NTIz", "organizations_url": "https://api.github.com/users/fmerkel/orgs", "received_events_url": "https://api.github.com/users/fmerkel/received_events", "repos_url": "https://api.github.com/users/fmerkel/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fmerkel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fmerkel/subscriptions", "type": "User", "url": "https://api.github.com/users/fmerkel", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-20T12:07:16Z
2021-09-08T02:10:08Z
2018-04-21T15:07:02Z
NONE
resolved
Passing a generator created by iter_content() as request data raises "TypeError: sendall() argument 1 must be string or buffer, not generator". ## Expected Result The POST request successfully delives the content from the GET request. ## Actual Result A TypeError is raised: ``` Traceback (most recent call last): File "..\test.py", line 7, in <module> PostForward("http://myhost/img/foo.png", "http://myotherhost/convert") File "..\test.py", line 6, in PostForward return requests.post(url=dst, data=data, headers={'Content-Length': length}) File "C:\Python27\lib\site-packages\requests\api.py", line 112, in post return request('post', url, data=data, json=json, **kwargs) File "C:\Python27\lib\site-packages\requests\api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "C:\Python27\lib\site-packages\requests\sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "C:\Python27\lib\site-packages\requests\sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "C:\Python27\lib\site-packages\requests\adapters.py", line 440, in send timeout=timeout File "C:\Python27\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen chunked=chunked) File "C:\Python27\lib\site-packages\urllib3\connectionpool.py", line 357, in _make_request conn.request(method, url, **httplib_request_kw) File "C:\Python27\lib\httplib.py", line 1042, in request self._send_request(method, url, body, headers) File "C:\Python27\lib\httplib.py", line 1082, in _send_request self.endheaders(body) File "C:\Python27\lib\httplib.py", line 1038, in endheaders self._send_output(message_body) File "C:\Python27\lib\httplib.py", line 886, in _send_output self.send(message_body) File "C:\Python27\lib\httplib.py", line 858, in send self.sock.sendall(data) File "C:\Python27\lib\socket.py", line 228, in meth return getattr(self._sock,name)(*args) TypeError: sendall() argument 1 must be string or buffer, not generator ``` ## Reproduction Steps ```python import requests def PostForward(src, dst): with requests.get(url=src, stream=True) as srcResponse: length = srcResponse.headers['Content-Length'] data = srcResponse.iter_content(1024) return requests.post(url=dst, data=data, headers={'Content-Length': length}) PostForward("http://myhost/img/foo.png", "http://myotherhost/convert") ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.14" }, "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 } ```
{ "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/4602/reactions" }
https://api.github.com/repos/psf/requests/issues/4602/timeline
null
completed
null
null
false
[ "P.S.: The error is not raised if the headers param is omitted from the POST request. In that case the request is sent and the server receiving the request responds with 411 Length Required. The server is running Flask 0.12 on mod_wsgi 4.3.0 on Apache 2.4.18.", "`iter_content` returns a generator, which means that we expect to use chunked `Transfer-Encoding`. You cannot specify that in addition to a Content-Length. The correct way to deal with this is to use [the StreamingIterator](https://toolbelt.readthedocs.io/en/latest/uploading-data.html#streaming-data-from-a-generator) from the [toolbelt](/requests/toolbelt)." ]
https://api.github.com/repos/psf/requests/issues/4601
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4601/labels{/name}
https://api.github.com/repos/psf/requests/issues/4601/comments
https://api.github.com/repos/psf/requests/issues/4601/events
https://github.com/psf/requests/issues/4601
316,075,823
MDU6SXNzdWUzMTYwNzU4MjM=
4,601
Requests memory leak
{ "avatar_url": "https://avatars.githubusercontent.com/u/38544207?v=4", "events_url": "https://api.github.com/users/Munroc/events{/privacy}", "followers_url": "https://api.github.com/users/Munroc/followers", "following_url": "https://api.github.com/users/Munroc/following{/other_user}", "gists_url": "https://api.github.com/users/Munroc/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Munroc", "id": 38544207, "login": "Munroc", "node_id": "MDQ6VXNlcjM4NTQ0MjA3", "organizations_url": "https://api.github.com/users/Munroc/orgs", "received_events_url": "https://api.github.com/users/Munroc/received_events", "repos_url": "https://api.github.com/users/Munroc/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Munroc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Munroc/subscriptions", "type": "User", "url": "https://api.github.com/users/Munroc", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 136589914, "name": "Needs Info", "node_id": "MDU6TGFiZWwxMzY1ODk5MTQ=", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20Info" }, { "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" } ]
open
false
null
[]
null
25
2018-04-19T23:33:06Z
2023-09-30T20:53:51Z
null
NONE
null
Summary. ## Expected Result Program running normally ## Actual Result Program consuming all ram till stops working ## Reproduction Steps Pseudocode: ```python def function(): proxies = { 'https': proxy } session = requests.Session() session.headers.update({'User-Agent': 'user - agent'}) try: # login = session.get(url, proxies=proxies) # HERE IS WHERE MEMORY LEAKS except: # return -1 # return 0 ``` ## 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": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020bf" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ```
null
{ "+1": 10, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 10, "url": "https://api.github.com/repos/psf/requests/issues/4601/reactions" }
https://api.github.com/repos/psf/requests/issues/4601/timeline
null
null
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).", "@sigmavirus24 Done", "Hey @munroc, a couple quick questions about your threading implementation since it’s not included in the pseudo code.\r\n\r\n* Are you creating a new session for every thread and what size is the threadpool you're using?\r\n\r\n* What tool are you using to determine where the leak is coming from? Would you mind sharing the results?\r\n\r\n\r\nWe’ve had hints of memory leaks around sessions for a while now, but I’m not sure we’ve found a smoking gun or truly confirmed impact.", "@nateprewitt Hello, yes im creating a new session for every thread. The thread pool is 30. I have tryied with 2 - 200 threads and memory leaks anyway. Im not using a tool, i just did this changes to the function:\r\nput return 0 before login = session.get and no memory leak. if i put return 0 after login = session.get memory starts leaking. If you want i can send you my source code is not too large.", "@Munroc if we have the full code, then I think it would be easier to isolate the actual cause. But based on the code gist that was provided, I think it is very hard to conclude that there is a memory leak.\r\n\r\nAs you have mentioned, if you `return` immediately before calling `session.get`, then only `proxies` and `session` objects will exist in the memory (oversimplified.. but I hope you get the idea :smile:). However, once you call `session.get(url, proxies=proxies)`, the HTML of the `url` will be retrieved and locally saved to the `login` variable. Which means, each `session.get` call will \"look like\" they are leaking memory, but they are actually behaving normally by (memory) linearly increasing by the size of `url` result.\r\n\r\nHowever, let's say that you were using threads and `.join()` them immediately afterwards. In that case, I think we need to look at how your threads were managed - and whether they were closed/cleaned properly.", "@LeoSZN I think in your specific example, you're closing only the last `Process` object after generating multiple `Process` per `urls` elements.\r\n\r\nCould you try daemonizing them using `p.daemon = True` and run them (so that once the main thread terminates, all the spawned child processes dies also)? Otherwise, store the spawned processes in a separate array and make sure to close all of them using a loop.", "@initbar \r\n\r\nDo I need to run `p.daemon = True` in the loop or outside the loop before `p.join()` ? By the way do I still need `p.join()` after applying `p.daemon = True` ?", "_Ook, I was kicked from the new topic to this one, so let me join yours.\r\nMay be this issue provide more information and will step up the issue solving..._\r\n\r\nI'm running Telegram bot and noticed the free memory degradation when running bot for a long time. Firstly, I suspect my code; then I suspect bot and finally I came to requests. :)\r\nI used **len(gc.get_objects())** to identify that problem exists. I located the communication routines, then cleared all bot code and comes to the example that raises the count of gc objects on every iteration.\r\n\r\n## Expected Result\r\n\r\n**len(gc.get_objects())** should give the **same** result on every loop iteration\r\n\r\n## Actual Result\r\n\r\nThe value of **len(gc.get_objects())** increases on every loop iteration.\r\n```\r\nTest N2\r\nGetObjects len: 27959\r\nTest N3\r\nGetObjects len: 27960\r\nTest N4\r\nGetObjects len: 27961\r\nTest N5\r\nGetObjects len: 27962\r\nTest N6\r\nGetObjects len: 27963\r\nTest N7\r\nGetObjects len: 27964\r\n```\r\n\r\n## Reproduction Steps\r\n\r\n```\r\ntoken = \"XXX:XXX\"\r\nchat_id = '111'\r\nproxy = {'https':'socks5h://ZZZ'} #You may need proxy to run this in Russia\r\n\r\nfrom time import sleep\r\nimport gc, requests\r\n\r\ndef garbage_info():\r\n res = \"\"\r\n res += \"\\nGetObjects len: \" + str(len(gc.get_objects()))\r\n return res\r\n\r\ndef tester():\r\n count = 0\r\n while(True):\r\n sleep(1)\r\n count += 1\r\n msg = \"\\nTest N{0}\".format(count) + garbage_info()\r\n print(msg)\r\n\r\n method_url = r'sendMessage'\r\n payload = {'chat_id': str(chat_id), 'text': msg}\r\n\r\n request_url = \"https://api.telegram.org/bot{0}/{1}\".format(token, method_url)\r\n method_name = 'get'\r\n\r\n session = requests.session()\r\n req = requests.Request(\r\n method=method_name.upper(),\r\n url=request_url,\r\n params=payload\r\n )\r\n prep = session.prepare_request(req)\r\n\r\n settings = session.merge_environment_settings(\r\n prep.url, None, None, None, None)\r\n# prep.url, proxy, None, None, None) #Change the line to enable proxy\r\n send_kwargs = {\r\n 'timeout': None,\r\n 'allow_redirects': None,\r\n }\r\n send_kwargs.update(settings)\r\n resp = session.send(prep, **send_kwargs)\r\n\r\n # For more clean output\r\n gc.collect()\r\n\r\ntester()\r\n```\r\n\r\n## System Information\r\n\r\n```\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"2.3.1\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.7\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.6.6\"\r\n },\r\n \"platform\": {\r\n \"release\": \"4.15.0-36-generic\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010009f\",\r\n \"version\": \"17.5.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.19.1\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1010007f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.23\"\r\n },\r\n \"using_pyopenssl\": true\r\n}\r\n```\r\n_The same behaviour I had on Python 3.5.3 on Windows10._", "@LeoSZN \r\n\r\n> @initbar\r\n> \r\n> Do I need to run `p.daemon = True` in the loop or outside the loop before `p.join()` ? By the way do I still need `p.join()` after applying `p.daemon = True` ?\r\n\r\n```python\r\n# ..\r\n for i in urls:\r\n p = Process(target=main, args=(i,))\r\n p.daemon = True # before `.start`\r\n p.start()\r\n# ..\r\n```\r\n\r\nAs a minor note, you *can* still `.join` daemon processes -- but they are near-guaranteed to be killed when their parent process terminates (unless they somehow become unintentionally orphaned; in which case, please let me know! I've love to learn more about it).\r\n\r\nOtherwise, you can store the `Process` objects separately as an array and join in the end:\r\n\r\n```python\r\n# ..\r\nprocesses = [ \r\n Process(target=main, args=(i,))\r\n for i in urls\r\n]\r\n# start the process activity.\r\n```\r\n", "> ## Expected Result\r\n> **len(gc.get_objects())** should give the **same** result on every loop iteration\r\n\r\nThe reason of this behaviour was found in \"requests\" cache mechanism.\r\n\r\nIt works incorrect (suspected): it adds a cache record to every call to Telegram API URL (instead of caching it once). But it does not lead to the memory leak, because cache size is limited to 20 and cache is resetting after reaching this limit and the growing number of objects will be decreased back to initial value.", "Similar issue. Requests eats memory when running in thread. Code to reproduce here:\r\n\r\n```python\r\nimport gc\r\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\r\nimport requests\r\nfrom memory_profiler import profile\r\n\r\ndef run_thread_request(sess, run):\r\n response = sess.get('https://www.google.com')\r\n return\r\n\r\n@profile\r\ndef main():\r\n sess = requests.session()\r\n with ThreadPoolExecutor(max_workers=1) as executor:\r\n print('Starting!')\r\n tasks = {executor.submit(run_thread_request, sess, run):\r\n run for run in range(50)}\r\n for _ in as_completed(tasks):\r\n pass\r\n print('Done!')\r\n return\r\n\r\n@profile\r\ndef calling():\r\n main()\r\n gc.collect()\r\n return\r\n\r\nif __name__ == '__main__':\r\n calling()\r\n```\r\n\r\nIn the code given above I pass a session object around, but if I replace it with just running `requests.get` nothing changes.\r\n\r\nOutput is:\r\n```\r\n➜ thread-test pipenv run python run.py\r\nStarting!\r\nDone!\r\nFilename: run.py\r\n\r\nLine # Mem usage Increment Line Contents\r\n================================================\r\n 10 23.2 MiB 23.2 MiB @profile\r\n 11 def main():\r\n 12 23.2 MiB 0.0 MiB sess = requests.session()\r\n 13 23.2 MiB 0.0 MiB with ThreadPoolExecutor(max_workers=1) as executor:\r\n 14 23.2 MiB 0.0 MiB print('Starting!')\r\n 15 23.4 MiB 0.0 MiB tasks = {executor.submit(run_thread_request, sess, run):\r\n 16 23.4 MiB 0.0 MiB run for run in range(50)}\r\n 17 25.8 MiB 2.4 MiB for _ in as_completed(tasks):\r\n 18 25.8 MiB 0.0 MiB pass\r\n 19 25.8 MiB 0.0 MiB print('Done!')\r\n 20 25.8 MiB 0.0 MiB return\r\n\r\n\r\nFilename: run.py\r\n\r\nLine # Mem usage Increment Line Contents\r\n================================================\r\n 22 23.2 MiB 23.2 MiB @profile\r\n 23 def calling():\r\n 24 25.8 MiB 2.6 MiB main()\r\n 25 25.8 MiB 0.0 MiB gc.collect()\r\n 26 25.8 MiB 0.0 MiB return\r\n```\r\n\r\nAnd Pipfile looks like this:\r\n```\r\n[[source]]\r\nurl = \"https://pypi.python.org/simple\"\r\nverify_ssl = true\r\n\r\n[requires]\r\npython_version = \"3.6\"\r\n\r\n[packages]\r\nrequests = \"==2.21.0\"\r\nmemory-profiler = \"==0.55.0\"\r\n```", "FWIW I am also experiencing a similar memory leak as @jotunskij here is more info\r\n\r\nhttps://github.com/nicolargo/glances/issues/1447", "I also do have same issue where using requests.get with threading actually eats up the memory by around 0.1 - 0.9 per requests and it is not \"clearing\" itself after the requests but saves it.\r\n", "Same here, any work around?", "**Edit**\r\nMy issue looks to be due to using `verify=False` in requests, I've raised a bug under #5215 \r\n\r\n--------\r\n\r\nHaving the same issue. I have a simple script that spawns a thread, this thread calls a function that runs a while loop, this loop queries an API to check a status value and then sleeps for 10 seconds and then the loop will run again until the script is stopped.\r\n\r\nWhen using the `requests.get` function I can see the memory usage slowly creeping up via task manager by watching the spawned process.\r\n\r\nBut if I remove the `requests.get` call from the loop or use `urllib3` directly to make the get request, there is very little if any creep of the memory usage.\r\n\r\nI've watched this over a two hour period in both cases and when using `requests.get` the memory usage is at 1GB+ after two hours where as when using `urllib3` the memory usage is at approx. 20mb after two hours.\r\n\r\nPython 3.7.4 and requests 2.22.0", "It seems Requests is still in beta stage having memory leaks like that. Come on, guys, patch this up! 😉👍", "Any update on this? Simple POST request with a file upload also creates the similar issue of the memory leak. ", "Same for me... leakage while on threadpool execution is on Windows python38 too.\r\nrequests 2.22.0", "Same for me", "Here is my memory leaking issue, anyone can help ? https://stackoverflow.com/questions/59746125/memory-keep-growing-when-using-mutil-thread-download-file", "Call `Session.close()` and `Response.close()` can avoid the memory leak.\r\nAnd ssl will consume more memory so the memory leak will more remarkable when request https urls.\r\n\r\nFirst I make 4 test cases:\r\n\r\n1. requests + ssl (https://)\r\n2. requests + non-ssl (http://)\r\n3. aiohttp + ssl (https://)\r\n4. aiohttp + non-ssl (http://)\r\n\r\nPseudo code:\r\n\r\n```python\r\ndef run(url):\r\n session = requests.session()\r\n response = session.get(url)\r\n\r\nwhile True:\r\n for url in urls: # about 5k urls of public websites\r\n # execute in thread pool, size=10\r\n thread_pool.submit(run, url)\r\n\r\n# in another thread, record memory usage every seconds\r\n```\r\n\r\nMemory usage graph(y-axis: MB, x-axis: time), requests use lots of memory and memory increase very fast, while aiohttp memory usage is stable:\r\n\r\n<img width=\"1101\" alt=\"requests-non-ssl\" src=\"https://user-images.githubusercontent.com/6367792/77444941-6970c700-6e27-11ea-914a-4bebe4d38464.png\">\r\n<img width=\"1101\" alt=\"requests-ssl\" src=\"https://user-images.githubusercontent.com/6367792/77444944-6aa1f400-6e27-11ea-98fc-ed7be7bb8553.png\">\r\n\r\n<img width=\"1101\" alt=\"aiohttp-non-ssl\" src=\"https://user-images.githubusercontent.com/6367792/77444926-65dd4000-6e27-11ea-9844-a1618d1d2f3b.png\">\r\n<img width=\"1101\" alt=\"aiohttp-ssl\" src=\"https://user-images.githubusercontent.com/6367792/77444937-68d83080-6e27-11ea-8c7d-d8935007a00b.png\">\r\n\r\nThen I add `Session.close()` and test again:\r\n\r\n```python\r\ndef run(url):\r\n session = requests.session()\r\n response = session.get(url)\r\n session.close() # close session !!\r\n```\r\n\r\nMemory usage significant decreased, but memory usage still increase over time:\r\n\r\n<img width=\"1101\" alt=\"requests-non-ssl-close-session\" src=\"https://user-images.githubusercontent.com/6367792/77445543-2fec8b80-6e28-11ea-8fb9-380311714b2f.png\">\r\n<img width=\"1101\" alt=\"requests-ssl-close-session\" src=\"https://user-images.githubusercontent.com/6367792/77445555-33801280-6e28-11ea-94e3-3d353d0f3106.png\">\r\n\r\nFinally I add `Response.close()` and test again:\r\n\r\n```python\r\ndef run(url):\r\n session = requests.session()\r\n response = session.get(url)\r\n session.close() # close session !!\r\n response.close() # close response !!\r\n```\r\n\r\nMemory usage decreased again, and not increase over time:\r\n\r\n<img width=\"1101\" alt=\"requests-non-ssl-close-all\" src=\"https://user-images.githubusercontent.com/6367792/77446092-e2bce980-6e28-11ea-906e-621def77f06a.png\">\r\n<img width=\"1101\" alt=\"requests-ssl-close-all\" src=\"https://user-images.githubusercontent.com/6367792/77446103-e51f4380-6e28-11ea-9f26-3ab8aa656513.png\">\r\n\r\nCompare aiohttp and requests shows memory leak is not caused by ssl, it's caused by connection resources not closed. \r\n\r\nUseful scripts:\r\n\r\n```python\r\nclass MemoryReporter:\r\n def __init__(self, name):\r\n self.name = name\r\n self.file = open(f'memoryleak/memory_{name}.txt', 'w')\r\n self.thread = None\r\n\r\n def _get_memory(self):\r\n return psutil.Process().memory_info().rss\r\n\r\n def main(self):\r\n while True:\r\n t = time.time()\r\n v = self._get_memory()\r\n self.file.write(f'{t},{v}\\n')\r\n self.file.flush()\r\n time.sleep(1)\r\n\r\n def start(self):\r\n self.thread = Thread(target=self.main, name=self.name, daemon=True)\r\n self.thread.start()\r\n\r\n\r\ndef plot_memory(name):\r\n filepath = 'memoryleak/memory_{}.txt'.format(name)\r\n df_mem = pd.read_csv(filepath, index_col=0, names=['t', 'v'])\r\n df_mem.index = pd.to_datetime(df_mem.index, unit='s')\r\n df_mem.v = df_mem.v / 1024 / 1024\r\n df_mem.plot(figsize=(16, 8))\r\n```\r\n\r\nSystem Information:\r\n\r\n```\r\n$ python -m requests.help\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.8\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.7.4\"\r\n },\r\n \"platform\": {\r\n \"release\": \"18.0.0\",\r\n \"system\": \"Darwin\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.22.0\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1010104f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.25.6\"\r\n },\r\n \"using_pyopenssl\": false\r\n}\r\n```", "SSL leak problem is packaged OpenSSL <= 3.7.4 on Windows and OSX, its not releasing the memory from the context properly\r\n\r\nhttps://github.com/VeNoMouS/cloudscraper/issues/143#issuecomment-613092377\r\n", "I have the same problem. It appears only when I use `proxies` argument.\r\n\r\n```\r\n{'chardet': {'version': None},\r\n 'charset_normalizer': {'version': '3.0.1'},\r\n 'cryptography': {'version': ''},\r\n 'idna': {'version': '3.4'},\r\n 'implementation': {'name': 'CPython', 'version': '3.10.9'},\r\n 'platform': {'release': '5.4.161-26.3', 'system': 'Linux'},\r\n 'pyOpenSSL': {'openssl_version': '', 'version': None},\r\n 'requests': {'version': '2.28.1'},\r\n 'system_ssl': {'version': '1010113f'},\r\n 'urllib3': {'version': '1.26.13'},\r\n 'using_charset_normalizer': True,\r\n 'using_pyopenssl': False}\r\n```", "Same happens with requests 2.27.1 and urllib3 1.26.13\r\nif it helps tracemalloc shows increments:\r\nstats top 10 every 500:\r\nrequests/utils.py:353: size=4600 B, count=60, average=77 B\r\ndiffs top 10 every 500:\r\nurllib3/_collections.py:153: size=1344 B (+168 B), count=6 (+1), average=224 B\r\nrequests/utils.py:822: size=840 B (+168 B), count=5 (+1), average=168 B\r\n", "Ok, so this is, by the looks of it still an issue.\r\nUsing `requests.Session()` to make requests to an `https` url leads to constantly increasing memory usage and ultimately an OOM condition and a crash. The requests are being made using `proxies` to some proxy\r\n\r\nHere's a shot of the monotonously increasing mem usage : \r\n\r\n![image](https://github.com/psf/requests/assets/4791195/96424a2c-df3c-40ad-a053-a81691ed7567)\r\n\r\nThis is from a production system running (in a docker container): \r\n\r\n```bash\r\nroot@docker-host-01:~/uship-price-optimizer# docker exec -it uship-price-optimizer python -m requests.help\r\n{\r\n \"chardet\": {\r\n \"version\": null\r\n },\r\n \"charset_normalizer\": {\r\n \"version\": \"3.2.0\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"3.4\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.11.5\"\r\n },\r\n \"platform\": {\r\n \"release\": \"5.19.0-46-generic\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.31.0\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"30000090\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"2.0.5\"\r\n },\r\n \"using_charset_normalizer\": true,\r\n \"using_pyopenssl\": false\r\n}\r\n```\r\n\r\nBut we see the same behavior on Windows:\r\n\r\n```powershell\r\n(venv) PS E:\\src\\uship-price-optimizer\\src> python -m requests.help\r\n{\r\n \"chardet\": {\r\n \"version\": null\r\n },\r\n \"charset_normalizer\": {\r\n \"version\": \"3.2.0\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"3.4\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.11.5\"\r\n },\r\n \"platform\": {\r\n \"release\": \"10\",\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.31.0\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"30000090\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.26.16\"\r\n },\r\n \"using_charset_normalizer\": true,\r\n \"using_pyopenssl\": false\r\n}\r\n(venv) PS E:\\src\\uship-price-optimizer\\src>\r\n```\r\n\r\nAND in WSL2:\r\n\r\n```bash\r\n(venv_linux) teo@jailbreaker-pc:/mnt/e/src/uship-price-optimizer/src$ python -m requests.help\r\n{\r\n \"chardet\": {\r\n \"version\": null\r\n },\r\n \"charset_normalizer\": {\r\n \"version\": \"3.2.0\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"3.4\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.11.5\"\r\n },\r\n \"platform\": {\r\n \"release\": \"5.15.90.1-microsoft-standard-WSL2\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.31.0\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1010106f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"2.0.5\"\r\n },\r\n \"using_charset_normalizer\": true,\r\n \"using_pyopenssl\": false\r\n}\r\n```\r\n\r\nI'm observing a memory increase every time a `requests.Session()` is instantiated, never to be reclaimed. A `Session` that is actually wrapped in a [CloudScraper](https://github.com/venomous/cloudscraper) but there's nothing special done to how the requests and sessions are handled there. And due to using cloudscraper, I can't test the code using only `requests.get()` as opposed to using `requests.Session()`, btw.\r\n\r\nHigher up in this thread there's [this](https://github.com/psf/requests/issues/4601#issuecomment-613097974) comment by @VeNoMouS , but since the issues tracker of his repo was disabled, I can't see what he said there, and neither google nor archive.org has a copy of the comment. But whatever it says, I can see the memory leaking every time a new session is created and later discarded.\r\n\r\nWhile investigating what's going on I stumbled on this [original Python issue](https://bugs.python.org/issue37702), migrated to GitHub [here](https://github.com/python/cpython/issues/81883), and seems to imply that this is a Windows only problem but that does not seem to be the case. Both are closed as resolved, btw.\r\n\r\nThen I went on to [memray](https://github.com/bloomberg/memray) the thing.\r\nHere's the summary view:\r\n\r\n```\r\n(venv_linux) teo@jailbreaker-pc:/mnt/e/src/uship-price-optimizer/src$ python3.11 -m memray tree memray-main.py.pydantic_2.bin\r\n\r\nAllocation metadata\r\n-------------------\r\nCommand line arguments: '/mnt/e/src/uship-price-optimizer/venv_linux/bin/memray run main.py'\r\nPeak memory size: 132.543MB\r\nNumber of allocations: 43997698\r\n\r\nBiggest 10 allocations:\r\n-----------------------\r\n📂 53.567MB (100.00 %) <ROOT>\r\n├── [[8 frames hidden in 4 file(s)]]\r\n│ └── 📂 40.721MB (76.02 %) retry /mnt/e/src/uship-price-optimizer/venv_linux/lib/python3.11/site-packages/backoff/_sync.py:105\r\n│ ├── [[11 frames hidden in 6 file(s)]]\r\n│ │ └── 📄 32.564MB (60.79 %) ssl_wrap_socket /mnt/e/src/uship-price-optimizer/venv_linux/lib/python3.11/site-packages/urllib3/util/ssl_.py:444\r\n│ └── [[8 frames hidden in 5 file(s)]]\r\n│ └── 📄 7.006MB (13.08 %) raw_decode /usr/lib/python3.11/json/decoder.py:353\r\n└── [[3 frames hidden in 2 file(s)]]\r\n └── 📂 12.846MB (23.98 %) _run_code <frozen runpy>:88\r\n ├── [[33 frames hidden in 7 file(s)]]\r\n │ └── 📂 5.503MB (10.27 %) _call_with_frames_removed <frozen importlib._bootstrap>:241\r\n │ ├── [[16 frames hidden in 7 file(s)]]\r\n │ │ └── 📄 4.012MB (7.49 %) validate_core_schema /mnt/e/src/uship-price-optimizer/venv_linux/lib/python3.11/site-packages/pydantic/_internal/_core_utils.py:586\r\n │ └── [[3 frames hidden in 2 file(s)]]\r\n │ └── 📄 1.491MB (2.78 %) create_schema_validator /mnt/e/src/uship-price-optimizer/venv_linux/lib/python3.11/site-packages/pydantic/plugin/_schema_validator.py:34\r\n ├── [[8 frames hidden in 5 file(s)]]\r\n │ └── 📄 3.000MB (5.60 %) __next__ /usr/lib/python3.11/csv.py:119\r\n ├── [[12 frames hidden in 4 file(s)]]\r\n │ └── 📄 1.846MB (3.45 %) _compile_bytecode <frozen importlib._bootstrap_external>:729\r\n └── [[5 frames hidden in 3 file(s)]]\r\n └── 📂 2.496MB (4.66 %) _call_with_frames_removed <frozen importlib._bootstrap>:241\r\n ├── [[30 frames hidden in 7 file(s)]]\r\n │ └── 📄 1.319MB (2.46 %) _compile_bytecode <frozen importlib._bootstrap_external>:729\r\n └── [[22 frames hidden in 5 file(s)]]\r\n └── 📄 1.177MB (2.20 %) _compile_bytecode <frozen importlib._bootstrap_external>:729\r\n```\r\nand the memory stack with `util/ssl_.py`\r\n\r\n![image](https://github.com/psf/requests/assets/4791195/0fe118d5-224e-44cc-86af-bdd1e1263ed0)\r\n\r\nLooking around at the solutions to memory leaks in various systems mentioning and linked to this issue, I changed our code to \"force close\" the sessions using:\r\n\r\n```python\r\n with cloudscraper.create_scraper(...) as session:\r\n session.proxies = proxyconfig.get_proxy()\r\n .\r\n .\r\n .\r\n\r\n```\r\n\r\n`cloudscraper.create_scraper` instantiates a `requests.Session()` essentially.\r\n\r\nfor making the requests I changed it to \r\n\r\n```python\r\n with session.get(url='.......',\r\n # allow_redirects=True,\r\n params={...<params>...},\r\n timeout=5, ) as response:\r\n .\r\n .\r\n .\r\n\r\n```\r\n\r\nThis seems to have improved the situation a bit, as at least now it's not monotonously growing but also has some [slight] reductions\r\n\r\n![image](https://github.com/psf/requests/assets/4791195/1444054b-dcbd-4e88-bb75-af9f719885cd)\r\n\r\nBut this is still not what I think it should be looking like.\r\n\r\nCurrently, we are keeping it under control by setting a memory limit on the container it's running on in productions and we are also passing \r\n\r\n`...--max-requests 750 --max-requests-jitter 50...` to `gunicorn`\r\n\r\nSo, what would you suggest the next logical step to be?\r\n\r\nThanks!\r\n\r\n\r\n" ]
https://api.github.com/repos/psf/requests/issues/4600
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4600/labels{/name}
https://api.github.com/repos/psf/requests/issues/4600/comments
https://api.github.com/repos/psf/requests/issues/4600/events
https://github.com/psf/requests/issues/4600
316,025,674
MDU6SXNzdWUzMTYwMjU2NzQ=
4,600
Using "no_proxy" by default HTTPAdapter
{ "avatar_url": "https://avatars.githubusercontent.com/u/7704597?v=4", "events_url": "https://api.github.com/users/jejefferson/events{/privacy}", "followers_url": "https://api.github.com/users/jejefferson/followers", "following_url": "https://api.github.com/users/jejefferson/following{/other_user}", "gists_url": "https://api.github.com/users/jejefferson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jejefferson", "id": 7704597, "login": "jejefferson", "node_id": "MDQ6VXNlcjc3MDQ1OTc=", "organizations_url": "https://api.github.com/users/jejefferson/orgs", "received_events_url": "https://api.github.com/users/jejefferson/received_events", "repos_url": "https://api.github.com/users/jejefferson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jejefferson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jejefferson/subscriptions", "type": "User", "url": "https://api.github.com/users/jejefferson", "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" }
2
2018-04-19T20:18:37Z
2024-05-20T14:37:07Z
2024-05-20T14:37:07Z
NONE
null
Although feature with "no_proxy" key are not documented yet there is a validation method `(requests.utils.should_bypass_proxies)` for it. Unfortunately method for matching url in "no_proxy" list is not used by default. This is a bug or a feature? ``` s = requests.Session() r = requests.Request(url='http://127.0.0.2').prepare() s.send(r, proxies={ 'http': 'http://127.0.0.1:8090', 'no_proxy': '127.0.0.2', }, ) ``` ## Expected Result Send method will not use proxy due to url in "no_proxy" list. ## Actual Result Send method will still use proxy and ignore "no_proxy". Reproduction steps above. System info: ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.2" }, "platform": { "release": "17.2.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ef" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ``` It's possible declare own Adapter and call method for checking no_proxy like this manner: ``` import requests def select_proxy(url, proxies): """Select a proxy for the url, if applicable. :param url: The url being for the request :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs """ proxies = proxies or {} urlparts = requests.utils.urlparse(url) if urlparts.hostname is None: return proxies.get(urlparts.scheme, proxies.get('all')) proxy = None if requests.utils.should_bypass_proxies(url, proxies.get('no_proxy')): return proxy proxy_keys = [ urlparts.scheme + '://' + urlparts.hostname, urlparts.scheme, 'all://' + urlparts.hostname, 'all', ] for proxy_key in proxy_keys: if proxy_key in proxies: proxy = proxies[proxy_key] break return proxy class NoProxyAdapter(requests.adapters.HTTPAdapter): def get_connection(self, url, proxies=None): """Returns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param url: The URL to connect to. :param proxies: (optional) A Requests-style dictionary of proxies used on this request. :rtype: urllib3.ConnectionPool """ proxy = select_proxy(url, proxies) if proxy and proxy not in proxies.get('no_proxy', []): proxy = requests.adapters.prepend_scheme_if_needed(proxy, 'http') proxy_manager = self.proxy_manager_for(proxy) conn = proxy_manager.connection_from_url(url) else: # Only scheme should be lower case parsed = requests.adapters.urlparse(url) url = parsed.geturl() conn = self.poolmanager.connection_from_url(url) return conn if __name__ == "__main__": s = requests.Session() s.mount('http://', NoProxyAdapter()) r = requests.Request(url='http://127.0.0.2').prepare() s.send( r, proxies={ 'http': 'http://127.0.0.1:8090', 'no_proxy': '127.0.0.2', }, ) ``` This code works correctly for me and use "no_proxy". All difference is this two lines in function select_proxy: ``` if requests.utils.should_bypass_proxies(url, proxies.get('no_proxy')): return proxy ```
{ "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/4600/reactions" }
https://api.github.com/repos/psf/requests/issues/4600/timeline
null
completed
null
null
false
[ "Hey @jejefferson, thanks for opening this issue. I took a quick look and this functionality was mostly implemented in #3865. The original PR added something similar to what you're asking but it was to `rebuild_proxies`, which means it only runs on redirects. Your first request won't hit this, so that likely explains the gap you're seeing.\r\n\r\nI'm not convinced we want to patch this at the adapters level, but if you can put together a failing test that shows this behaviour, we can likely work a solution from there. Let us know if you have any questions. Thanks!", "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/4599
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4599/labels{/name}
https://api.github.com/repos/psf/requests/issues/4599/comments
https://api.github.com/repos/psf/requests/issues/4599/events
https://github.com/psf/requests/issues/4599
315,916,180
MDU6SXNzdWUzMTU5MTYxODA=
4,599
proxies in session not taken into account
{ "avatar_url": "https://avatars.githubusercontent.com/u/15017455?v=4", "events_url": "https://api.github.com/users/navidof/events{/privacy}", "followers_url": "https://api.github.com/users/navidof/followers", "following_url": "https://api.github.com/users/navidof/following{/other_user}", "gists_url": "https://api.github.com/users/navidof/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/navidof", "id": 15017455, "login": "navidof", "node_id": "MDQ6VXNlcjE1MDE3NDU1", "organizations_url": "https://api.github.com/users/navidof/orgs", "received_events_url": "https://api.github.com/users/navidof/received_events", "repos_url": "https://api.github.com/users/navidof/repos", "site_admin": false, "starred_url": "https://api.github.com/users/navidof/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/navidof/subscriptions", "type": "User", "url": "https://api.github.com/users/navidof", "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
3
2018-04-19T14:59:15Z
2021-09-08T02:09:56Z
2018-05-20T19:16:31Z
NONE
resolved
When creating a session object, and setting proxies information, the proxy information is not used in subsequent requests: SESS = requests.Session() SESS.auth = (USER, PWD) SESS.verify = False SESS.proxies = {'https': None} ## Expected Result SESS.get(URL + '/' + ENDPOINT) should bypass the proxy and be able to resolve the internal URL. ## Actual Result 502: notresolvable for url But passing the same proxy information to the get works: SESS.get(URL + '/' + ENDPOINT, proxies={'https': None}) works as expected ## Reproduction Steps ```python import requests SESS = requests.Session() SESS.auth = (USER, PWD) SESS.verify = False SESS.proxies = {'https': None} ``` ## System Information requests 2.13.0 python 3.5.2 Fedora 20
{ "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/4599/reactions" }
https://api.github.com/repos/psf/requests/issues/4599/timeline
null
completed
null
null
false
[ "Hi @navidof, before we dig too far into this, can you confirm this is still an issue in 2.18.4 with urllib3 1.22?\r\n\r\nRequests 2.13 is fairly old now and there’s been some proxy work done since then.", "Hey again @navidof, I'm unable to reproduce this with 2.18.4 and since this hasn't seen an update in the last month, I'm going to close it out.", "Hi Nate,\n\nThanks for your time, I didn't know how to test with another request package, anyway it's not possible for my use case to use another version.\nThe workaround is simple, so no worries if it's not fixed in my version.\n\nRegards,\nNavid\n\n----- Mail original -----\nDe: \"Nate Prewitt\" <[email protected]>\nÀ: \"requests/requests\" <[email protected]>\nCc: \"navidof\" <[email protected]>, \"Mention\" <[email protected]>\nEnvoyé: Dimanche 20 Mai 2018 21:17:00\nObjet: Re: [requests/requests] proxies in session not taken into account (#4599)\n\n\n\nHey again @navidof , I'm unable to reproduce this with 2.18.4 and since this hasn't seen an update in the last month, I'm going to close it out. \n\n— \nYou are receiving this because you were mentioned. \nReply to this email directly, view it on GitHub , or mute the thread .\n" ]
https://api.github.com/repos/psf/requests/issues/4598
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4598/labels{/name}
https://api.github.com/repos/psf/requests/issues/4598/comments
https://api.github.com/repos/psf/requests/issues/4598/events
https://github.com/psf/requests/issues/4598
315,910,053
MDU6SXNzdWUzMTU5MTAwNTM=
4,598
Sessk
{ "avatar_url": "https://avatars.githubusercontent.com/u/7704597?v=4", "events_url": "https://api.github.com/users/jejefferson/events{/privacy}", "followers_url": "https://api.github.com/users/jejefferson/followers", "following_url": "https://api.github.com/users/jejefferson/following{/other_user}", "gists_url": "https://api.github.com/users/jejefferson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jejefferson", "id": 7704597, "login": "jejefferson", "node_id": "MDQ6VXNlcjc3MDQ1OTc=", "organizations_url": "https://api.github.com/users/jejefferson/orgs", "received_events_url": "https://api.github.com/users/jejefferson/received_events", "repos_url": "https://api.github.com/users/jejefferson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jejefferson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jejefferson/subscriptions", "type": "User", "url": "https://api.github.com/users/jejefferson", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2018-04-19T14:45:07Z
2021-09-08T02:10:09Z
2018-04-19T16:06:08Z
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/4598/reactions" }
https://api.github.com/repos/psf/requests/issues/4598/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/4597
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4597/labels{/name}
https://api.github.com/repos/psf/requests/issues/4597/comments
https://api.github.com/repos/psf/requests/issues/4597/events
https://github.com/psf/requests/pull/4597
315,729,045
MDExOlB1bGxSZXF1ZXN0MTgyNjY2OTky
4,597
Migrate to new PyPI website
{ "avatar_url": "https://avatars.githubusercontent.com/u/5316833?v=4", "events_url": "https://api.github.com/users/ericwb/events{/privacy}", "followers_url": "https://api.github.com/users/ericwb/followers", "following_url": "https://api.github.com/users/ericwb/following{/other_user}", "gists_url": "https://api.github.com/users/ericwb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ericwb", "id": 5316833, "login": "ericwb", "node_id": "MDQ6VXNlcjUzMTY4MzM=", "organizations_url": "https://api.github.com/users/ericwb/orgs", "received_events_url": "https://api.github.com/users/ericwb/received_events", "repos_url": "https://api.github.com/users/ericwb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ericwb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ericwb/subscriptions", "type": "User", "url": "https://api.github.com/users/ericwb", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-04-19T05:05:55Z
2021-09-03T00:11:05Z
2018-04-19T06:19:25Z
CONTRIBUTOR
resolved
According to [1], the PyPI website of pypi.python.org has changed to https://pypi.org. This patch updates all references to the legacy site. [1] https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.html Signed-off-by: Eric Brown <[email protected]>
{ "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/4597/reactions" }
https://api.github.com/repos/psf/requests/issues/4597/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4597.diff", "html_url": "https://github.com/psf/requests/pull/4597", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4597.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4597" }
true
[ "Hi @ericwb, this is already being addressed in #4596. Thanks for the initiative." ]
https://api.github.com/repos/psf/requests/issues/4596
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4596/labels{/name}
https://api.github.com/repos/psf/requests/issues/4596/comments
https://api.github.com/repos/psf/requests/issues/4596/events
https://github.com/psf/requests/pull/4596
315,715,185
MDExOlB1bGxSZXF1ZXN0MTgyNjU2OTY2
4,596
Update all pypi.python.org URLs to pypi.org
{ "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-04-19T03:28:52Z
2021-09-02T00:07:50Z
2018-04-19T10:41:37Z
CONTRIBUTOR
resolved
For details on the new PyPI, see the blog post: https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.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/4596/reactions" }
https://api.github.com/repos/psf/requests/issues/4596/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4596.diff", "html_url": "https://github.com/psf/requests/pull/4596", "merged_at": "2018-04-19T10:41:37Z", "patch_url": "https://github.com/psf/requests/pull/4596.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4596" }
true
[ "I think we can merge this without AppVeyor passing." ]
https://api.github.com/repos/psf/requests/issues/4595
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4595/labels{/name}
https://api.github.com/repos/psf/requests/issues/4595/comments
https://api.github.com/repos/psf/requests/issues/4595/events
https://github.com/psf/requests/issues/4595
315,335,238
MDU6SXNzdWUzMTUzMzUyMzg=
4,595
OSError / Image.open(BytesIO(r.content))
{ "avatar_url": "https://avatars.githubusercontent.com/u/14147011?v=4", "events_url": "https://api.github.com/users/Liuzhj/events{/privacy}", "followers_url": "https://api.github.com/users/Liuzhj/followers", "following_url": "https://api.github.com/users/Liuzhj/following{/other_user}", "gists_url": "https://api.github.com/users/Liuzhj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Liuzhj", "id": 14147011, "login": "Liuzhj", "node_id": "MDQ6VXNlcjE0MTQ3MDEx", "organizations_url": "https://api.github.com/users/Liuzhj/orgs", "received_events_url": "https://api.github.com/users/Liuzhj/received_events", "repos_url": "https://api.github.com/users/Liuzhj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Liuzhj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Liuzhj/subscriptions", "type": "User", "url": "https://api.github.com/users/Liuzhj", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-04-18T05:24:08Z
2021-09-08T02:10:10Z
2018-04-18T05:54:11Z
NONE
resolved
Summary. ## Expected Result http://docs.python-requests.org/en/latest/user/quickstart/?highlight=binary#binary-response-content ```py from PIL import Image from io import BytesIO i = Image.open(BytesIO(r.content)) ``` ``` Traceback (most recent call last): File "X:/study/test.py", line 7, in <module> i = Image.open(BytesIO(r.content)) File "C:\Program Files\Python35\lib\site-packages\PIL\Image.py", line 2590, in open % (filename if filename else fp)) OSError: cannot identify image file <_io.BytesIO object at 0x0000000003471AF0> ``` python : 3.5.1 OS: Windows 7
{ "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/4595/reactions" }
https://api.github.com/repos/psf/requests/issues/4595/timeline
null
completed
null
null
false
[ "I don't know how to solve it , give me a hand ,Thanks .", "Hi @Liuzhj, this appears to be a request for help rather than a defect report for Requests. We recommend directing usage questions to [StackOverflow](https://stackoverflow.com) for assistance.\r\n\r\nTo help direct your question, it looks like you’re either misusing `image.open` or `r.content` is not an image. Either way the problem seems to lie outside of Requests.", "hi @nateprewitt \r\n\r\nthis [**url**](http://docs.python-requests.org/en/latest/user/quickstart/?highlight=binary#binary-response-content) is official of Requests。\r\n\r\nthis code is copy from official documents, but is can't running \r\n\r\n![image](https://user-images.githubusercontent.com/14147011/38914404-cc7bcdc4-4311-11e8-9217-c7f355ecfdd2.png)\r\n\r\n", "@Liuzhj as I said the value of `r.content` is not an image `pillow` can parse then. Please direct further questions on usage to StackOverflow, thank you!" ]
https://api.github.com/repos/psf/requests/issues/4594
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4594/labels{/name}
https://api.github.com/repos/psf/requests/issues/4594/comments
https://api.github.com/repos/psf/requests/issues/4594/events
https://github.com/psf/requests/issues/4594
315,263,120
MDU6SXNzdWUzMTUyNjMxMjA=
4,594
`Collections.Callable` DeprecationWarning
{ "avatar_url": "https://avatars.githubusercontent.com/u/415926?v=4", "events_url": "https://api.github.com/users/hsolbrig/events{/privacy}", "followers_url": "https://api.github.com/users/hsolbrig/followers", "following_url": "https://api.github.com/users/hsolbrig/following{/other_user}", "gists_url": "https://api.github.com/users/hsolbrig/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hsolbrig", "id": 415926, "login": "hsolbrig", "node_id": "MDQ6VXNlcjQxNTkyNg==", "organizations_url": "https://api.github.com/users/hsolbrig/orgs", "received_events_url": "https://api.github.com/users/hsolbrig/received_events", "repos_url": "https://api.github.com/users/hsolbrig/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hsolbrig/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hsolbrig/subscriptions", "type": "User", "url": "https://api.github.com/users/hsolbrig", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-04-17T22:23:04Z
2021-09-08T02:10:10Z
2018-04-17T22:26:58Z
NONE
resolved
Summary. Python 3.7.0b3 has a new warning: ```text .../python3.7/site-packages/requests/models.py:177: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working if isinstance(hook, collections.Callable): ``` ## Expected Result Need to change this line (and other references) to `if isinstance(hook, collections.abc.Callable):` What you expected. ## Actual Result What happened instead. ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.7.0b3" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1010007f" }, "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/4594/reactions" }
https://api.github.com/repos/psf/requests/issues/4594/timeline
null
completed
null
null
false
[ "Hey @hsolbrig, this is actually a duplicate of #4494 and we have a PR in the queue to address this. Next time please make sure to check issues and pull requests before opening a new one. Thanks for taking the time to bring this to our attention though!" ]
https://api.github.com/repos/psf/requests/issues/4593
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4593/labels{/name}
https://api.github.com/repos/psf/requests/issues/4593/comments
https://api.github.com/repos/psf/requests/issues/4593/events
https://github.com/psf/requests/issues/4593
315,077,015
MDU6SXNzdWUzMTUwNzcwMTU=
4,593
Allow passing a default json encoder/decoder for all requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/639467?v=4", "events_url": "https://api.github.com/users/brunoais/events{/privacy}", "followers_url": "https://api.github.com/users/brunoais/followers", "following_url": "https://api.github.com/users/brunoais/following{/other_user}", "gists_url": "https://api.github.com/users/brunoais/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/brunoais", "id": 639467, "login": "brunoais", "node_id": "MDQ6VXNlcjYzOTQ2Nw==", "organizations_url": "https://api.github.com/users/brunoais/orgs", "received_events_url": "https://api.github.com/users/brunoais/received_events", "repos_url": "https://api.github.com/users/brunoais/repos", "site_admin": false, "starred_url": "https://api.github.com/users/brunoais/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/brunoais/subscriptions", "type": "User", "url": "https://api.github.com/users/brunoais", "user_view_type": "public" }
[ { "color": "fbca04", "default": false, "description": null, "id": 44501249, "name": "Needs BDFL Input", "node_id": "MDU6TGFiZWw0NDUwMTI0OQ==", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20BDFL%20Input" } ]
closed
true
null
[]
null
5
2018-04-17T14:08:48Z
2021-09-08T02:10:10Z
2018-04-18T13:22:13Z
NONE
resolved
## Summary Add a method onto `requests` so a default json decoder and encoder can be given when calling `json.dumps` and `json.loads()` ## Details Unlike #4097, what I ask here is a way of setting such encoder and decoder which is used in all requests and not just only on an individual one. The basic idea is the same except this is meant to be a global setting and not a by-request setting. In my application's situation, it would mean saving many lines of code and it would also mean more abstraction. Such option would allow having this setup in a dependency where the rest of the application knowing a new class have had a way of being encoded/decoded. Would a global setting be justifiable? Or same stance?
{ "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/4593/reactions" }
https://api.github.com/repos/psf/requests/issues/4593/timeline
null
completed
null
null
false
[ "We don't presently provide any configuration of the `json=` parameter. It's rather simply just `.dumps`\r\n\r\nhttps://github.com/requests/requests/blob/b66908e7b647689793e299edc111bf9910e93ad3/requests/models.py#L458\r\n\r\nWe also don't do any creation of a decoder in the `json` method on a Response\r\n\r\nhttps://github.com/requests/requests/blob/b66908e7b647689793e299edc111bf9910e93ad3/requests/models.py#L868\r\n\r\nSo I'm not entirely certain that I'm in favor of this idea. I'm also not entirely against it though. I don't think it's unreasonable, but I'm also conflicted because in my mind, the *right* way would be to have two attributes: 1 for decoding and for 1 encoding. That gets to be a messy and confusing API in all likelihood though.", "This also poses a problem with the ability to pickle a session. Since we try to allow for that, we'd need these objects to be pickleable and I'm unfamiliar with how friendly they behave with pickle.", "This is a possible example, to show the idea:\r\n\r\n**My code:**\r\nmain.py:\r\n\r\n\tclass BasePlusDateEncoder(json.JSONEncoder):\r\n\t\t\tdef default(self, o):\r\n\t\t\t\tif isinstance(o, datetime.datetime):\r\n\t\t\t\t\treturn o.isoformat()\r\n\r\n\t\t\t\treturn super().default(o)\r\n\t\t\t\t\r\n\tif __name__ == '__main__':\r\n\t\trequests.jsonEncoder(BasePlusDateEncoder)\r\n\r\n\t\r\nbackend_requests.py:\r\n\r\n\trequests.post(\"http://api.world/people\",\r\n\t\tjson=personal_data\r\n\t)\r\n\r\n**Your code:**\r\n__init__.py:\r\n\r\n\t_json_encoder = None\r\n\t\r\n\tdef jsonEncoder(new_encoder=None, force_replace=False):\r\n\t\t# Do checks, if necessary\r\n\t\t_json_encoder = new_encoder\r\n\r\n\r\nrequests/requests/models.py:\r\n\t\r\n\tdef prepare_body(self, data, files, json=None):\r\n\t\t#[...]\r\n\t\tbody = complexjson.dumps(json, cls=__init__._json_encoder)\r\n\r\nFrom my checks, such solution is picklable (according to: https://docs.python.org/2.4/lib/node66.html)\r\n\r\nDid I miss anything?", "> Did I miss anything?\r\n\r\nNo, I assumed you were talking about a Session object having its own encoder and decoder. In fact, it seems you were asking for a module global configuration setting. That will never happen. There's no prior art for that, and it's a painful thing for maintainers to have to deal with. You might register one encoder, import a library, and that library will override your setting. That will result in an unending flood of bug reports\r\n\r\n> (according to: https://docs.python.org/2.4/lib/node66.html)\r\n\r\nThose docs are for Python 2.4. We do not support 2.4.", "OK. Makes sense. Thank you." ]
https://api.github.com/repos/psf/requests/issues/4592
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4592/labels{/name}
https://api.github.com/repos/psf/requests/issues/4592/comments
https://api.github.com/repos/psf/requests/issues/4592/events
https://github.com/psf/requests/issues/4592
314,884,513
MDU6SXNzdWUzMTQ4ODQ1MTM=
4,592
Malformed `Set-Cookie` containing CRLF does not cause an error
{ "avatar_url": "https://avatars.githubusercontent.com/u/18148490?v=4", "events_url": "https://api.github.com/users/paultiplady/events{/privacy}", "followers_url": "https://api.github.com/users/paultiplady/followers", "following_url": "https://api.github.com/users/paultiplady/following{/other_user}", "gists_url": "https://api.github.com/users/paultiplady/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/paultiplady", "id": 18148490, "login": "paultiplady", "node_id": "MDQ6VXNlcjE4MTQ4NDkw", "organizations_url": "https://api.github.com/users/paultiplady/orgs", "received_events_url": "https://api.github.com/users/paultiplady/received_events", "repos_url": "https://api.github.com/users/paultiplady/repos", "site_admin": false, "starred_url": "https://api.github.com/users/paultiplady/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/paultiplady/subscriptions", "type": "User", "url": "https://api.github.com/users/paultiplady", "user_view_type": "public" }
[ { "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
7
2018-04-17T02:42:53Z
2024-05-19T19:10:14Z
2024-05-19T19:10:13Z
NONE
null
After receiving a malformed `Set-Cookie` header containing a CRLF, a malformed `Cookie` header is generated (still containing that CRLF). ## Expected Result Per https://github.com/requests/requests/issues/3521, expect an exception to be raised, rather than generating invalid HTTP. ## Actual Result An invalid Cookie header was generated containing a CRLF character. ## Reproduction Steps ... Can't quite figure out a concise repro. Here's the bogus cookie (extracted from the raw HTTP text): ``` ... Set-Cookie: ___utmvbtouVBFmB=gZg XbNOjalT: Lte; path=/; Max-Age=900 ... ``` Gives: ``` Cookie: ___utmvbtouVBFmB=gZg\r\n XbNOjalT: Lte; <other-cookies> ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "1.7.1" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.5.4" }, "platform": { "release": "15.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "100020af", "version": "16.2.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ef" }, "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": 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/4592/reactions" }
https://api.github.com/repos/psf/requests/issues/4592/timeline
null
completed
null
null
false
[ "Hey @paultiplady, thanks for bringing this to our attention. The issue you're referring to is about #3366 which was to prevent users from creating requests with headers that contained newlines. While we do prevent that now, we don't validate headers received from servers.\r\n\r\nPutting together a [quick repro](https://gist.github.com/nateprewitt/44242c7e4b2f7758db3bde995397d231), we actually don't parse multiple header issues in Requests. This one is specifically called out in [RFC 7230 3.2.4](https://tools.ietf.org/html/rfc7230#section-3.2.4) though:\r\n\r\n>A user agent that receives an obs-fold in a response message that is\r\n not within a message/http container MUST replace each received\r\n obs-fold with one or more SP octets prior to interpreting the field\r\n value.\r\n\r\n\r\nWe do seem to mutate a bit by replacing `\\r\\n` with a single `\\n` and replacing multiple spaces with a single but that's still not right. So I think the question now is where should this be handled? Does urllib3 need to be doing more validation on what it's receiving from httplib, or should be take on that burden in Requests?", "I'd raise this issue in urllib3, this could be something we can't handle though without v2 if it's at the httplib level.", "Done, thanks for the steer & quick repro folks.", "👍 Thanks for bringing it to our attention and driving it, @paultiplady. @SethMichaelLarson, let me know if you need anything from our end or want a second pair of eyes.", "After talking the issue over in urllib3, it appears they have handling for the return character on the master branch. I've tried a few times to verify it works in Requests but haven't been able to fix the issue yet. I was able to create a urllib3 test to verify it's working at that level.\r\n\r\nWe need to look into what's happening between us getting the connection object back from urllib3 and when we're creating the cookie.", "Hello @nateprewitt ! :)\r\n\r\nI encounter the bug as well, maybe I can help to fix it with a little help ! I guess the error should be raised at:\r\nhttps://github.com/requests/requests/blob/master/requests/adapters.py#L484 ?\r\n\r\nI tested your repro with the latest version of urllib3 (1.24.1) and requests (2.21.0) and the invalid header is still accepted so I'm unsure urllib3 pushed the fix (for the newline) to the stable version yet, I will check with them !", "This has been opened as an issue on the urllib3 project, so let's focus there." ]
https://api.github.com/repos/psf/requests/issues/4591
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4591/labels{/name}
https://api.github.com/repos/psf/requests/issues/4591/comments
https://api.github.com/repos/psf/requests/issues/4591/events
https://github.com/psf/requests/pull/4591
314,516,317
MDExOlB1bGxSZXF1ZXN0MTgxNzYzNTc5
4,591
Use pyOpenSSL only when ssl doesn't support SNI
{ "avatar_url": "https://avatars.githubusercontent.com/u/199592?v=4", "events_url": "https://api.github.com/users/methane/events{/privacy}", "followers_url": "https://api.github.com/users/methane/followers", "following_url": "https://api.github.com/users/methane/following{/other_user}", "gists_url": "https://api.github.com/users/methane/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/methane", "id": 199592, "login": "methane", "node_id": "MDQ6VXNlcjE5OTU5Mg==", "organizations_url": "https://api.github.com/users/methane/orgs", "received_events_url": "https://api.github.com/users/methane/received_events", "repos_url": "https://api.github.com/users/methane/repos", "site_admin": false, "starred_url": "https://api.github.com/users/methane/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/methane/subscriptions", "type": "User", "url": "https://api.github.com/users/methane", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-16T06:25:06Z
2021-08-28T00:06:23Z
2020-08-18T21:49:52Z
CONTRIBUTOR
resolved
Since recent Python supports SNI, importing pyOpenSSL is avoidable now.
{ "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/4591/reactions" }
https://api.github.com/repos/psf/requests/issues/4591/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4591.diff", "html_url": "https://github.com/psf/requests/pull/4591", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4591.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4591" }
true
[ "I don't believe we only use pyOpenSSL to fix up SNI issues anymore. This needs careful review", "This has already been completed in https://github.com/psf/requests/pull/5443" ]
https://api.github.com/repos/psf/requests/issues/4590
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4590/labels{/name}
https://api.github.com/repos/psf/requests/issues/4590/comments
https://api.github.com/repos/psf/requests/issues/4590/events
https://github.com/psf/requests/issues/4590
314,514,389
MDU6SXNzdWUzMTQ1MTQzODk=
4,590
requests treats urllib3's SSL handshake timeout as ReadTimeout
{ "avatar_url": "https://avatars.githubusercontent.com/u/6823542?v=4", "events_url": "https://api.github.com/users/metheoryt/events{/privacy}", "followers_url": "https://api.github.com/users/metheoryt/followers", "following_url": "https://api.github.com/users/metheoryt/following{/other_user}", "gists_url": "https://api.github.com/users/metheoryt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/metheoryt", "id": 6823542, "login": "metheoryt", "node_id": "MDQ6VXNlcjY4MjM1NDI=", "organizations_url": "https://api.github.com/users/metheoryt/orgs", "received_events_url": "https://api.github.com/users/metheoryt/received_events", "repos_url": "https://api.github.com/users/metheoryt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/metheoryt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/metheoryt/subscriptions", "type": "User", "url": "https://api.github.com/users/metheoryt", "user_view_type": "public" }
[]
open
false
null
[]
null
15
2018-04-16T06:15:33Z
2021-11-29T17:22:25Z
null
NONE
null
## Expected Result When connecting to a remote machine via SSL/TLS, and SSL handshake timeout happens, I expect to have `SSLError` or `ConnectionError` exception. ## Actual Result `requests` raises `ReadTimeout` ## Reproduction Steps I don't know how to reproduce this, but I have a real stacktrace (most recent call first): ``` timeout: _ssl.c:704: The handshake operation timed out File "urllib3/connectionpool.py", line 346, in _make_request self._validate_conn(conn) File "urllib3/connectionpool.py", line 850, in _validate_conn conn.connect() File "urllib3/connection.py", line 326, in connect ssl_context=context) File "urllib3/util/ssl_.py", line 329, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "python3.5/ssl.py", line 385, in wrap_socket _context=self) File "python3.5/ssl.py", line 760, in __init__ self.do_handshake() File "python3.5/ssl.py", line 996, in do_handshake self._sslobj.do_handshake() File "python3.5/ssl.py", line 641, in do_handshake self._sslobj.do_handshake() ReadTimeoutError: HTTPSConnectionPool(host='somehost.com', port=443): Read timed out. (read timeout=5) File "requests/adapters.py", line 440, in send timeout=timeout File "urllib3/connectionpool.py", line 639, in urlopen _stacktrace=sys.exc_info()[2]) File "urllib3/util/retry.py", line 357, in increment raise six.reraise(type(error), error, _stacktrace) File "urllib3/packages/six.py", line 686, in reraise raise value File "urllib3/connectionpool.py", line 601, in urlopen chunked=chunked) File "urllib3/connectionpool.py", line 349, in _make_request self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) File "urllib3/connectionpool.py", line 309, in _raise_timeout raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) ReadTimeout: HTTPSConnectionPool(host='somehost.com', port=443): Read timed out. (read timeout=5) File "wsa/external/soap.py", line 234, in call response = command(**params) File "zeep/client.py", line 45, in __call__ self._op_name, args, kwargs) File "zeep/wsdl/bindings/soap.py", line 113, in send options['address'], envelope, http_headers) File "zeep/transports.py", line 95, in post_xml return self.post(address, message, headers) File "wsa/external/soap.py", line 75, in post return super(NonPersistentTransport, self).post(address, message, headers) File "zeep/transports.py", line 67, in post timeout=self.operation_timeout) File "requests/sessions.py", line 555, in post return self.request('POST', url, data=data, json=json, **kwargs) File "requests/sessions.py", line 508, in request resp = self.send(prep, **send_kwargs) File "raven/breadcrumbs.py", line 297, in send resp = real_send(self, request, *args, **kwargs) File "requests/sessions.py", line 618, in send r = adapter.send(request, **kwargs) File "requests/adapters.py", line 521, in send raise ReadTimeout(e, request=request) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.5.3" }, "platform": { "release": "3.10.0-693.5.2.el7.x86_64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000105f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ``` $ openssl version ``` OpenSSL 1.0.2k-fips 26 Jan 2017 ``` $ cat /etc/redhat-release $ uname -spori ``` OS: CentOS Linux release 7.4.1708 (Core), Linux 3.10.0-693.5.2.el7.x86_64 x86_64 x86_64 GNU/Linux ```
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/4590/reactions" }
https://api.github.com/repos/psf/requests/issues/4590/timeline
null
null
null
null
false
[ "Can you share more details about what makes you think there was a handshake error or other TLS issue that happened here?", "<img width=\"521\" alt=\"screen shot 2018-04-16 at 10 45 03 am\" src=\"https://user-images.githubusercontent.com/9362301/38825981-467624cc-4163-11e8-92fe-5df890e9328e.png\">\r\n\r\ncurl produces a time out error. ", "@gahancorpcfo I replaced original host with `somehost.com`, cause original host produces these errors maybe once a month, so there's no reason to try to reproduce the error with it.\r\n@sigmavirus24 I guess first lines of stacktrace show that problem is hiding somewhere in TLS layer. Code, that raises first exception, is contained in `ssl.c` file, and exception message states **The handshake operation timed out**. Another interesting detail is that the timeout value, passed in exception message (`...(read timeout=5)`) presents connection timeout instead of read timeout. In my particular case, timeouts were equal to 5 and 22 seconds for connection and read respectively.", "Hey @metheoryt, you're right that this does seem to be a misclassification of this particular timeout. If you look at the stacktrace though, you can see this is being done in urllib3, not Requests.\r\n\r\n>File \"urllib3/connectionpool.py\", line 309, in _raise_timeout\r\n raise ReadTimeoutError(self, url, \"Read timed out. (read timeout=%s)\" % timeout_value)\r\n\r\nWe only know what urllib3 is sending to us, so I don't know if we're easily able to do anything here. I'd recommend raising an issue with the [urllib3](https://github.com/shazow/urllib3) project and seeing if this can get clearer handling there.", "@metheoryt so the fact that a we timed out while in an SSL call doesn't inherently mean this is a SSL error that's being hidden. Let's look closely:\r\n\r\n```\r\nReadTimeoutError: HTTPSConnectionPool(host='somehost.com', port=443): Read timed out. (read timeout=5)\r\n```\r\n\r\nWhat this says is that while we were in the process of the handshake, we waited for 5 seconds while waiting for the server to write bytes. We'd already connected to the server (even if we hadn't established a TLS connection). In short, I personally do not see anything wrong here. It may not match what you expect, but it is absolutely correct.", "@sigmavirus24 yes, you're right in some ways, but I think this particular case should be treaten as connect timeout, cause \r\n> Requests that produced this error are [safe to retry](http://docs.python-requests.org/en/master/api/#requests.ConnectTimeout) \r\n\r\nThere's a significant difference between read timeout, when we don't know, does the server begins process of our request or not, and SSL stuff timeout, when we confident in fact that our request hasn't been processed at all. I think there's should be a distinction.", "@metheoryt I don't believe there's a way for urllib3 or requests to produce that distinction. I could be wrong, but I think that any solution would need to take place in the Python standard library since you can see the last portions of that trace are in\r\n\r\n```\r\n File \"python3.5/ssl.py\", line 385, in wrap_socket\r\n _context=self)\r\n File \"python3.5/ssl.py\", line 760, in __init__\r\n self.do_handshake()\r\n File \"python3.5/ssl.py\", line 996, in do_handshake\r\n self._sslobj.do_handshake()\r\n File \"python3.5/ssl.py\", line 641, in do_handshake\r\n self._sslobj.do_handshake()\r\n```", "@sigmavirus24 we're using sentry as exception collector with our app, but I cannot share the original issue because our sentry instance is local. But I can explain stacktrace with screenshots below:\r\n\r\n### how the low-level timeout exception is appeared\r\n![how the low-level timeout exception is appeared](https://user-images.githubusercontent.com/6823542/38982174-fab9a6bc-43e2-11e8-8758-4cf78e5c09ee.png)\r\n\r\n### where it is being handled\r\n![where it is being handled](https://user-images.githubusercontent.com/6823542/38982397-8f983712-43e3-11e8-8c09-deb6e76c51b9.png)\r\n\r\n### how it looks and where it turns to ReadTimeoutError\r\n![how it looks and where it turns to ReadTimeoutError](https://user-images.githubusercontent.com/6823542/38982446-b13b1c90-43e3-11e8-84a1-5c8e53ab207a.png)\r\n", "Now I see clearly, @nateprewitt, you're right, I've posted an issue urllib3/urllib3#1366 with reference to this one", "@metheoryt you've only confirmed exactly what I've been saying. The exception is a `SocketTimeout`, not an `SSLError`. I really don't see why this should be an SSL exception. You haven't provided a convincing argument that this should be represented as an issue with TLS instead of a timeout.", "@sigmavirus24 neither SSLError, nor ReadTimeout, I guess. It should be a ConnectionError, since it represents an error, produced while connecting to remote host, and subject request is safe to retry.", "@metheoryt let's review the sequence of events:\r\n\r\n- urllib3 **successfully** creates a socket connection to the server on port 443\r\n- urllib3 tries to negotiate TLS with the server (also known as the handshake)\r\n- while negotiating TLS, we don't receive any bytes from the server within the read timeout, as that was set on the successfully created socket connection, we hit a timeout exception for reading and re-raise that appropriately\r\n- urllib3 _might_ be able to separately try to catch that **read timeout** during the handshake, and re-raise it as something else, but I'm not certain ConnectionError is the right thing either.", "@sigmavirus24 I'm sorry if I misled you with `ConnectionError`, I meant `ConnectTimeout`.\r\n\r\nI think of this situation as of borderline case between connection timeout and read timeout. Intuition acts as a background for the left part, while technical nature is a background for the right part. \r\n\r\nIndeed, TLS negotiation is a part of connection procedure. At this stage no business data is sent (even headers). There is no logical reason to treat this case as `ReadTimeout`, because `ReadTimeout` by design tell us that the request COULD BE received and processed by server, while `ConnectTimeout` tells that the request WAS NOT received and, therefore, wasn't processed. \r\n\r\nAnother argument for `ConnectTimeout` is that message of this particular `ReadTimeout` contains waiting time for connection but not for response. (the exception sais `(read timeout=5)` while i was having 5 seconds for connection and 22 for response waiting).", "I am seeing this issue as well. If you use a different timeout value for connect timeout and read timeout. For instance if you pass in (10, 1000), you will see a read timeout after 10 seconds even though the connect timeout is 10 seconds. Observed in requests 2.19.1", "I confirm this behavior with 1.26.7 also when using _urllib3_ via _requests_. Passing two different timeouts makes it visible. If the connect timeout is large enough for the TCP connection to be established, but short enough for the TLS handshaking to fail, you get a `ReadTimeout` with the timeout value in its description matching the connection timeout specified, not the read timeout.\r\n\r\nIt's all about the semantic we and _urllib3_ want to associate to the meaning of \"connection\". The TCP or the TLS ?? In any case, `ReadTimeout` should not be raised with connection timeout value in its description, after that connection timeout period expires." ]
https://api.github.com/repos/psf/requests/issues/4589
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4589/labels{/name}
https://api.github.com/repos/psf/requests/issues/4589/comments
https://api.github.com/repos/psf/requests/issues/4589/events
https://github.com/psf/requests/issues/4589
314,370,654
MDU6SXNzdWUzMTQzNzA2NTQ=
4,589
Making a request with multipart/form-data (file=) should throw an error if the barrier defined in the headers does not match
{ "avatar_url": "https://avatars.githubusercontent.com/u/22382740?v=4", "events_url": "https://api.github.com/users/Radilx/events{/privacy}", "followers_url": "https://api.github.com/users/Radilx/followers", "following_url": "https://api.github.com/users/Radilx/following{/other_user}", "gists_url": "https://api.github.com/users/Radilx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Radilx", "id": 22382740, "login": "Radilx", "node_id": "MDQ6VXNlcjIyMzgyNzQw", "organizations_url": "https://api.github.com/users/Radilx/orgs", "received_events_url": "https://api.github.com/users/Radilx/received_events", "repos_url": "https://api.github.com/users/Radilx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Radilx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Radilx/subscriptions", "type": "User", "url": "https://api.github.com/users/Radilx", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-04-14T23:29:46Z
2021-09-08T03:00:20Z
2018-04-15T12:46:21Z
NONE
resolved
I am unable to make a pull request at this time, but I think this should be added. The server will not understand the request if the content-type header's barrier= is not the same as the one generated by requests. At the very least there should be a warning.
{ "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/4589/reactions" }
https://api.github.com/repos/psf/requests/issues/4589/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).\r\n\r\nAdditionally, this appears to be a duplicate of several issues. In the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/4588
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4588/labels{/name}
https://api.github.com/repos/psf/requests/issues/4588/comments
https://api.github.com/repos/psf/requests/issues/4588/events
https://github.com/psf/requests/issues/4588
313,968,212
MDU6SXNzdWUzMTM5NjgyMTI=
4,588
response.text is returning with header values.
{ "avatar_url": "https://avatars.githubusercontent.com/u/3342215?v=4", "events_url": "https://api.github.com/users/selvaraju/events{/privacy}", "followers_url": "https://api.github.com/users/selvaraju/followers", "following_url": "https://api.github.com/users/selvaraju/following{/other_user}", "gists_url": "https://api.github.com/users/selvaraju/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/selvaraju", "id": 3342215, "login": "selvaraju", "node_id": "MDQ6VXNlcjMzNDIyMTU=", "organizations_url": "https://api.github.com/users/selvaraju/orgs", "received_events_url": "https://api.github.com/users/selvaraju/received_events", "repos_url": "https://api.github.com/users/selvaraju/repos", "site_admin": false, "starred_url": "https://api.github.com/users/selvaraju/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/selvaraju/subscriptions", "type": "User", "url": "https://api.github.com/users/selvaraju", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-04-13T04:47:44Z
2021-09-08T02:10:08Z
2018-04-21T20:53:59Z
NONE
resolved
Summary. response.text is returning with header values. ## Expected Result We are expecting only response content. but getting with header as well. Could you please help us to solve this issue ? response.text => {"@odata.context":"/redfish/v1/$metadata#ServiceRoot.ServiceRoot"} ## Actual Result Getting response header with response.text like below HTTP/1.1 200 OK Content-Length: 807 OData-Version: 4.0 Content-Type: application/json Date: Fri, 13 Apr 2018 04:38:07 GMT {"@odata.context":"/redfish/v1/$metadata#ServiceRoot.ServiceRoot"} ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "1.7.1" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "2.7.12" }, "platform": { "release": "4.4.0-93-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1000207f", "version": "16.2.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/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/4588/reactions" }
https://api.github.com/repos/psf/requests/issues/4588/timeline
null
completed
null
null
false
[ "Hi @selvaraju, we don’t modify the body so it’s unlikely Requests is doing anything other than returning what the server sent.\r\n\r\nWe’ll need you to provide a reproduction script in order to investigate. Until then, I don’t know if there’s anything we can do here.", "Hi @selvaraju, since this hasn't received a response, I'm going to close this out for now. Please feel free to reopen when you have a reproduction that shows the issue isn't related to the server you're connecting to. Thanks!", "Thank you. It was working fine python3. not in 2.7.it worked fine if we put some wait before calling request api " ]
https://api.github.com/repos/psf/requests/issues/4587
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4587/labels{/name}
https://api.github.com/repos/psf/requests/issues/4587/comments
https://api.github.com/repos/psf/requests/issues/4587/events
https://github.com/psf/requests/issues/4587
313,933,682
MDU6SXNzdWUzMTM5MzM2ODI=
4,587
PEM lib SSL error
{ "avatar_url": "https://avatars.githubusercontent.com/u/1672189?v=4", "events_url": "https://api.github.com/users/kevr/events{/privacy}", "followers_url": "https://api.github.com/users/kevr/followers", "following_url": "https://api.github.com/users/kevr/following{/other_user}", "gists_url": "https://api.github.com/users/kevr/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kevr", "id": 1672189, "login": "kevr", "node_id": "MDQ6VXNlcjE2NzIxODk=", "organizations_url": "https://api.github.com/users/kevr/orgs", "received_events_url": "https://api.github.com/users/kevr/received_events", "repos_url": "https://api.github.com/users/kevr/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kevr/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kevr/subscriptions", "type": "User", "url": "https://api.github.com/users/kevr", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-13T00:48:11Z
2021-09-08T03:00:21Z
2018-04-13T01:50:28Z
NONE
resolved
Summary. See https://github.com/requests/requests/issues/3702 What you expected. A correct connection or failure to verify ssl error What happened instead. SSL library traceback ``` File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 67, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 53, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 468, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 447, in send raise SSLError(e, request=request) SSLError: [X509] PEM lib (_ssl.c:2831) ``` Reopening this previously closed issue.
{ "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/4587/reactions" }
https://api.github.com/repos/psf/requests/issues/4587/timeline
null
completed
null
null
false
[ "Hi @kevr, thanks for taking the time to open this. So this error is a cert problem, as stated in the other ticket. We'd need the exact version of Python 2.7 you're using but it's likely coming out of [this function](https://github.com/python/cpython/blob/a61f5da54772b0ea6a7eccf21df08e61585ef712/Modules/_ssl.c#L2828-L2884). While the problem is pretty easy to find with a google search, I agree that the error message leaves something to be desired.\r\n\r\nSince this exception is being raised from the standard library, the only fix is likely wrapping it and rethrowing a clearer message. If that work was done, it would be handled at a layer lower than Requests though. Either in [urllib3](https://github.com/urllib3/urllib3) or more likely in pyopenssl/cryptography. I'd suggest raising an issue there. Thanks!", "Thanks for the quick response @nateprewitt -- I understand this is a certificate issue, however, I don't see a specific error message as to why; I guess the code basically says that what's being loaded is not in ASN1 or PEM format. Alright, thank you a lot." ]
https://api.github.com/repos/psf/requests/issues/4586
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4586/labels{/name}
https://api.github.com/repos/psf/requests/issues/4586/comments
https://api.github.com/repos/psf/requests/issues/4586/events
https://github.com/psf/requests/pull/4586
313,766,889
MDExOlB1bGxSZXF1ZXN0MTgxMjMzNjM5
4,586
allowing params to get requests on session
{ "avatar_url": "https://avatars.githubusercontent.com/u/16767329?v=4", "events_url": "https://api.github.com/users/ggalves/events{/privacy}", "followers_url": "https://api.github.com/users/ggalves/followers", "following_url": "https://api.github.com/users/ggalves/following{/other_user}", "gists_url": "https://api.github.com/users/ggalves/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ggalves", "id": 16767329, "login": "ggalves", "node_id": "MDQ6VXNlcjE2NzY3MzI5", "organizations_url": "https://api.github.com/users/ggalves/orgs", "received_events_url": "https://api.github.com/users/ggalves/received_events", "repos_url": "https://api.github.com/users/ggalves/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ggalves/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ggalves/subscriptions", "type": "User", "url": "https://api.github.com/users/ggalves", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-12T15:02:43Z
2021-09-03T00:11:05Z
2018-04-12T17:33:14Z
NONE
resolved
Simple fix to get method of Session class allowing it to receive params, just as requests.get would allow
{ "avatar_url": "https://avatars.githubusercontent.com/u/16767329?v=4", "events_url": "https://api.github.com/users/ggalves/events{/privacy}", "followers_url": "https://api.github.com/users/ggalves/followers", "following_url": "https://api.github.com/users/ggalves/following{/other_user}", "gists_url": "https://api.github.com/users/ggalves/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ggalves", "id": 16767329, "login": "ggalves", "node_id": "MDQ6VXNlcjE2NzY3MzI5", "organizations_url": "https://api.github.com/users/ggalves/orgs", "received_events_url": "https://api.github.com/users/ggalves/received_events", "repos_url": "https://api.github.com/users/ggalves/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ggalves/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ggalves/subscriptions", "type": "User", "url": "https://api.github.com/users/ggalves", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4586/reactions" }
https://api.github.com/repos/psf/requests/issues/4586/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4586.diff", "html_url": "https://github.com/psf/requests/pull/4586", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4586.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4586" }
true
[ "Hi @ggalves Can you share a bit more about what makes this PR necessary? `Session.get` already accepts `params` via `**kwargs` and passes them on appropriately to the best of my knowledge. Is something not behaving as you expect it to?", "Hi @sigmavirus24, I'm sorry, you are right, it's unnecessary.\r\n\r\nI couldn't reproduce my problem anymore, i did the PR on a hurry and must have mislooked something lol. I'll try later to reproduce it and open an issue if necessary. \r\n\r\nYou can close this PR, my apologies." ]
https://api.github.com/repos/psf/requests/issues/4585
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4585/labels{/name}
https://api.github.com/repos/psf/requests/issues/4585/comments
https://api.github.com/repos/psf/requests/issues/4585/events
https://github.com/psf/requests/issues/4585
313,617,441
MDU6SXNzdWUzMTM2MTc0NDE=
4,585
tbody structure is not detected
{ "avatar_url": "https://avatars.githubusercontent.com/u/19487370?v=4", "events_url": "https://api.github.com/users/corytu/events{/privacy}", "followers_url": "https://api.github.com/users/corytu/followers", "following_url": "https://api.github.com/users/corytu/following{/other_user}", "gists_url": "https://api.github.com/users/corytu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/corytu", "id": 19487370, "login": "corytu", "node_id": "MDQ6VXNlcjE5NDg3Mzcw", "organizations_url": "https://api.github.com/users/corytu/orgs", "received_events_url": "https://api.github.com/users/corytu/received_events", "repos_url": "https://api.github.com/users/corytu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/corytu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/corytu/subscriptions", "type": "User", "url": "https://api.github.com/users/corytu", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-04-12T08:02:41Z
2021-09-08T03:00:22Z
2018-04-12T12:04:22Z
NONE
resolved
## Expected Result I am parsing a table on an aspx webpage: https://www.ntuh.gov.tw/labmed/檢驗目錄/Lists/2015/BC.aspx. The `tr` elements are in a `tbody` structure. I expected to find them there. ## Actual Result An empty list is returned as if there's nothing. ## Reproduction Steps ```python import requests from selenium import webdriver from time import sleep from lxml import etree, html url = "https://www.ntuh.gov.tw/labmed/檢驗目錄/Lists/2015/BC.aspx" # With selenium browser = webdriver.Chrome() browser.get(url) # The url is visited with Chrome correctly root = etree.fromstring(browser.page_source, etree.HTMLParser()) root.xpath("//table[@class='ms-listviewtable']/tbody/tr") # It gives me several tr elements for further process # With requests result = "" while result == "": try: # Certificate is not verified to bypass the SSLError # Not secure though result = requests.get(url, verify = False) break except: sleep(5) continue # Transform it into an element tree root = etree.fromstring(result.content, etree.HTMLParser()) # Parse the information with the same XPath root.xpath("//table[@class='ms-listviewtable']/tbody/tr") # It gives me an empty list # However, this following line works: root.xpath("//table[@class='ms-listviewtable']/tr") ``` I've also posted my question on Stack Overflow: [The same xpath yields different extraction results from the same webpage](https://stackoverflow.com/questions/49757013/the-same-xpath-yields-different-extraction-results-from-the-same-webpage). ## System Information ```shell python -m requests.help ``` ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.2.1" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.4" }, "platform": { "release": "17.5.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "100020ef", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ff" }, "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/4585/reactions" }
https://api.github.com/repos/psf/requests/issues/4585/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\nIt looks like you also already posted to StackOverfow, so please be patient and wait for someone to answer you there.", "Excuse me, but I don't know how you distinguish \"request for help\" from \"report of a defect in the project\". Can't \"__`requests` is not able to recognize an existing html structure__\" a defect which needs fixing? If not, could you give some clarification?", "Hi @corytu, we don’t modify the html returned from the server. The issue you’re encountering is related to the server not returning content, or requiring JavaScript which Requests doesn’t support natively.\r\n\r\nAs @sigmavirus24 said, this is a usage question best suited for StackOverflow. You should be able to find a few other closed issues with questions about this as well. Thanks for checking in!", "@corytu fundamentally you seem to be confusing HTTP with HTML. Requests handles HTTP. Users, like yourself, handle HTML." ]
https://api.github.com/repos/psf/requests/issues/4584
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4584/labels{/name}
https://api.github.com/repos/psf/requests/issues/4584/comments
https://api.github.com/repos/psf/requests/issues/4584/events
https://github.com/psf/requests/issues/4584
313,613,314
MDU6SXNzdWUzMTM2MTMzMTQ=
4,584
requests.get() never timeouted when https proxy connect success but not response data.
{ "avatar_url": "https://avatars.githubusercontent.com/u/10595480?v=4", "events_url": "https://api.github.com/users/jjnetcn/events{/privacy}", "followers_url": "https://api.github.com/users/jjnetcn/followers", "following_url": "https://api.github.com/users/jjnetcn/following{/other_user}", "gists_url": "https://api.github.com/users/jjnetcn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jjnetcn", "id": 10595480, "login": "jjnetcn", "node_id": "MDQ6VXNlcjEwNTk1NDgw", "organizations_url": "https://api.github.com/users/jjnetcn/orgs", "received_events_url": "https://api.github.com/users/jjnetcn/received_events", "repos_url": "https://api.github.com/users/jjnetcn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jjnetcn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jjnetcn/subscriptions", "type": "User", "url": "https://api.github.com/users/jjnetcn", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-04-12T07:49:27Z
2021-09-05T00:07:00Z
2019-02-14T14:56:49Z
NONE
resolved
requests.get() never timeouted when https proxy connect success but not response data. 1: we create the server at port 4444 but not response any data. bash$ nc -l 4444 2:and then call request.get with https proxy bash$ python3 import requests requests.get("https://www.baidu.com", timeout=5, proxies={"http":"http://127.0.0.1:4444", "https":"http://127.0.0.1:4444"}) this command never return in urllib3. it block in HTTPSConnectionPool::urlopen, because HTTPS will call HTTPSConnectionPool::_prepare_conn() to prepare_conn( note http proxy never do this), and send "CONNECT ... HTTP/1.0" and blocked in response. because of socket.create_connection's timeout is None means "never timeouted", backstrace to requests, it new HTTPSConnectionPool() object thought connection_from_url without timeout. so i patched requests/adapters.py and now work --------------------------------------------- del conn = self.get_connection(request.url, proxies) add conn = self.get_connection(request.url, proxies, timeout) del def get_connection(self, url, proxies=None): add def get_connection(self, url, proxies=None, timeout=None): del proxy_manager = self.proxy_manager_for(proxy) add proxy_manager = self.proxy_manager_for(proxy,timeout) i am sorry i am not familiar markdown
{ "avatar_url": "https://avatars.githubusercontent.com/u/6740665?v=4", "events_url": "https://api.github.com/users/lmiguelvargasf/events{/privacy}", "followers_url": "https://api.github.com/users/lmiguelvargasf/followers", "following_url": "https://api.github.com/users/lmiguelvargasf/following{/other_user}", "gists_url": "https://api.github.com/users/lmiguelvargasf/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lmiguelvargasf", "id": 6740665, "login": "lmiguelvargasf", "node_id": "MDQ6VXNlcjY3NDA2NjU=", "organizations_url": "https://api.github.com/users/lmiguelvargasf/orgs", "received_events_url": "https://api.github.com/users/lmiguelvargasf/received_events", "repos_url": "https://api.github.com/users/lmiguelvargasf/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lmiguelvargasf/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lmiguelvargasf/subscriptions", "type": "User", "url": "https://api.github.com/users/lmiguelvargasf", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4584/reactions" }
https://api.github.com/repos/psf/requests/issues/4584/timeline
null
completed
null
null
false
[ "Closed due to inactivity." ]
https://api.github.com/repos/psf/requests/issues/4583
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4583/labels{/name}
https://api.github.com/repos/psf/requests/issues/4583/comments
https://api.github.com/repos/psf/requests/issues/4583/events
https://github.com/psf/requests/pull/4583
313,516,468
MDExOlB1bGxSZXF1ZXN0MTgxMDUwMTcz
4,583
Add a comment about lowercase env. variables precedence over uppercase
{ "avatar_url": "https://avatars.githubusercontent.com/u/19931768?v=4", "events_url": "https://api.github.com/users/ZuZuD/events{/privacy}", "followers_url": "https://api.github.com/users/ZuZuD/followers", "following_url": "https://api.github.com/users/ZuZuD/following{/other_user}", "gists_url": "https://api.github.com/users/ZuZuD/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ZuZuD", "id": 19931768, "login": "ZuZuD", "node_id": "MDQ6VXNlcjE5OTMxNzY4", "organizations_url": "https://api.github.com/users/ZuZuD/orgs", "received_events_url": "https://api.github.com/users/ZuZuD/received_events", "repos_url": "https://api.github.com/users/ZuZuD/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ZuZuD/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ZuZuD/subscriptions", "type": "User", "url": "https://api.github.com/users/ZuZuD", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2018-04-11T22:59:58Z
2021-09-03T00:11:00Z
2018-05-13T13:15:57Z
NONE
resolved
As suggested by @sigmavirus24 for the follow-up of issue #4579
{ "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/4583/reactions" }
https://api.github.com/repos/psf/requests/issues/4583/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4583.diff", "html_url": "https://github.com/psf/requests/pull/4583", "merged_at": "2018-05-13T13:15:57Z", "patch_url": "https://github.com/psf/requests/pull/4583.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4583" }
true
[ "Sure @nateprewitt that's updated!", "It also looks like we have a windows failure in the tests but it seems like it may be related to a dependency or pipenv issue. Not really relevant for a comment change but something we’ll want to fix.", "Let's keep it concise then @nateprewitt 👍 ", "Thanks @ZuZud! Kicking the tests really quickly to verify this is an actual issue with 3.4 and not transient.", "Thanks @ZuZuD!" ]
https://api.github.com/repos/psf/requests/issues/4582
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4582/labels{/name}
https://api.github.com/repos/psf/requests/issues/4582/comments
https://api.github.com/repos/psf/requests/issues/4582/events
https://github.com/psf/requests/issues/4582
312,783,833
MDU6SXNzdWUzMTI3ODM4MzM=
4,582
status_code return 200 in fact , it's should return 302
{ "avatar_url": "https://avatars.githubusercontent.com/u/12119679?v=4", "events_url": "https://api.github.com/users/peibibing/events{/privacy}", "followers_url": "https://api.github.com/users/peibibing/followers", "following_url": "https://api.github.com/users/peibibing/following{/other_user}", "gists_url": "https://api.github.com/users/peibibing/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/peibibing", "id": 12119679, "login": "peibibing", "node_id": "MDQ6VXNlcjEyMTE5Njc5", "organizations_url": "https://api.github.com/users/peibibing/orgs", "received_events_url": "https://api.github.com/users/peibibing/received_events", "repos_url": "https://api.github.com/users/peibibing/repos", "site_admin": false, "starred_url": "https://api.github.com/users/peibibing/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/peibibing/subscriptions", "type": "User", "url": "https://api.github.com/users/peibibing", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-10T06:04:21Z
2021-09-08T03:00:23Z
2018-04-10T10:13:50Z
NONE
resolved
Summary. ## Expected Result status_code return 302 ## Actual Result status_code return 200 ## Reproduction Steps ```python In [17]: import requests In [18]: a=requests.get( 'http://spj.anshan.gov.cn/aszwdt/epointzwmhwz/pages/default/legal/wanttodo/') In [19]: a.status_code Out[19]: 200 In [20]: a.url Out[20]: u'http://spj.anshan.gov.cn/aszwdt/epointzwmhwz/pages/default/index;jsessionid=CDF3C67801FB507FBD15B6FC2366244E' ``` ## System Information ``` { "chardet": { "version": "3.0.2" }, "cryptography": { "version": "1.8.1" }, "idna": { "version": "" }, "implementation": { "name": "CPython", "version": "2.7.13" }, "platform": { "release": "16.7.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "1010005f", "version": "17.0.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ff" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ``` python version: 2.7.14 2.7.5
{ "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/4582/reactions" }
https://api.github.com/repos/psf/requests/issues/4582/timeline
null
completed
null
null
false
[ "The 302 status code is in ```a.history``` because requests had already handled the redirect.", "See also http://docs.python-requests.org/en/master/user/quickstart/?highlight=redirects#redirection-and-history" ]
https://api.github.com/repos/psf/requests/issues/4581
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4581/labels{/name}
https://api.github.com/repos/psf/requests/issues/4581/comments
https://api.github.com/repos/psf/requests/issues/4581/events
https://github.com/psf/requests/pull/4581
312,734,163
MDExOlB1bGxSZXF1ZXN0MTgwNDYyMDc0
4,581
Update to return correct value for multiple_domains().
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[ { "color": "1cff91", "default": false, "description": "", "id": 860696300, "name": "3.0", "node_id": "MDU6TGFiZWw4NjA2OTYzMDA=", "url": "https://api.github.com/repos/psf/requests/labels/3.0" } ]
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" }
14
2018-04-10T00:36:51Z
2024-05-20T14:35:47Z
2024-05-20T14:35:47Z
NONE
null
requests/cookies.py Adjust flow to add domains to list as the first operation in the loop, then convert to a set and check the length of that set is greater than 1. Add tests to pass for a single domain, two cookies with the same domain, and multiple domains. Perhaps not the most efficient method, but it works.
{ "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/4581/reactions" }
https://api.github.com/repos/psf/requests/issues/4581/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4581.diff", "html_url": "https://github.com/psf/requests/pull/4581", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4581.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4581" }
true
[ "#4557 ", "@nateprewitt Thank you kindly for the helpful feedback!\r\n\r\nI've adjusted the method to make use of set in place of the domains list. I've also adjusted the structure of the conditional a bit and added an additional test check that null values are handled correctly by the method.", "@nateprewitt You're very welcome, sir.\r\n\r\nThe other updates you requested have been made.", "@gahancorpcfo, It looks like you may have accidentally merged master into your commit. Would you mind only including the changes related to this PR. The easiest way to do this is likely to reset HEAD~1 and then `git add -p your-relevant-files` or cherry pick from another branch if you have it.", "I believe I've managed to produce a single commit with the relevant changes that was not merged with master. \r\n\r\n. . . I hope. \r\n\r\n@nateprewitt Thank you very much for your help with this. ", "# [Codecov](https://codecov.io/gh/requests/requests/pull/4581?src=pr&el=h1) Report\n> Merging [#4581](https://codecov.io/gh/requests/requests/pull/4581?src=pr&el=desc) into [proposed/3.0.0](https://codecov.io/gh/requests/requests/commit/9c6bd54b44c0b05c6907522e8d9998a87b69c1cd?src=pr&el=desc) will **increase** coverage by `0.06%`.\n> The diff coverage is `100%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/requests/requests/pull/4581/graphs/tree.svg?width=650&height=150&src=pr&token=mZGswIiXLa)](https://codecov.io/gh/requests/requests/pull/4581?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## proposed/3.0.0 #4581 +/- ##\n==================================================\n+ Coverage 90.51% 90.57% +0.06% \n==================================================\n Files 14 15 +1 \n Lines 1549 1549 \n==================================================\n+ Hits 1402 1403 +1 \n+ Misses 147 146 -1\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4581?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/4581/diff?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.67% <ø> (-0.9%)` | :arrow_down: |\n| [requests/status\\_codes.py](https://codecov.io/gh/requests/requests/pull/4581/diff?src=pr&el=tree#diff-cmVxdWVzdHMvc3RhdHVzX2NvZGVzLnB5) | `100% <100%> (ø)` | :arrow_up: |\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4581/diff?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `95.63% <100%> (+0.03%)` | :arrow_up: |\n| [requests/help.py](https://codecov.io/gh/requests/requests/pull/4581/diff?src=pr&el=tree#diff-cmVxdWVzdHMvaGVscC5weQ==) | `68.62% <100%> (ø)` | :arrow_up: |\n| [requests/cookies.py](https://codecov.io/gh/requests/requests/pull/4581/diff?src=pr&el=tree#diff-cmVxdWVzdHMvY29va2llcy5weQ==) | `79.74% <100%> (+2.62%)` | :arrow_up: |\n| [requests/exceptions.py](https://codecov.io/gh/requests/requests/pull/4581/diff?src=pr&el=tree#diff-cmVxdWVzdHMvZXhjZXB0aW9ucy5weQ==) | `100% <100%> (ø)` | :arrow_up: |\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4581/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `93.11% <100%> (-0.16%)` | :arrow_down: |\n| [requests/api.py](https://codecov.io/gh/requests/requests/pull/4581/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYXBpLnB5) | `81.81% <0%> (-0.8%)` | :arrow_down: |\n| ... and [6 more](https://codecov.io/gh/requests/requests/pull/4581/diff?src=pr&el=tree-more) | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4581?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/4581?src=pr&el=footer). Last update [9c6bd54...1b7fc1d](https://codecov.io/gh/requests/requests/pull/4581?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "@gahancorpcfo it looks like you still have some extra code in cookies.py. Would you mind removing that? `git add -p` will allow you to easily select the chunks you need.", "@nateprewitt \r\n\r\nThe extra code has been removed from the commit now, it should be good to go.", "@gahancorpcfo thanks so much for seeing this through! We have an issue right now with our Windows build environment that's failing on Python 3.4, so I'm going to wait to merge this. We'll get this in once that's resolved.\r\n\r\nAs for the issue, it looks like https://github.com/jonparrott/cmarkgfm has had issues with Windows wheel builds recently between versions 0.2.0 and 0.4.0. I'll need to reach out to Jon to see if this is supposed to be fixed. That is unless someone else would like to spend some time digging and opening a relevant issue with the repository.", "Just as a follow up note, jonparrott/cmarkgfm#2 is the issue we're hitting right now. Until a wheel is built for 3.4 (hopefully in the next week), 3.4 won't be passing on Windows under appveyor.", "@nateprewitt Thanks for the heads up! I'm happy to help. ", "Sorry it took so long, but 3.4 wheels should now be available for Windows. :)", "No worries, thanks @jonparrott!", "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/4580
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4580/labels{/name}
https://api.github.com/repos/psf/requests/issues/4580/comments
https://api.github.com/repos/psf/requests/issues/4580/events
https://github.com/psf/requests/issues/4580
312,526,300
MDU6SXNzdWUzMTI1MjYzMDA=
4,580
Suggest: let json.dumps keeps non-ASCII characters when sending json request
{ "avatar_url": "https://avatars.githubusercontent.com/u/1781999?v=4", "events_url": "https://api.github.com/users/ahuigo/events{/privacy}", "followers_url": "https://api.github.com/users/ahuigo/followers", "following_url": "https://api.github.com/users/ahuigo/following{/other_user}", "gists_url": "https://api.github.com/users/ahuigo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ahuigo", "id": 1781999, "login": "ahuigo", "node_id": "MDQ6VXNlcjE3ODE5OTk=", "organizations_url": "https://api.github.com/users/ahuigo/orgs", "received_events_url": "https://api.github.com/users/ahuigo/received_events", "repos_url": "https://api.github.com/users/ahuigo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ahuigo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahuigo/subscriptions", "type": "User", "url": "https://api.github.com/users/ahuigo", "user_view_type": "public" }
[ { "color": "e11d21", "default": false, "description": null, "id": 136589914, "name": "Needs Info", "node_id": "MDU6TGFiZWwxMzY1ODk5MTQ=", "url": "https://api.github.com/repos/psf/requests/labels/Needs%20Info" }, { "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" } ]
closed
true
{ "avatar_url": "https://avatars.githubusercontent.com/u/1781999?v=4", "events_url": "https://api.github.com/users/ahuigo/events{/privacy}", "followers_url": "https://api.github.com/users/ahuigo/followers", "following_url": "https://api.github.com/users/ahuigo/following{/other_user}", "gists_url": "https://api.github.com/users/ahuigo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ahuigo", "id": 1781999, "login": "ahuigo", "node_id": "MDQ6VXNlcjE3ODE5OTk=", "organizations_url": "https://api.github.com/users/ahuigo/orgs", "received_events_url": "https://api.github.com/users/ahuigo/received_events", "repos_url": "https://api.github.com/users/ahuigo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ahuigo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahuigo/subscriptions", "type": "User", "url": "https://api.github.com/users/ahuigo", "user_view_type": "public" }
[ { "avatar_url": "https://avatars.githubusercontent.com/u/1781999?v=4", "events_url": "https://api.github.com/users/ahuigo/events{/privacy}", "followers_url": "https://api.github.com/users/ahuigo/followers", "following_url": "https://api.github.com/users/ahuigo/following{/other_user}", "gists_url": "https://api.github.com/users/ahuigo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ahuigo", "id": 1781999, "login": "ahuigo", "node_id": "MDQ6VXNlcjE3ODE5OTk=", "organizations_url": "https://api.github.com/users/ahuigo/orgs", "received_events_url": "https://api.github.com/users/ahuigo/received_events", "repos_url": "https://api.github.com/users/ahuigo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ahuigo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahuigo/subscriptions", "type": "User", "url": "https://api.github.com/users/ahuigo", "user_view_type": "public" } ]
null
11
2018-04-09T13:15:44Z
2021-09-08T02:10:07Z
2018-04-24T14:05:30Z
NONE
resolved
## Summary When I send a json request, the json.dumps **does not keeps non-ASCII characters**. ## Reproduction Steps ``` cat <<MM | python3 - & from flask import Flask,request app = Flask('') @app.route('/', methods=['POST', 'GET']) def test(): return(request.data) app.run() MM cat <<MM | python3 - import time import requests as r time.sleep(1) print(r.post('http://localhost:5000/', json={'bar':'程序员'}).text) MM ``` ## Expected Result I expect result keeps *non-ASCII* request: `{"bar": "程序员"}` ## Actual Result `{"bar": "\u7a0b\u5e8f\u5458"}` ## Suggest Modify the models `vim modles.py +458` to keep the non-ASCII characters. For example: `body = complexjson.dumps(json, ensure_ascii=False)` ``` >>> json.dumps('程序员', ensure_ascii=False) '"程序员"' >>> json.dumps('程序员') '"\\u7a0b\\u5e8f\\u5458"' ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "implementation": { "name": "CPython", "version": "3.6.1" }, "platform": { "release": "15.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.1" }, "system_ssl": { "version": "100020cf" }, "urllib3": { "version": "1.21.1" }, "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/4580/reactions" }
https://api.github.com/repos/psf/requests/issues/4580/timeline
null
completed
null
null
false
[ "Does\r\n\r\n```py\r\n\r\ncat <<MM | python3 -\r\nimport json\r\nimport time\r\nimport requests as r\r\ntime.sleep(1)\r\nprint(r.post('http://localhost:5000/', data=json.dumps({'bar':'程序员'}), headers={'Content-Type': 'application/json'}).text)\r\nMM\r\n```\r\n\r\nDo the right thing?", "Also, looking at our source code: https://github.com/requests/requests/blob/b66908e7b647689793e299edc111bf9910e93ad3/requests/models.py#L454\r\n\r\nI see:\r\n\r\n```py\r\n if not data and json is not None:\r\n # urllib3 requires a bytes-like body. Python 2's json.dumps\r\n # provides this natively, but Python 3 gives a Unicode string.\r\n content_type = 'application/json'\r\n body = complexjson.dumps(json)\r\n if not isinstance(body, bytes):\r\n body = body.encode('utf-8')\r\n```\r\n\r\nWhich is unclear if that's what you're complaining about. Furthermore, you haven't given us any of the information we kindly requested. So we'll need that before we can move forward.\r\n\r\nPlease 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).", "@sigmavirus24 I've updated this issue with more info. \r\nI hope the json request could keep non-ASCII.\r\nFor the purposes of:\r\n\r\n1. Decrease the size of data\r\n2. Convenient for debugging and reading.", "@ahui132 please answer my [question](https://github.com/requests/requests/issues/4580#issuecomment-379777337). Your issue now includes the baseline information but is still unclear. Are you suggesting adding `ensure_ascii=True` to every call?", "> Are you suggesting adding ensure_ascii=True to every call?\r\n\r\n@sigmavirus24 No, I want to set `ensure_ascii=False` by default. ", "Hi @ahui132, I think you may be suggesting we set `ensure_ascii` to `False`, not `True`. If you look at the method signature in both [Python 2](https://docs.python.org/2/library/json.html#basic-usage) and [Python 3](https://docs.python.org/3/library/json.html#basic-usage), you'll see it's already set to True by default. \r\n\r\nIt looks like we are doing something a bit off here. When you use dumps with the json module, the ensure_ascii flag escapes all unicode strings. When we call `encode('utf-8')`, we are escaping the escape strings which means we send `\\\\u7a0b\\\\u5e8f]\\u5458` instead of `\\u7a0b\\u5e8f\\u5458`. I'm pretty sure that's not what we want, since the receiving json decoder with think the string is literally `\\u7a0b\\u5e8f\\u5458` not `程序员` without building in a custom decoder.\r\n\r\nSo setting `ensure_ascii` to False means we won't double escape and do actually send what we're expecting. I'm not sure how this change would affect existing users, or how we've had this functionality around so long without it being called out. I've run out of investigation time today but if anyone wants to build some tests around this, that would be a great start.", "@nateprewitt I'm not sure I follow. Which of the following do you feel is correct:\r\n\r\n```py\r\n>>> import json\r\n>>> json.dumps({'bar':'程序员'})\r\n'{\"bar\": \"\\\\u7a0b\\\\u5e8f\\\\u5458\"}'\r\n>>> json.dumps({'bar':'程序员'}).encode('utf-8')\r\nb'{\"bar\": \"\\\\u7a0b\\\\u5e8f\\\\u5458\"}'\r\n>>> json.dumps({'bar':'程序员'}, ensure_ascii=False)\r\n'{\"bar\": \"程序员\"}'\r\n>>> json.dumps({'bar':'程序员'}, ensure_ascii=False).encode('utf-8')\r\nb'{\"bar\": \"\\xe7\\xa8\\x8b\\xe5\\xba\\x8f\\xe5\\x91\\x98\"}'\r\n```", "```py\r\n>>> print(requests.post('https://httpbin.org/post', headers={'Content-Type': 'application/json'}, data=json.dumps({'bar':'程序员'}).encode('utf-8')).text)\r\n{\r\n \"args\": {}, \r\n \"data\": \"{\\\"bar\\\": \\\"\\\\u7a0b\\\\u5e8f\\\\u5458\\\"}\", \r\n \"files\": {}, \r\n \"form\": {}, \r\n \"headers\": {\r\n \"Accept\": \"*/*\", \r\n \"Accept-Encoding\": \"gzip, deflate\", \r\n \"Connection\": \"close\", \r\n \"Content-Length\": \"29\", \r\n \"Content-Type\": \"application/json\", \r\n \"Host\": \"httpbin.org\", \r\n \"User-Agent\": \"python-requests/2.18.4\"\r\n }, \r\n \"json\": {\r\n \"bar\": \"\\u7a0b\\u5e8f\\u5458\"\r\n }, \r\n \"origin\": \"127.127.127.127\", \r\n \"url\": \"https://httpbin.org/post\"\r\n}\r\n\r\n>>> print(requests.post('https://httpbin.org/post', headers={'Content-Type': 'application/json'}, data=json.dumps({'bar':'程序员'}, ensure_ascii=False).encode('utf-8')).text)\r\n{\r\n \"args\": {}, \r\n \"data\": \"{\\\"bar\\\": \\\"\\u7a0b\\u5e8f\\u5458\\\"}\", \r\n \"files\": {}, \r\n \"form\": {}, \r\n \"headers\": {\r\n \"Accept\": \"*/*\", \r\n \"Accept-Encoding\": \"gzip, deflate\", \r\n \"Connection\": \"close\", \r\n \"Content-Length\": \"20\", \r\n \"Content-Type\": \"application/json\", \r\n \"Host\": \"httpbin.org\", \r\n \"User-Agent\": \"python-requests/2.18.4\"\r\n }, \r\n \"json\": {\r\n \"bar\": \"\\u7a0b\\u5e8f\\u5458\"\r\n }, \r\n \"origin\": \"127.127.127.127\", \r\n \"url\": \"https://httpbin.org/post\"\r\n}\r\n```\r\n\r\nAs far as I can tell they both have the same result.", "😅This is what I get for writing quick and dirty tests. I was using the data field which does change based on ensure_ascii, but the `json` modules handles this the same (`\\`==`\\\\`, `\\\\\\`==`\\\\\\\\`, etc). I was comparing strings rather than the loaded JSON objects which caused the inconsistency.\r\n\r\n@ahui132, this is working as expected. Your server is receiving [json-escaped strings](https://tools.ietf.org/html/rfc8259#section-7) which are valid according to the spec. You'll also note that the spec requires all JSON data transferred between systems to be represented this way. If you want the json contents to return to their \"expected\" form, you'll find calling `r.content.decode('unicode_escape')` should do the trick.", "@nateprewitt @sigmavirus24 \r\nLet me make a summarization\r\n## json string's format: Non-ASCII vs ASCII\r\nThe json-escaped raw string `\"{\\\"bar\\\": \\\"\\\\u5458\\\"}\"` is different from `\"{\\\"bar\\\": \\\"\\u5458\\\"}\"`.\r\n1. The first one is pure ASCII format, and the second is non-ASCII format\r\n2. Both of them are valid json escaped format.\r\n\r\n```\r\n\r\n>>> json.dumps('\\u5458', ensure_ascii=True) # ASCII\r\n'\"\\\\u5458\"'\r\n>>> len(json.dumps('\\u5458', ensure_ascii=True).encode('utf8'))\r\n8\r\n>>> json.dumps('\\u5458', ensure_ascii=False) # non-ASCII\r\n'\"员\"'\r\n>>> '\"\\u5458\"' # non-ASCII\r\n'\"员\"'\r\n>>> len(json.dumps('\\u5458', ensure_ascii=False).encode('utf8'))\r\n5\r\n```\r\n## How to send json with non-ASCII format\r\nI we want to send json with non-ASCII via requests, we have to use `post` method with `Content-Type: appliaction/json` explicitly(It's too complex):\r\n1. `print(requests.post('https://httpbin.org/post', headers={'Content-Type': 'application/json'}, data=json.dumps({'bar':'员'}, ensure_ascii=False).encode('utf-8')).text)`\r\n\r\nI think there are some pythonic ways as blow:\r\n1. Add an `ensure_ascii` option: `print(requests.post('https://httpbin.org/post', json={'bar':'员'}, ensure_ascii=False)).text)`\r\n2. Set `ensure_ascii=False` by default in `vim modles.py +458`", "This project is not adding new keywords that are related to serialization. If you need this specific handling, then the first way that is *explicit* is the only right way to do it.\r\n\r\nIt's not too complex, as `json` is API sugar for the 98% use-case. The last 2% simply will not get API sugar around that. That's the design credo of this project." ]
https://api.github.com/repos/psf/requests/issues/4579
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4579/labels{/name}
https://api.github.com/repos/psf/requests/issues/4579/comments
https://api.github.com/repos/psf/requests/issues/4579/events
https://github.com/psf/requests/issues/4579
312,457,919
MDU6SXNzdWUzMTI0NTc5MTk=
4,579
os.environ lowercase takes precedence over uppercase
{ "avatar_url": "https://avatars.githubusercontent.com/u/19931768?v=4", "events_url": "https://api.github.com/users/ZuZuD/events{/privacy}", "followers_url": "https://api.github.com/users/ZuZuD/followers", "following_url": "https://api.github.com/users/ZuZuD/following{/other_user}", "gists_url": "https://api.github.com/users/ZuZuD/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ZuZuD", "id": 19931768, "login": "ZuZuD", "node_id": "MDQ6VXNlcjE5OTMxNzY4", "organizations_url": "https://api.github.com/users/ZuZuD/orgs", "received_events_url": "https://api.github.com/users/ZuZuD/received_events", "repos_url": "https://api.github.com/users/ZuZuD/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ZuZuD/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ZuZuD/subscriptions", "type": "User", "url": "https://api.github.com/users/ZuZuD", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2018-04-09T09:29:40Z
2021-09-08T02:09:57Z
2018-05-20T19:17:16Z
NONE
resolved
I wonder if there is a specific reason for the lowercase http_proxy to take precedence over its uppercase version (same behavior for the other os.environ). The convention is to use uppercase for environment variables and setting both could potentially lead users to unexpected behavior. https://github.com/requests/requests/blob/master/requests/utils.py#L699 Can someone give me the original reason why things have been done like this? Thanks! ## 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": "4.9.85-38.58.amzn1.x86_64", "system": "Linux" }, "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/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/4579/reactions" }
https://api.github.com/repos/psf/requests/issues/4579/timeline
null
completed
null
null
false
[ "Hi @ZuZuD, to clarify, your concern is about `no_proxy` being given precedence over `NO_PROXY`? I believe the lambda function was designed to give preference to whatever casing it was handed first, and then attempt to find an uppercased version if that did not work.\r\n\r\nThe `no_proxy` check was added later (#945) and I believe chose lowercase for scoping issues. A lowercased environment variable is conventionally used to represent a \"local\" scope environment variable, where as an uppercased name is considered global and likely spans sessions. We're giving preference to the local scope first before looking for something in global scope, because it's considered to be more specific.", "Thank you for your complete answer @nateprewitt ! By curiosity I took a look at other http libraries/software to assess their behavior regarding those env variables.\r\n\r\n1) curl: lowercase takes precedence over uppercase https://github.com/curl/curl/blob/master/lib/url.c#L2659\r\n\r\n```\r\n$ ~/github/curl export HTTPS_PROXY=0.0.0.0\r\n$ ~/github/curl curl -i https://github.com\r\n$ curl: (7) Failed to connect to 0.0.0.0 port 1080: Connection refused\r\n\r\n$ ~/github/curl export https_proxy=localhost\r\n$ ~/github/curl curl -i https://github.com\r\n$ curl: (7) Failed to connect to localhost port 1080: Connection refused\r\n```\r\nMore surprisingly, it also ignores HTTP_PROXY https://github.com/curl/curl/blob/master/lib/url.c#L2648\r\n\r\n2) wget: only parse lowercase variables and doesn't take into consideration uppercase variants\r\nhttps://github.com/mirror/wget/blob/master/src/retr.c#L1450\r\n\r\nTherefore it is a consistent behavior so far as they all favor lowercase usage, which could be another good reason.\r\n\r\n\r\n", "That does make sense @ZuZuD. I know some of our behaviour tries to model curl in the places where it makes sense. Would you be willing to add a comment to the code to clarify that for future maintainers and contributors? That would be incredibly helpful to have as these issues may not persist for the full length of our project. :smile: ", "And @ZuZuD, *thank you so much* for researching that. I greatly appreciate your effort into finding out those other behaviours and helping this project improve.", "Closing this out since #4583 was merged. Thanks again @ZuZuD!" ]
https://api.github.com/repos/psf/requests/issues/4578
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4578/labels{/name}
https://api.github.com/repos/psf/requests/issues/4578/comments
https://api.github.com/repos/psf/requests/issues/4578/events
https://github.com/psf/requests/issues/4578
312,412,880
MDU6SXNzdWUzMTI0MTI4ODA=
4,578
docstring inconsistent with requests.api.post
{ "avatar_url": "https://avatars.githubusercontent.com/u/30798866?v=4", "events_url": "https://api.github.com/users/YannLuo/events{/privacy}", "followers_url": "https://api.github.com/users/YannLuo/followers", "following_url": "https://api.github.com/users/YannLuo/following{/other_user}", "gists_url": "https://api.github.com/users/YannLuo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/YannLuo", "id": 30798866, "login": "YannLuo", "node_id": "MDQ6VXNlcjMwNzk4ODY2", "organizations_url": "https://api.github.com/users/YannLuo/orgs", "received_events_url": "https://api.github.com/users/YannLuo/received_events", "repos_url": "https://api.github.com/users/YannLuo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/YannLuo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/YannLuo/subscriptions", "type": "User", "url": "https://api.github.com/users/YannLuo", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-04-09T06:46:13Z
2021-09-08T03:00:22Z
2018-04-12T18:41:15Z
NONE
resolved
I run the `pytest tests` and find `requests.api.post` receive `data` whose type is `list_iterator`, which is inconsistent with its docstring. ## Expected Result modify docstring of `requests.api.post` to `:param data: (optional) Dictionary (will be form-encoded), bytes,list_iterator,or file-like object to send in the body of the :class:Request.` ## Actual Result what the docstring shows. ## Reproduction Steps the test case is in `requests/tests/test_lowlevel.py::test_chunked_upload`, which `data` is a `iter` and passed to `requests.api.post`. ```python import requests def test_chunked_upload(): """can safely send generators""" close_server = threading.Event() server = Server.basic_response_server(wait_to_close_event=close_server) data = iter([b'a', b'b', b'c']) with server as (host, port): url = 'http://{0}:{1}/'.format(host, port) r = requests.post(url, data=data, stream=True) close_server.set() # release server block assert r.status_code == 200 assert r.request.headers['Transfer-Encoding'] == 'chunked' ``` ## System Information ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.2.2" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.5" }, "platform": { "release": "17.5.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "1010008f", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ef" }, "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/4578/reactions" }
https://api.github.com/repos/psf/requests/issues/4578/timeline
null
completed
null
null
false
[ "Hi @YannLuo,\r\n\r\nRequests will take an iterable object containing bytes for the data param which is noted in [the documentation](http://docs.python-requests.org/en/master/user/advanced/#chunk-encoded-requests). We could specify in the docstring that bytes iterables work here too, but it's a more verbose explanation than proposed. I'm not sure is necessary given that bytes is specified and the specific case of chunked-encoding is defined in the docs which is what these iterators are used for.", "I tend to agree with @nateprewitt ", "It looks like we have consensus among the maintainers. It’s likely best to expose this to people specifically looking to use chunked transfer-encoding which the documentation handles. I’m going to close this since there doesn’t appear to be anything actionable, but feel free to let us know if you feel we’re missing something. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/4577
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4577/labels{/name}
https://api.github.com/repos/psf/requests/issues/4577/comments
https://api.github.com/repos/psf/requests/issues/4577/events
https://github.com/psf/requests/issues/4577
312,288,234
MDU6SXNzdWUzMTIyODgyMzQ=
4,577
r
{ "avatar_url": "https://avatars.githubusercontent.com/u/3155271?v=4", "events_url": "https://api.github.com/users/noamvaza/events{/privacy}", "followers_url": "https://api.github.com/users/noamvaza/followers", "following_url": "https://api.github.com/users/noamvaza/following{/other_user}", "gists_url": "https://api.github.com/users/noamvaza/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/noamvaza", "id": 3155271, "login": "noamvaza", "node_id": "MDQ6VXNlcjMxNTUyNzE=", "organizations_url": "https://api.github.com/users/noamvaza/orgs", "received_events_url": "https://api.github.com/users/noamvaza/received_events", "repos_url": "https://api.github.com/users/noamvaza/repos", "site_admin": false, "starred_url": "https://api.github.com/users/noamvaza/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/noamvaza/subscriptions", "type": "User", "url": "https://api.github.com/users/noamvaza", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2018-04-08T09:11:05Z
2021-09-08T03:00:24Z
2018-04-08T15:19:31Z
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/4577/reactions" }
https://api.github.com/repos/psf/requests/issues/4577/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/4576
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4576/labels{/name}
https://api.github.com/repos/psf/requests/issues/4576/comments
https://api.github.com/repos/psf/requests/issues/4576/events
https://github.com/psf/requests/issues/4576
312,268,340
MDU6SXNzdWUzMTIyNjgzNDA=
4,576
POST of urlencoded data breaks HTTPSignatureAuth
{ "avatar_url": "https://avatars.githubusercontent.com/u/5143256?v=4", "events_url": "https://api.github.com/users/hannes-ucsc/events{/privacy}", "followers_url": "https://api.github.com/users/hannes-ucsc/followers", "following_url": "https://api.github.com/users/hannes-ucsc/following{/other_user}", "gists_url": "https://api.github.com/users/hannes-ucsc/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hannes-ucsc", "id": 5143256, "login": "hannes-ucsc", "node_id": "MDQ6VXNlcjUxNDMyNTY=", "organizations_url": "https://api.github.com/users/hannes-ucsc/orgs", "received_events_url": "https://api.github.com/users/hannes-ucsc/received_events", "repos_url": "https://api.github.com/users/hannes-ucsc/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hannes-ucsc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hannes-ucsc/subscriptions", "type": "User", "url": "https://api.github.com/users/hannes-ucsc", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-04-08T03:29:22Z
2021-09-08T03:00:24Z
2018-04-08T06:37:14Z
NONE
resolved
`HTTPSignatureAuth` doesn't work with POST and the `application/x-www-form-urlencoded` content type. https://github.com/requests/requests/blob/e4fc3539b43416f9e9ba6837d73b1b7392d4b242/requests/models.py#L105 The `urlencode()` invocation in the line above returns a `str`, which is then assigned to the `body` attribute of the `PreparedRequest` instance. I think `HTTPSignatureAuth` expects the body to be `bytes`. ## Expected Result Request is made. ## Actual Result ``` Traceback (most recent call last): File "<input>", line 1, in <module> File "/Users/hannes/workspace/hca/data-store/wip/.venv/lib/python3.6/site-packages/requests/api.py", line 112, in post return request('post', url, data=data, json=json, **kwargs) File "/Users/hannes/workspace/hca/data-store/wip/.venv/lib/python3.6/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, **kwargs) File "/Users/hannes/workspace/hca/data-store/wip/.venv/lib/python3.6/site-packages/requests/sessions.py", line 494, in request prep = self.prepare_request(req) File "/Users/hannes/workspace/hca/data-store/wip/.venv/lib/python3.6/site-packages/requests/sessions.py", line 437, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/Users/hannes/workspace/hca/data-store/wip/.venv/lib/python3.6/site-packages/requests/models.py", line 309, in prepare self.prepare_auth(auth, url) File "/Users/hannes/workspace/hca/data-store/wip/.venv/lib/python3.6/site-packages/requests/models.py", line 540, in prepare_auth r = auth(self) File "/Users/hannes/workspace/hca/data-store/wip/.venv/lib/python3.6/site-packages/requests_http_signature/__init__.py", line 89, in __call__ self.add_digest(request) File "/Users/hannes/workspace/hca/data-store/wip/.venv/lib/python3.6/site-packages/requests_http_signature/__init__.py", line 69, in add_digest digest = self.hasher_constructor(request.body).digest() TypeError: Unicode-objects must be encoded before hashing ``` ## Reproduction Steps ```python import requests import requests_http_signature auth = requests_http_signature.HTTPSignatureAuth(key=b'123', key_id='foo') requests.post('http://localhost/', data={'foo':'bar'}, auth=auth) ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.4" }, "platform": { "release": "17.4.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "100020ef" }, "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/4576/reactions" }
https://api.github.com/repos/psf/requests/issues/4576/timeline
null
completed
null
null
false
[ "Hey @hannes-ucsc, the `urlencode` function in Python 3 returns an ascii string, but I don't believe we have a guarantee to provide data we urlencode as bytes. We currently return the body in the native \"string\" format of your Python version, unless explicitly given something else, which I believe makes sense.\r\n\r\nI would suggest either taking care of the urlencoding before passing the data to Requests ~or using the [Prepared Request workflow](http://docs.python-requests.org/en/master/user/advanced/#prepared-requests). You can encode the ascii string before sending the PreparedRequest.~\r\n\r\nEDIT: Sorry, I redacted the PreparedRequest part which won't work because of the auth hooks. Since the requests-http-signature library wants bytes, you'll need to supply them manually. This makes sense from their perspective since they probably don't want to be doing any guess work, but gives you the extra burden." ]
https://api.github.com/repos/psf/requests/issues/4575
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4575/labels{/name}
https://api.github.com/repos/psf/requests/issues/4575/comments
https://api.github.com/repos/psf/requests/issues/4575/events
https://github.com/psf/requests/issues/4575
312,000,337
MDU6SXNzdWUzMTIwMDAzMzc=
4,575
Too many open files (CLOSE_WAIT connections)
{ "avatar_url": "https://avatars.githubusercontent.com/u/6002677?v=4", "events_url": "https://api.github.com/users/j-frost/events{/privacy}", "followers_url": "https://api.github.com/users/j-frost/followers", "following_url": "https://api.github.com/users/j-frost/following{/other_user}", "gists_url": "https://api.github.com/users/j-frost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/j-frost", "id": 6002677, "login": "j-frost", "node_id": "MDQ6VXNlcjYwMDI2Nzc=", "organizations_url": "https://api.github.com/users/j-frost/orgs", "received_events_url": "https://api.github.com/users/j-frost/received_events", "repos_url": "https://api.github.com/users/j-frost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/j-frost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/j-frost/subscriptions", "type": "User", "url": "https://api.github.com/users/j-frost", "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" }
3
2018-04-06T14:36:45Z
2024-05-20T14:37:03Z
2024-05-20T14:37:03Z
NONE
null
I'm importing data from a remote API. It's not the best API, so it requires me to do a lot of requests for any given data point. Since the data isn't time invariant, I need to first get a full set and then import it. Both sides use requests to talk to REST endpoints. The problem is that because I need to import one whole dataset all at once, I have a pretty long running celery task. In our test environment, everything worked great, so I'm ruling out business logic errors, but maybe I or a library provider is using requests wrong -- or this is a bug. ## Problem In my production environment, I get ` HTTPSConnectionPool(host='<redacted>', port=443): Max retries exceeded with url: /rest/api/2/<redacted> (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f05734547b8>: Failed to establish a new connection: [Errno 24] Too many open files',)) ` ## Expected Result New connections can be made while respecting `/etc/security/limits.conf` (which in my case sets nofile to 10240). Requests manages open file descriptors for `CLOSE_WAIT` sockets and recycles them as appropriate. ## Actual Result New connections cannot be made after a certain point. I suspect this might be 1024, because when monitoring `lsof -i | grep CLOSE_WAIT | wc -l`, it never exceeds this number. Calling `gc.collect()` after importing parts of the data does not help. `CLOSE_WAIT` socket file descriptors are only released once the celery task completes and the whole process ends. The next run looks similar, so it seems at least when the process ends, everything is cleaned up properly. ## Reproduction Steps Honestly I don't know what to put here, because I'm just using API wrappers. Please tell me what you need to know. I can tell you this happens independently with both ingress and egress wrappers (which talk to entirely different systems and APIs), and a colleague and I have tried to find any held references and have found none. ## 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.4" }, "platform": { "release": "4.4.0-109-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010006f", "version": "17.2.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000207f" }, "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": 9, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 9, "url": "https://api.github.com/repos/psf/requests/issues/4575/reactions" }
https://api.github.com/repos/psf/requests/issues/4575/timeline
null
completed
null
null
false
[ "Maybe help for you:\r\n \" a lot of close/wait usually means that there are a lot of connections being opened and closed rapidly. It takes time for those connections to be cleared on the server even with a proper request to close which is normal TCP operation. I'd suggest you review your code to see if something is potentially leaking connecting or closing them too soon before they have a chance to be re-used. That could be the root of the problem.\"\r\n\r\nCome from here: https://groups.google.com/forum/#!msg/gremlin-users/Psh0N9RpGuM/95yLrdNrEQAJ", "I also have the same problem. After debugging, I found its the bug of code.\r\nHere is a simple bug code example:\r\n```\r\nimport requests\r\nfrom proj.celery import app\r\n\r\nSESSION = requests.session()\r\n\r\nclass Client:\r\n def __init__(self):\r\n self.proxies = get_proxies()\r\n def get(self, params=None, url=None, path=None, headers=None, timeout=10):\r\n resp = SESSION.get(url, params=params, headers=headers, timeout=timeout, proxies=self.proxies)\r\n return resp\r\n\r\[email protected]\r\ndef test_task():\r\n c = Client()\r\n c.get('https://google.com')\r\n```\r\nWhen we run test_task on celery-daemon many times, it will remain many 'close_wait' state connection to celery. \r\nYou can use `netstat -anutp |grep 'CLOSE_STAT'` to see the useless connection fd for celery process.\r\n\r\nSo I move the session into Client as a attr to solve my problem. \r\n```\r\nclass Client:\r\n def __init__(self):\r\n self.proxies = get_proxies()\r\n self.session = requests.SESSION()\r\n def get(self, params=None, url=None, path=None, headers=None, timeout=10):\r\n resp = self.session.get(url, params=params, headers=headers, timeout=timeout, proxies=self.proxies)\r\n return resp\r\n```\r\nThis is my experience, I hope it can help others.", "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/4574
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4574/labels{/name}
https://api.github.com/repos/psf/requests/issues/4574/comments
https://api.github.com/repos/psf/requests/issues/4574/events
https://github.com/psf/requests/issues/4574
311,586,434
MDU6SXNzdWUzMTE1ODY0MzQ=
4,574
Default data should be dict, not list
{ "avatar_url": "https://avatars.githubusercontent.com/u/2925345?v=4", "events_url": "https://api.github.com/users/kalaomer/events{/privacy}", "followers_url": "https://api.github.com/users/kalaomer/followers", "following_url": "https://api.github.com/users/kalaomer/following{/other_user}", "gists_url": "https://api.github.com/users/kalaomer/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kalaomer", "id": 2925345, "login": "kalaomer", "node_id": "MDQ6VXNlcjI5MjUzNDU=", "organizations_url": "https://api.github.com/users/kalaomer/orgs", "received_events_url": "https://api.github.com/users/kalaomer/received_events", "repos_url": "https://api.github.com/users/kalaomer/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kalaomer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kalaomer/subscriptions", "type": "User", "url": "https://api.github.com/users/kalaomer", "user_view_type": "public" }
[ { "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" } ]
closed
true
null
[]
null
2
2018-04-05T12:17:04Z
2021-09-08T03:00:22Z
2018-04-12T18:43:27Z
NONE
resolved
https://github.com/requests/requests/blob/e4fc3539b43416f9e9ba6837d73b1b7392d4b242/requests/models.py#L223 In request class, empty data should be dict, not list.
{ "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/4574/reactions" }
https://api.github.com/repos/psf/requests/issues/4574/timeline
null
completed
null
null
false
[ "What makes you think that?", "Since we haven’t had a response and the issue is unclear I’m going to close this for now. @kalaomer feel free to reopen this with more information if you feel there’s still an issue." ]
https://api.github.com/repos/psf/requests/issues/4573
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4573/labels{/name}
https://api.github.com/repos/psf/requests/issues/4573/comments
https://api.github.com/repos/psf/requests/issues/4573/events
https://github.com/psf/requests/pull/4573
311,263,457
MDExOlB1bGxSZXF1ZXN0MTc5NDE2MTAx
4,573
add HTTP 419 to requests.codes
{ "avatar_url": "https://avatars.githubusercontent.com/u/1417779?v=4", "events_url": "https://api.github.com/users/mxmader/events{/privacy}", "followers_url": "https://api.github.com/users/mxmader/followers", "following_url": "https://api.github.com/users/mxmader/following{/other_user}", "gists_url": "https://api.github.com/users/mxmader/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mxmader", "id": 1417779, "login": "mxmader", "node_id": "MDQ6VXNlcjE0MTc3Nzk=", "organizations_url": "https://api.github.com/users/mxmader/orgs", "received_events_url": "https://api.github.com/users/mxmader/received_events", "repos_url": "https://api.github.com/users/mxmader/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mxmader/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mxmader/subscriptions", "type": "User", "url": "https://api.github.com/users/mxmader", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-04-04T14:50:14Z
2021-09-03T00:11:06Z
2018-04-04T16:29:54Z
NONE
resolved
via status_codes.py. fixes #4572
{ "avatar_url": "https://avatars.githubusercontent.com/u/1417779?v=4", "events_url": "https://api.github.com/users/mxmader/events{/privacy}", "followers_url": "https://api.github.com/users/mxmader/followers", "following_url": "https://api.github.com/users/mxmader/following{/other_user}", "gists_url": "https://api.github.com/users/mxmader/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mxmader", "id": 1417779, "login": "mxmader", "node_id": "MDQ6VXNlcjE0MTc3Nzk=", "organizations_url": "https://api.github.com/users/mxmader/orgs", "received_events_url": "https://api.github.com/users/mxmader/received_events", "repos_url": "https://api.github.com/users/mxmader/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mxmader/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mxmader/subscriptions", "type": "User", "url": "https://api.github.com/users/mxmader", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4573/reactions" }
https://api.github.com/repos/psf/requests/issues/4573/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4573.diff", "html_url": "https://github.com/psf/requests/pull/4573", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4573.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4573" }
true
[ "Hey @mxmader, thanks for taking the initiative to put this together and start the conversation While there are some uses of 419 on the web, it’s not standardized as you noted in the related issue. I’d personally prefer we avoid introducing things like this (there are a handful of non-standard status codes) into Requests. Primarily because we’ll get follow on PRs asking where the line is for status code x, y, z and if the IETF ever decides to use any of these codes we can’t “unrelease” versions of Requests with bad constants. Since this constant list has no effect on how Requests handles a received 419, I think we’re likely to pass on this. I’ll let @sigmavirus24 weigh in before we close this though.", "no problem. this PR was part thought experiment, part search for convenience. i'll close it." ]
https://api.github.com/repos/psf/requests/issues/4572
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4572/labels{/name}
https://api.github.com/repos/psf/requests/issues/4572/comments
https://api.github.com/repos/psf/requests/issues/4572/events
https://github.com/psf/requests/issues/4572
311,262,650
MDU6SXNzdWUzMTEyNjI2NTA=
4,572
Add HTTP 419 support to requests.codes
{ "avatar_url": "https://avatars.githubusercontent.com/u/1417779?v=4", "events_url": "https://api.github.com/users/mxmader/events{/privacy}", "followers_url": "https://api.github.com/users/mxmader/followers", "following_url": "https://api.github.com/users/mxmader/following{/other_user}", "gists_url": "https://api.github.com/users/mxmader/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mxmader", "id": 1417779, "login": "mxmader", "node_id": "MDQ6VXNlcjE0MTc3Nzk=", "organizations_url": "https://api.github.com/users/mxmader/orgs", "received_events_url": "https://api.github.com/users/mxmader/received_events", "repos_url": "https://api.github.com/users/mxmader/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mxmader/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mxmader/subscriptions", "type": "User", "url": "https://api.github.com/users/mxmader", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-04-04T14:48:18Z
2021-09-08T03:00:25Z
2018-04-04T16:30:42Z
NONE
resolved
Very simply, I would like to have HTTP 419 status code represented as a constant in the `requests.codes` module, perhaps as `requests.codes.AUTHENTICATION_TIMEOUT`. While this code is not officially (to my knowledge) part of an RFC / standard, it seems to have colloquial use / adoption on many Internet-facing web services. Here's another framework who is considering this support (granted, the context is a bit different WRT requests): GetBlimp/django-rest-framework-jwt#158 I'll post a basic PR to illustrate the request; no pressure to merge it as I am unsure what requests' policy on RFCs/standards is (whether or not dogmatic adherence thereto is a tenet/goal of this project).
{ "avatar_url": "https://avatars.githubusercontent.com/u/1417779?v=4", "events_url": "https://api.github.com/users/mxmader/events{/privacy}", "followers_url": "https://api.github.com/users/mxmader/followers", "following_url": "https://api.github.com/users/mxmader/following{/other_user}", "gists_url": "https://api.github.com/users/mxmader/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mxmader", "id": 1417779, "login": "mxmader", "node_id": "MDQ6VXNlcjE0MTc3Nzk=", "organizations_url": "https://api.github.com/users/mxmader/orgs", "received_events_url": "https://api.github.com/users/mxmader/received_events", "repos_url": "https://api.github.com/users/mxmader/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mxmader/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mxmader/subscriptions", "type": "User", "url": "https://api.github.com/users/mxmader", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4572/reactions" }
https://api.github.com/repos/psf/requests/issues/4572/timeline
null
completed
null
null
false
[ "> whether or not dogmatic adherence thereto is a tenet/goal of this project\r\n\r\n\"dogmatic\" is unnecessarily adversarial in this context and it is setting yourself up for rejection.\r\n\r\n---\r\n\r\nWe adhere to RFCs as best we can, but we also have edges where we allow for behaviour that isn't strictly RFC-compliant. Those areas are most frequently areas where we need to be smarter for security or slightly more like a browser. Our status code listing isn't something we're very stringent about but we do like to see actual consensus and wide-spread use. We also, however, support multiple reason phrases per status-code. So adding this one wouldn't preclude us from also supporting whatever the real standardized/accepted phrase becomes.\r\n\r\nAll that aside, it'd be helpful to know what benefit you see from `requests.codes.AUTHENTICATION_TIMEOUT` existing. As far as I can tell, there's little to no benefit, especially in the context of other libraries adopting it. So knowing why you would like this is far more valuable than knowing that you would like it.", "I was not _trying_ to be adversarial. I've merely dealt with different philosophies across projects -- some factually choose to be _dogmatic_ in their approach to problem solving as a way of defining structure -- this word should be taken in an objective context which is difficult to convey over such a flat, unexpressive medium as this. I intended to leave room for the authors / maintainers to express their stance (without such foreknowledge on my part) however they like... enabling me to figure out the next step in solving my own software development problem(s).\r\n\r\nA bit more about my use case:\r\n\r\nMy team has built a REST API which uses the \"Bearer Token\" authorization model. I have various consumers, one of which is a client based on `requests`. That REST API will return various status codes depending on the semantics of the response to a given request which requires authentication and authorization:\r\n\r\n- HTTP 401 Unauthorized: when no token is given _or_ an invalid/unknown token is given by the requestor\r\n- HTTP 403 Forbidden: when a valid, known token is given by the requestor (a client is thus identified/authenticated) but the requested resource requested falls outside their set of allowed resources (permission denied to the known client)\r\n- HTTP 419 Authentication Timeout: when an _expired_ token is given by the requestor\r\n\r\nThe case of submitting an _expired_ token is special, in that clients may choose to use the HTTP 419 status code value (instead of parsing and interpreting a potentially changing string in the response body of an HTTP 401 response) in order to more conveniently make a decision on what to do next.", "It seems easiest and least time consuming for those involved for the maintainer to wait for a standards body to make the decision on this particular response code." ]
https://api.github.com/repos/psf/requests/issues/4571
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4571/labels{/name}
https://api.github.com/repos/psf/requests/issues/4571/comments
https://api.github.com/repos/psf/requests/issues/4571/events
https://github.com/psf/requests/issues/4571
311,066,233
MDU6SXNzdWUzMTEwNjYyMzM=
4,571
Session not pickleable when using DigestAuth and Python3.6
{ "avatar_url": "https://avatars.githubusercontent.com/u/5866405?v=4", "events_url": "https://api.github.com/users/DenverJ/events{/privacy}", "followers_url": "https://api.github.com/users/DenverJ/followers", "following_url": "https://api.github.com/users/DenverJ/following{/other_user}", "gists_url": "https://api.github.com/users/DenverJ/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DenverJ", "id": 5866405, "login": "DenverJ", "node_id": "MDQ6VXNlcjU4NjY0MDU=", "organizations_url": "https://api.github.com/users/DenverJ/orgs", "received_events_url": "https://api.github.com/users/DenverJ/received_events", "repos_url": "https://api.github.com/users/DenverJ/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DenverJ/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DenverJ/subscriptions", "type": "User", "url": "https://api.github.com/users/DenverJ", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2018-04-04T02:46:08Z
2021-09-05T00:07:00Z
2019-02-14T14:58:08Z
NONE
resolved
A requests session cannot be pickled when using DigestAuth and Python3.6 because of this bug with Python3 - https://bugs.python.org/issue28967 and the referenced issue in that issue - https://bugs.python.org/issue22995 (Tested working with Python3.5.4). ## Expected Result Pickle call succeeds. ## Actual Result Exception. ``` C:\Dev\virtual_envs\play_3\Scripts\python.exe C:/Dev/play/requestspickle.py Traceback (most recent call last): File "C:/Dev/play/requestspickle.py", line 7, in <module> session_pickle = pickle.dumps(session) TypeError: can't pickle _thread._local objects ``` ## Reproduction Steps ```python import pickle import requests from requests.auth import HTTPDigestAuth session = requests.Session() session.auth = HTTPDigestAuth('user', 'passwd') pickle.dumps(session) ``` ## 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/6740665?v=4", "events_url": "https://api.github.com/users/lmiguelvargasf/events{/privacy}", "followers_url": "https://api.github.com/users/lmiguelvargasf/followers", "following_url": "https://api.github.com/users/lmiguelvargasf/following{/other_user}", "gists_url": "https://api.github.com/users/lmiguelvargasf/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lmiguelvargasf", "id": 6740665, "login": "lmiguelvargasf", "node_id": "MDQ6VXNlcjY3NDA2NjU=", "organizations_url": "https://api.github.com/users/lmiguelvargasf/orgs", "received_events_url": "https://api.github.com/users/lmiguelvargasf/received_events", "repos_url": "https://api.github.com/users/lmiguelvargasf/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lmiguelvargasf/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lmiguelvargasf/subscriptions", "type": "User", "url": "https://api.github.com/users/lmiguelvargasf", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4571/reactions" }
https://api.github.com/repos/psf/requests/issues/4571/timeline
null
completed
null
null
false
[ "Closed due to inactivity." ]
https://api.github.com/repos/psf/requests/issues/4570
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4570/labels{/name}
https://api.github.com/repos/psf/requests/issues/4570/comments
https://api.github.com/repos/psf/requests/issues/4570/events
https://github.com/psf/requests/pull/4570
310,809,129
MDExOlB1bGxSZXF1ZXN0MTc5MDc3ODAw
4,570
RequestsCookieJar - fixing the multiple_domains function
{ "avatar_url": "https://avatars.githubusercontent.com/u/10619637?v=4", "events_url": "https://api.github.com/users/e-humbert/events{/privacy}", "followers_url": "https://api.github.com/users/e-humbert/followers", "following_url": "https://api.github.com/users/e-humbert/following{/other_user}", "gists_url": "https://api.github.com/users/e-humbert/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/e-humbert", "id": 10619637, "login": "e-humbert", "node_id": "MDQ6VXNlcjEwNjE5NjM3", "organizations_url": "https://api.github.com/users/e-humbert/orgs", "received_events_url": "https://api.github.com/users/e-humbert/received_events", "repos_url": "https://api.github.com/users/e-humbert/repos", "site_admin": false, "starred_url": "https://api.github.com/users/e-humbert/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/e-humbert/subscriptions", "type": "User", "url": "https://api.github.com/users/e-humbert", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2018-04-03T12:07:41Z
2021-08-31T00:07:11Z
2019-06-08T13:19:45Z
NONE
resolved
PR resolving the issue : #4557 .
{ "avatar_url": "https://avatars.githubusercontent.com/u/10619637?v=4", "events_url": "https://api.github.com/users/e-humbert/events{/privacy}", "followers_url": "https://api.github.com/users/e-humbert/followers", "following_url": "https://api.github.com/users/e-humbert/following{/other_user}", "gists_url": "https://api.github.com/users/e-humbert/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/e-humbert", "id": 10619637, "login": "e-humbert", "node_id": "MDQ6VXNlcjEwNjE5NjM3", "organizations_url": "https://api.github.com/users/e-humbert/orgs", "received_events_url": "https://api.github.com/users/e-humbert/received_events", "repos_url": "https://api.github.com/users/e-humbert/repos", "site_admin": false, "starred_url": "https://api.github.com/users/e-humbert/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/e-humbert/subscriptions", "type": "User", "url": "https://api.github.com/users/e-humbert", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4570/reactions" }
https://api.github.com/repos/psf/requests/issues/4570/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4570.diff", "html_url": "https://github.com/psf/requests/pull/4570", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4570.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4570" }
true
[]
https://api.github.com/repos/psf/requests/issues/4569
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4569/labels{/name}
https://api.github.com/repos/psf/requests/issues/4569/comments
https://api.github.com/repos/psf/requests/issues/4569/events
https://github.com/psf/requests/issues/4569
310,330,303
MDU6SXNzdWUzMTAzMzAzMDM=
4,569
IDNAError when trying to GET a working url
{ "avatar_url": "https://avatars.githubusercontent.com/u/731464?v=4", "events_url": "https://api.github.com/users/erezsh/events{/privacy}", "followers_url": "https://api.github.com/users/erezsh/followers", "following_url": "https://api.github.com/users/erezsh/following{/other_user}", "gists_url": "https://api.github.com/users/erezsh/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/erezsh", "id": 731464, "login": "erezsh", "node_id": "MDQ6VXNlcjczMTQ2NA==", "organizations_url": "https://api.github.com/users/erezsh/orgs", "received_events_url": "https://api.github.com/users/erezsh/received_events", "repos_url": "https://api.github.com/users/erezsh/repos", "site_admin": false, "starred_url": "https://api.github.com/users/erezsh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/erezsh/subscriptions", "type": "User", "url": "https://api.github.com/users/erezsh", "user_view_type": "public" }
[]
closed
true
null
[]
null
10
2018-04-01T15:06:45Z
2021-09-08T01:21:17Z
2018-04-01T15:51:53Z
NONE
resolved
Getting some URLs cause an IDNAError, but they work just fine with curl and other url fetchers. ## Expected Result A successful request ## Actual Result idna.core.IDNAError: The label b'xn--mn8ha4uc' is not a valid A-label The label b'xn--mn8ha4uc' is not a valid A-label ## Reproduction Steps ```python import requests requests.get('https://thegroovecartel.com/feed/') ``` ## System Information $ python -m requests.help ``` { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "2.2.2" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.6.4" }, "platform": { "release": "4.15.12-201.fc26.x86_64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010008f", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1010007f" }, "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/4569/reactions" }
https://api.github.com/repos/psf/requests/issues/4569/timeline
null
completed
null
null
false
[ "```\r\n>>> import requests\r\n>>> \r\n>>> requests.get('https://thegroovecartel.com/feed/')\r\n<Response [200]>\r\n>>> import requests.help\r\n>>> requests.help.main()\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.6.4\"\r\n },\r\n \"platform\": {\r\n \"release\": \"4.15.7-300.fc27.x86_64\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1010007f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n },\r\n \"using_pyopenssl\": false\r\n}\r\n```\r\n\r\nI can't reproduce this.", "Ah, the \"it works for me\" rebuttal. How original.\r\nIf I had to guess, I'd say the issue is with pyopenssl.", "I was able to reproduce this by installing `requests[security]`. It looks like the certificate has many subjectAltNames, one of which is `xn-mn8ha4uc.ws` (Literally 👉 👈.ws in punycode).", "@erezsh, this isn't reproduceable with the steps you provided. The exception seems to only occur in due to the emoji modifiers being outside of the expected byte range:\r\n\r\npython 2:\r\n```python\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/Users/user/.pyenv/versions/2.7.13/lib/python2.7/site-packages/idna-2.6-py2.7.egg/idna/core.py\", line 302, in ulabel\r\n File \"/Users/user/.pyenv/versions/2.7.13/lib/python2.7/encodings/punycode.py\", line 208, in decode\r\n res = punycode_decode(input, errors)\r\n File \"/Users/user/.pyenv/versions/2.7.13/lib/python2.7/encodings/punycode.py\", line 195, in punycode_decode\r\n return insertion_sort(base, extended, errors)\r\n File \"/Users/user/.pyenv/versions/2.7.13/lib/python2.7/encodings/punycode.py\", line 180, in insertion_sort\r\n base = base[:pos] + unichr(char) + base[pos:]\r\nValueError: unichr() arg not in range(0x10000) (narrow Python build)\r\n```\r\npython 3:\r\n\r\n```python\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/Users/user/.pyenv/versions/3.4.7/lib/python3.4/site-packages/idna-2.6-py3.4.egg/idna/core.py\", line 303, in ulabel\r\n File \"/Users/user/.pyenv/versions/3.4.7/lib/python3.4/site-packages/idna-2.6-py3.4.egg/idna/core.py\", line 253, in check_label\r\nidna.core.InvalidCodepoint: Codepoint U+1F449 at position 1 of '👉\\U0001f3fb👈\\U0001f3fb' not allowed\r\n````\r\n\r\nThis is at the very least an issue for IDNA, but more likely a lack of support at the standard lib level. Sigmavirus24 is right to close this though because Requests can't do anything at this point due to lack of support in underlying libraries. I'd suggest opening a followup issue with the [idna library](https://github.com/kjd/idna) and see where they think the issue lies.", "@SethMichaelLarson @nateprewitt Thanks for the detailed response.\r\n\r\nI'm getting a different exception, but I'm guessing it's for the same reason.\r\n\r\nPerhaps relying on IDNA is not the best choice for requests, since it looks like it can work without it? \r\n\r\nAnyway, it's not my place to say. I just wanted to bring this to your attention.", "FYI I got the same exception as you on Python 3.6.4 in addition to @nateprewitt's exception:\r\n`idna.core.InvalidCodepoint: Codepoint U+1F449 at position 1 of '👉🏻👈🏻' not allowed`\r\n`idna.core.IDNAError: The label b'xn--mn8ha4uc' is not a valid A-label`", "> Perhaps relying on IDNA is not the best choice for requests, since it looks like it can work without it?\r\n\r\n@erezsh that's not accurate.\r\n\r\n> Anyway, it's not my place to say. I just wanted to bring this to your attention.\r\n\r\nPlease do bring it to the attention of [idna](/kjd/idna).", "Emojis are not valid in domain names... Really this is pyopenssl's fault, it should squash the error since it isn't relevant (invalid subjectAltName that doesn't match the domain we're fetching anyway).", "Filed at pyopenssl, who say it's not their bug to fix: https://github.com/pyca/pyopenssl/issues/771\r\n\r\nCurrent reproducer, with two exceptions generated:\r\n\r\n```\r\n>>> import requests\r\n>>> requests.__version__\r\n>>> requests.get(\"https://earthlingsoft.net/UnicodeChecker/appcast.xml\")\r\nTraceback (most recent call last):\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py\", line 271, in alabel\r\n ulabel(label)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py\", line 311, in ulabel\r\n check_label(label)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py\", line 261, in check_label\r\n raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))\r\nidna.core.InvalidCodepoint: Codepoint U+2603 at position 1 of '☃' not allowed\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/requests/api.py\", line 72, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/requests/api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/requests/sessions.py\", line 512, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/requests/sessions.py\", line 622, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/requests/adapters.py\", line 445, in send\r\n timeout=timeout\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py\", line 600, in urlopen\r\n chunked=chunked)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py\", line 343, in _make_request\r\n self._validate_conn(conn)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py\", line 849, in _validate_conn\r\n conn.connect()\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/connection.py\", line 367, in connect\r\n cert = self.sock.getpeercert()\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py\", line 351, in getpeercert\r\n 'subjectAltName': get_subj_alt_name(x509)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py\", line 228, in get_subj_alt_name\r\n for name in ext.get_values_for_type(x509.DNSName)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py\", line 228, in <listcomp>\r\n for name in ext.get_values_for_type(x509.DNSName)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py\", line 181, in _dnsname_to_stdlib\r\n name = idna_encode(name)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py\", line 179, in idna_encode\r\n return idna.encode(name)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py\", line 361, in encode\r\n s = alabel(label)\r\n File \"/Users/fx/anaconda3/lib/python3.6/site-packages/idna/core.py\", line 273, in alabel\r\n raise IDNAError('The label {0} is not a valid A-label'.format(label))\r\nidna.core.IDNAError: The label b'xn--n3h' is not a valid A-label\r\n```", "They're correct. This is firmly in `urllib3` in it's `urllib3.contrib.pyopenssl` module that uses pyOpenSSL. That's clear in the stack trace." ]
https://api.github.com/repos/psf/requests/issues/4568
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4568/labels{/name}
https://api.github.com/repos/psf/requests/issues/4568/comments
https://api.github.com/repos/psf/requests/issues/4568/events
https://github.com/psf/requests/issues/4568
310,087,159
MDU6SXNzdWUzMTAwODcxNTk=
4,568
Requests session adapter doesn't retry incomplete chunked responses, unlike urllib3
{ "avatar_url": "https://avatars.githubusercontent.com/u/813860?v=4", "events_url": "https://api.github.com/users/a3kov/events{/privacy}", "followers_url": "https://api.github.com/users/a3kov/followers", "following_url": "https://api.github.com/users/a3kov/following{/other_user}", "gists_url": "https://api.github.com/users/a3kov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/a3kov", "id": 813860, "login": "a3kov", "node_id": "MDQ6VXNlcjgxMzg2MA==", "organizations_url": "https://api.github.com/users/a3kov/orgs", "received_events_url": "https://api.github.com/users/a3kov/received_events", "repos_url": "https://api.github.com/users/a3kov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/a3kov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/a3kov/subscriptions", "type": "User", "url": "https://api.github.com/users/a3kov", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-03-30T14:58:47Z
2021-09-08T03:00:26Z
2018-04-01T15:57:14Z
NONE
resolved
IncompleteRead error from chunked responses are not retried with requests session and HTTPAdapter using Retry. If I use urllib3 directly, it's retried. ## Expected Result Similar to urllib3, it should be retried. IncompleteRead is a read error and Retry utility specifically states to support retrying of read errors. ## Actual Result It's not retried, raising ChunkedEncodingError instead ## Reproduction Steps ```python import pytest import requests from requests.adapters import HTTPAdapter from requests.exceptions import ChunkedEncodingError from requests.packages.urllib3.util.retry import Retry from urllib3 import PoolManager from urllib3.exceptions import MaxRetryError # This is bad example because it also returns content length header but this is the easiest way I found to reproduce. URL = "https://httpbin.org/response-headers?Content-Type=text%2Fplain%3B+charset%3DUTF-8&Transfer-Encoding=chunked&Server=httpbin" @pytest.fixture def retries(): return Retry(total=2) def test_requests_session_retry(retries): adapter = HTTPAdapter(max_retries=retries) session = requests.Session() session.mount('https://', adapter) with pytest.raises(ChunkedEncodingError): session.get(URL) def test_urllib3_retry(retries): http = PoolManager(retries=retries) with pytest.raises(MaxRetryError): response = http.request('GET', URL) ``` ## 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.0" }, "platform": { "release": "3.13.0-133-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010007f", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000106f" }, "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": 2, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 2, "url": "https://api.github.com/repos/psf/requests/issues/4568/reactions" }
https://api.github.com/repos/psf/requests/issues/4568/timeline
null
completed
null
null
false
[ "I believe your urllib3 example is incomplete. Requests does this:\r\n\r\n```py\r\nresponse = http.request('GET', URL, preload_content=False)\r\nfor chunk in response.stream():\r\n # build up requests.Response.content\r\n```\r\n\r\nIf I do that, I get the same problem in urllib3. (Although it's raised as a ProtocolError ... which you can see in the Requests traceback chain.)", "Does it mean \"working as intended\" ? Still it sucks that one has to apply additional layer of retry logic on top of existing retry utility..", "My comment means: This is not a bug in Requests. It should be discussed in urllib3 but I do not believe that we can handle this there as the Retry logic lives closer to the send functionality, and only works well if we do preload the body." ]
https://api.github.com/repos/psf/requests/issues/4567
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4567/labels{/name}
https://api.github.com/repos/psf/requests/issues/4567/comments
https://api.github.com/repos/psf/requests/issues/4567/events
https://github.com/psf/requests/issues/4567
310,037,926
MDU6SXNzdWUzMTAwMzc5MjY=
4,567
SystemError: error return without exception set
{ "avatar_url": "https://avatars.githubusercontent.com/u/3931761?v=4", "events_url": "https://api.github.com/users/SG5/events{/privacy}", "followers_url": "https://api.github.com/users/SG5/followers", "following_url": "https://api.github.com/users/SG5/following{/other_user}", "gists_url": "https://api.github.com/users/SG5/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SG5", "id": 3931761, "login": "SG5", "node_id": "MDQ6VXNlcjM5MzE3NjE=", "organizations_url": "https://api.github.com/users/SG5/orgs", "received_events_url": "https://api.github.com/users/SG5/received_events", "repos_url": "https://api.github.com/users/SG5/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SG5/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SG5/subscriptions", "type": "User", "url": "https://api.github.com/users/SG5", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2018-03-30T10:53:24Z
2021-09-04T00:06:30Z
2018-04-01T17:55:51Z
NONE
resolved
I have same issue from #4367 ``` Exception ignored in: <generator object urlsplit.<locals>.<genexpr> at 0x1087bdca8> Traceback (most recent call last): File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/parse.py", line 431, in <genexpr> if not rest or any(c not in '0123456789' for c in rest): SystemError: error return without exception set Exception ignored in: <generator object urlsplit.<locals>.<genexpr> at 0x108788830> Traceback (most recent call last): File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/parse.py", line 431, in <genexpr> if not rest or any(c not in '0123456789' for c in rest): SystemError: error return without exception set Exception ignored in: <generator object urlsplit.<locals>.<genexpr> at 0x108788360> Traceback (most recent call last): File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/parse.py", line 431, in <genexpr> if not rest or any(c not in '0123456789' for c in rest): SystemError: error return without exception set Exception ignored in: <generator object iter_slices at 0x108788360> Traceback (most recent call last): File "~/.venv/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 Exception ignored in: <generator object urlsplit.<locals>.<genexpr> at 0x1095fffc0> Traceback (most recent call last): File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/parse.py", line 431, in <genexpr> if not rest or any(c not in '0123456789' for c in rest): SystemError: error return without exception set Exception ignored in: <generator object iter_slices at 0x1095ffba0> Traceback (most recent call last): File "~/.venv/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 ``` It happens when I make requests in many `threading.Thread`
{ "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/4567/reactions" }
https://api.github.com/repos/psf/requests/issues/4567/timeline
null
completed
null
null
false
[ "As mentioned in #4367, this is not something that Requests controls. This is almost certianly coming from a library used at some point in the execution of the program (e.g., `json`) that has a C dependency and the threading is leading to this issue. There's nothing for Requests to do as far as we can tell with all of the given information we have.", "Have anyone figured out how to fix this issue?", "@fhlee74 I seem to have fixed this issue by running my script in a 2.7 env instead of 3.6. The issue did seem to be worse when running > 1 threads in 3.6 but would still happen with just one thread. On 2.7 I have 10 threads running again and haven't seen the exception.", "threads are tooooooooooooooooooooooooooooooooooooooooooooooo many ! This is a python's BUG, whether in 2.7 or 3.6 . You can try to use threads pool `from multiprocessing.pool import ThreadPool` . I have 8 threads running and no exception is thrown on 3.6.", "this helped me with python 3.7.3 and pycharm https://stackoverflow.com/a/52054289", "This worked for me too ^ " ]
https://api.github.com/repos/psf/requests/issues/4566
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4566/labels{/name}
https://api.github.com/repos/psf/requests/issues/4566/comments
https://api.github.com/repos/psf/requests/issues/4566/events
https://github.com/psf/requests/issues/4566
309,886,122
MDU6SXNzdWUzMDk4ODYxMjI=
4,566
Requests and urllib3 giving "bad handshake: SysCallError(-1, 'Unexpected EOF')" in a proxied environment on a non standard port
{ "avatar_url": "https://avatars.githubusercontent.com/u/12440040?v=4", "events_url": "https://api.github.com/users/tjs24/events{/privacy}", "followers_url": "https://api.github.com/users/tjs24/followers", "following_url": "https://api.github.com/users/tjs24/following{/other_user}", "gists_url": "https://api.github.com/users/tjs24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tjs24", "id": 12440040, "login": "tjs24", "node_id": "MDQ6VXNlcjEyNDQwMDQw", "organizations_url": "https://api.github.com/users/tjs24/orgs", "received_events_url": "https://api.github.com/users/tjs24/received_events", "repos_url": "https://api.github.com/users/tjs24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tjs24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tjs24/subscriptions", "type": "User", "url": "https://api.github.com/users/tjs24", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2018-03-29T20:05:15Z
2021-09-08T03:00:26Z
2018-04-01T15:50:40Z
NONE
resolved
Summary. Are urllib3 and/or requests modules facing problems when it comes to accessing HTTP(S) service(s) on non standard ports? ## Expected Result >python Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>import requests >>requests.get('https://somehost.com:8443', verify=False) 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 InsecureRequestWarning) <Response [200]> This is what is expected ## Actual Result What happened instead. ![image](https://user-images.githubusercontent.com/12440040/38110490-b96329ce-3350-11e8-803f-9dc3dd4220f9.png) I have referenced these blogs: https://www.bountysource.com/issues/30782175-requests-exceptions-sslerror-eof-occurred-in-violation-of-protocol-_ssl-c-645 https://github.com/requests/requests/issues/4272 >pip freeze asn1crypto==0.24.0 astroid==1.6.2 attrdict==2.0.0 cachetools==2.0.1 certifi==2017.7.27.1 cffi==1.11.5 chardet==3.0.4 colorama==0.3.9 cryptography==2.1.4 future==0.16.0 idna==2.6 isort==4.3.4 lazy-object-proxy==1.3.1 mccabe==0.6.1 ndg-httpsclient==0.4.4 pefile==2017.11.5 pika==0.10.0 prompt-toolkit==1.0.15 protobuf==3.4.0 pyasn1==0.4.2 pycparser==2.18 Pygments==2.2.0 pylint==1.8.3 pyOpenSSL==17.5.0 python-dateutil==2.6.1 PyYAML==3.12 requests==2.18.4 six==1.11.0 urllib3==1.22 wcwidth==0.1.7 wrapt==1.10.11 >openssl version OpenSSL 1.0.2k 26 Jan 2017 >python -c "import ssl; print(ssl.OPENSSL_VERSION)" OpenSSL 1.0.2d 9 Jul 2015 ## 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.5.0" }, "platform": { "release": "", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "1010007f", "version": "17.5.0" }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1000204f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": true } ``` Any help would be appreciated.
{ "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/4566/reactions" }
https://api.github.com/repos/psf/requests/issues/4566/timeline
null
completed
null
null
false
[ "@Lukasa i have tried solutions on your other blogs i mentioned above and none of them worked. I just wanted a bit more guidance.", "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`Unexpected EOF` means your server is closing the connection while we're trying to perform the TLS handshake. That's not a requests bug. For help with that, go to StackOverflow." ]
https://api.github.com/repos/psf/requests/issues/4565
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4565/labels{/name}
https://api.github.com/repos/psf/requests/issues/4565/comments
https://api.github.com/repos/psf/requests/issues/4565/events
https://github.com/psf/requests/issues/4565
309,802,761
MDU6SXNzdWUzMDk4MDI3NjE=
4,565
Url with vertical bar
{ "avatar_url": "https://avatars.githubusercontent.com/u/6846724?v=4", "events_url": "https://api.github.com/users/jerbluba/events{/privacy}", "followers_url": "https://api.github.com/users/jerbluba/followers", "following_url": "https://api.github.com/users/jerbluba/following{/other_user}", "gists_url": "https://api.github.com/users/jerbluba/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jerbluba", "id": 6846724, "login": "jerbluba", "node_id": "MDQ6VXNlcjY4NDY3MjQ=", "organizations_url": "https://api.github.com/users/jerbluba/orgs", "received_events_url": "https://api.github.com/users/jerbluba/received_events", "repos_url": "https://api.github.com/users/jerbluba/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jerbluba/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jerbluba/subscriptions", "type": "User", "url": "https://api.github.com/users/jerbluba", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2018-03-29T15:34:27Z
2018-03-29T16:48:25Z
2018-03-29T15:40:07Z
NONE
off-topic
I found if we have "|" vertical bar in url will show Expecting value: line 9 column 1 (char 16) The following is my code... req = requests.session() req.get('http://mis.twse.com.tw/stock/index.jsp',headers={'Accept-Language': 'zh-TW'}) response = req.get(self.query_url) print(content) self.query_url is aurl have "|" For example: http://mis.twse.com.tw/stock/api/getStockInfo.jsp?_=1522229112409&json=1&delay=0&ex_ch=tse_3374.tw|tse_2455.tw|tse_8086.tw|tse_3105.tw|tse_4991.tw|tse_2360.tw|tse_4971.tw|tse_6271.tw|tse_2448.tw|tse_2454.tw|tse_3443.tw|tse_3661.tw|tse_3035.tw|tse_2376.tw|tse_2377.tw ## Expected Result I hope I can read url with "vertical bar" ## Actual Result Expecting value: line 9 column 1 (char 16) ## Reproduction Steps ```python import requests req = requests.session() req.get('http://mis.twse.com.tw/stock/index.jsp',headers={'Accept-Language': 'zh-TW'}) response = req.get('http://mis.twse.com.tw/stock/api/getStockInfo.jsp?_=1522229112409&json=1&delay=0&ex_ch=tse_3374.tw|tse_2455.tw|tse_8086.tw|tse_3105.tw|tse_4991.tw|tse_2360.tw|tse_4971.tw|tse_6271.tw|tse_2448.tw|tse_2454.tw|tse_3443.tw|tse_3661.tw|tse_3035.tw|tse_2376.tw|tse_2377.tw' ) content = json.loads(response.text) print(content) ``` ## System Information version python3.6
{ "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/4565/reactions" }
https://api.github.com/repos/psf/requests/issues/4565/timeline
null
completed
null
null
false
[ "I cannot reproduce this locally on Python 3.6 with \r\n\r\n```json\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.6.3\"\r\n },\r\n \"platform\": {\r\n \"release\": \"17.4.0\",\r\n \"system\": \"Darwin\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"100020ef\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n },\r\n \"using_pyopenssl\": false\r\n}\r\n```\r\n\r\nThere isn't enough detail to help and I'm closing this. If you need help with code, please visit [StackOverflow](https://stackoverflow.com) as our issue tracker is only for bugs.", "I am sorry I modify the Reproduction Steps... \r\nCan you reproduce this again, please?", "@jerbluba with those refined, this firmly falls into Not a Bug territory. The JSON module (not provided by Requests) cannot decode something that isn't JSON, thus you need to handle that body separately. StackOverflow is the right place for this discussion.", "But I observe it by Wireshark,the \"vertical bar\" become \"%7C\" ,so I can't get json data from the url.\r\n\r\nPlease help me.\r\n\r\n![vertical_bar](https://user-images.githubusercontent.com/6846724/38101517-150fe228-33b3-11e8-98e0-c6158ccc397e.PNG)\r\n" ]
https://api.github.com/repos/psf/requests/issues/4564
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4564/labels{/name}
https://api.github.com/repos/psf/requests/issues/4564/comments
https://api.github.com/repos/psf/requests/issues/4564/events
https://github.com/psf/requests/issues/4564
309,430,538
MDU6SXNzdWUzMDk0MzA1Mzg=
4,564
[Python 3] Basic auth relying on utf-8 encoding by default
{ "avatar_url": "https://avatars.githubusercontent.com/u/6583243?v=4", "events_url": "https://api.github.com/users/princess-entrapta/events{/privacy}", "followers_url": "https://api.github.com/users/princess-entrapta/followers", "following_url": "https://api.github.com/users/princess-entrapta/following{/other_user}", "gists_url": "https://api.github.com/users/princess-entrapta/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/princess-entrapta", "id": 6583243, "login": "princess-entrapta", "node_id": "MDQ6VXNlcjY1ODMyNDM=", "organizations_url": "https://api.github.com/users/princess-entrapta/orgs", "received_events_url": "https://api.github.com/users/princess-entrapta/received_events", "repos_url": "https://api.github.com/users/princess-entrapta/repos", "site_admin": false, "starred_url": "https://api.github.com/users/princess-entrapta/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/princess-entrapta/subscriptions", "type": "User", "url": "https://api.github.com/users/princess-entrapta", "user_view_type": "public" }
[]
closed
false
null
[]
null
13
2018-03-28T16:01:08Z
2024-05-19T19:07:07Z
2024-05-19T19:07:06Z
NONE
null
I got deceived by default requests behavior for auth headers. As using a password containing some non-ascii chars, the basic auth method silently encoded in latin1, which caused authentication to fail as it was expected to be utf-8 encoded server side. Utf-8 is default encoding in modern terminals and in python3 strings. As a result, requests behavior for auth is asymmetrical with curl and is odd when being reversed by authentication servers. Requests is expected to fail on non-binary input, or comply to web standards of using utf-8 text strings. As a workaround I encoded the string in utf-8 beforehand authing with requests. ## Reproduction Steps ```python import requests requests.get('https://example.com', auth=('user', 'àéïòù')) ``` ## Expected Result Basic auth header is base64encoded version of "user:àéïòù".encode('utf-8') ## Actual Result Basic auth header is base64encoded version of "user:àéïòù".encode('latin1') ## Workaround requests.get('https://example.com', auth=('user', 'àéïòù'.encode('utf-8')))
{ "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": 13, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 13, "url": "https://api.github.com/repos/psf/requests/issues/4564/reactions" }
https://api.github.com/repos/psf/requests/issues/4564/timeline
null
completed
null
null
false
[ "We could extend https://github.com/requests/requests/blob/b66908e7b647689793e299edc111bf9910e93ad3/requests/auth.py#L79 to accept an encoding and that could pass it through to https://github.com/requests/requests/blob/b66908e7b647689793e299edc111bf9910e93ad3/requests/auth.py#L28 but the extra parameter there would need to default to `latin-1` as it does not. Alternatively, this could be added to the [toolbelt](/requests/toolbelt)", "If we added an extra param does that give us anything new? The current solution we have was provided in #3662 and gives the user the option to choose by sending unambiguous bytes. It also prevents parameter creep on many functions we *could* provide an encoding. As for defaults, most of the other recent choices made around iso-8859-1 vs utf-8 suggest there isn’t a “right” choice.\r\n\r\nAs @sigmavirus24 said, we need to maintain the latin-1 default for backwards compat on Requests 2.X. For Requests 3.0, if we enforce a hard fail on a non-bytes value, does that provides a better user experience? I’m not sure it does. If we change the defaults for the whole library to UTF-8 does that put us more inline with the 2018 web? Probably, but it would be nice to have some solid numbers/specifications on that.", "@nateprewitt It seems to me utf-8 is a quite broadly accepted default regarding text encoding in web content, it also is the default encoding of Python strings. On the other hand, what was the justification for using iso-8859-1 specifically, even in lower Request versions ? \r\n\r\nEither failing on non-bytes or silently encoding in utf-8 are behavior I believe more expectable in user perspective and more coherent within the general environment. In case an arbitrary behavior need to be maintained, I believe a proper documentation warning would also help. Personally I had to browse source code in order to understand what went on under the hood.", "@arthur-hav Most of the web still implements HTTP/1.1 as defined in RFC 2616 with some exceptional cases following the revisions in 7230, 7231, 7232, 7233, 7234, and 7235. The default encoding for the web is latin-1. Presuming that encoding is the safest backwards-compatible solution. We've been plenty fair in offering other ways to handle this, but it seems like you want to make a backwards incompatible break without understanding the history of the library or the specification it implements.", "@sigmavirus24 As much as I understand from wikipedia and discussion on web auth header https://stackoverflow.com/questions/7242316/what-encoding-should-i-use-for-http-basic-authentication the issue was never really settled on non-ascii characters although, fact I was unaware of, the RFC 2616 did state iso-8859-1 to be the default encoding for headers.\r\n\r\nI am not really set on \"what I want\" and certainly won't insist on making changes that are likely to break things. That being said, I would certainly advocate toward making it easier to realize what is going on when trying to authenticate with non-ascii character passwords. Curl defaults to utf-8, apparently major web browsers as well, so it is to be expected a fair part of interfaces will expect utf-8 too and disregard the 1999 RFC, making this a possible common pitfall.", "Hello,\r\n\r\nquite some time passed since this issues was discussed.\r\nI also would like to opt in for using UTF-8 by default - in my case I can't use my corporate proxy with pip with my proper password using latin1.\r\nThe issues is related to https://github.com/pypa/pip/issues/5801\r\n\r\n@chrahunt writes there:\r\n> It is probably safe to assume that the encoding of credential fields should be UTF-8 as:\r\n> \r\n> 1. Browsers use it ([source](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#Character_encoding_of_HTTP_authentication))\r\n> 2. When servers want to request a specific charset, their only option is UTF-8. ([source](https://tools.ietf.org/html/rfc7617#section-2.1))\r\n\r\nAlso in the meanwhile python2 is outdated and python3 uses UTF8 by default.\r\n\r\nSo there should be no need on enforcing latin1 anymore.\r\nIf you still want to enforce backward compatibility, I would suggest this:\r\nA (dirty) workaround: Catch the UnicodeEncodeError and try to encode in UTF8 in this case.\r\nAs UTF8 is based on latin1 this should work for probably 90% of the cases and is backward compatible, still allowing pip users to use non latin1 passwords.\r\n\r\n```python\r\n # We use latin1 for backwards compatibility by default but allow\r\n # unicode once we can't encode latin1\r\n if isinstance(username, str):\r\n try:\r\n username = username.encode('latin1')\r\n except UnicodeEncodeError:\r\n username = username.encode('utf8')\r\n\r\n if isinstance(password, str):\r\n try:\r\n password = password.encode('latin1')\r\n except UnicodeEncodeError:\r\n password = password.encode('utf8')\r\n password = password.encode('utf8')\r\n ```\r\n\r\nPlease comment so it can be decided which way to go - pure UTF8 or dirty catching non latin1.", "@sigmavirus24 Can I change your mind on this topic? \r\nAs requests is the base for pip it actually breaks things for users. \r\nAs today all modern browser use UTF-8, it is cumbersome for users to be forced to use latin1 (there is no choice when using pip, as you can't add byte code to the config).\r\n\r\nSo from a user perspective it is quite strange that auth fails with requests but works with all browsers and curl.\r\n\r\nIf people need backwards compatibility they still could use bytecode to encode to latin-1. For me these \"numbers\" (and the issues linked) would be actually enough to switch to a default UTF-8 - at least on Unicode errors and switch to utf8 default on a new major release.\r\n\r\nI know requests want to continue support Python2 - so maybe some could help adopting the snipped so it will work in Python2 as well (could not check so far).", "Also note: Just short after the last comment (before mine) Mozilla made the change to UTF8 (following Chrome): https://www.fxsitecompat.dev/en-CA/docs/2018/basic-auth-credentials-are-now-encoded-in-utf-8-instead-of-iso-8859-1/\r\n\r\nSo this is an two years old issue and old major browsers and tools use UTF8 as default option for years now and the new standard (RFC7617) clearly states basically that UTF8 is the only option.\r\nThis might be the time to assume it is safe to switch ;-)\r\n@sigmavirus24 @nateprewitt what do you think?", "@CarliJoy I'm no longer a maintainer and the maintenance team is focusing on the bare minimum work to keep Requests _secure_ at this point.\r\n\r\n> So this is an two years old issue and old major browsers and tools use UTF8 as default option for years now and the new standard (RFC7617) clearly states basically that UTF8 is the only option.\r\n\r\nThis is all great and well until you consider that there are servers out there that people still need to interact with that haven't been updated much past the era of RFC 2616 and suddenly sending UTF8 doesn't work for them.\r\n\r\nFurther no project attempting to follow SemVer can change this kind of behaviour in anything other than a major version release (e.g., requests 3.0) and that's unlikely to happen any time soon. While I'm not diametrically opposed to the behaviour, I also have no say in the matter. Please check next time before tagging someone in multiple comments to see if they're still relevant to the project.", "Having wasted a good hour of an otherwise fine evening on this before finding this - kind of surprising to see a modern library these days catering to a spec dating two decades(!) back, but anyway - easily worked around by manually setting the auth header:\r\n\r\n```python\r\nb64bytes = base64.b64encode(f'{username}:{password}'.encode('utf-8'))\r\nuserpass_encoded = 'Basic ' + str(b64bytes, 'utf-8')\r\n\r\nr = requests.post(url, data=json.dumps(payload), headers={'Authorization': str(userpass_encoded)})\r\n```", "@anderseknert arthur-hav suggested an easier workaround already in the issue itself:\r\n`requests.get('https://example.com', auth=(username.encode('utf-8), password.encode('utf-8')))`\r\n\r\nNo need to manipulate the header itself.", "Thanks @CarliJoy - seems I missed that somehow - probably since I had the workaround in place already when coming here :) That's indeed better.", "Changing this requires a backwards incompatible change which IMO isn't worth the squeeze right now. Closing this unless others have stronger opinions." ]
https://api.github.com/repos/psf/requests/issues/4563
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4563/labels{/name}
https://api.github.com/repos/psf/requests/issues/4563/comments
https://api.github.com/repos/psf/requests/issues/4563/events
https://github.com/psf/requests/issues/4563
309,278,944
MDU6SXNzdWUzMDkyNzg5NDQ=
4,563
TypeError: request() got an unexpected keyword argument 'file'
{ "avatar_url": "https://avatars.githubusercontent.com/u/814292?v=4", "events_url": "https://api.github.com/users/le9i0nx/events{/privacy}", "followers_url": "https://api.github.com/users/le9i0nx/followers", "following_url": "https://api.github.com/users/le9i0nx/following{/other_user}", "gists_url": "https://api.github.com/users/le9i0nx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/le9i0nx", "id": 814292, "login": "le9i0nx", "node_id": "MDQ6VXNlcjgxNDI5Mg==", "organizations_url": "https://api.github.com/users/le9i0nx/orgs", "received_events_url": "https://api.github.com/users/le9i0nx/received_events", "repos_url": "https://api.github.com/users/le9i0nx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/le9i0nx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/le9i0nx/subscriptions", "type": "User", "url": "https://api.github.com/users/le9i0nx", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2018-03-28T09:02:21Z
2021-09-01T00:11:26Z
2018-03-28T10:45:38Z
NONE
resolved
In the documentation it is written that so it is possible to make a request, but there is an exception. I first tested it on version 2.12.4. And then checked on the latest available (2.18.4). http://docs.python-requests.org/en/stable/user/quickstart/#post-a-multipart-encoded-file ## Expected Result Running the query ## Actual Result TypeError: request() got an unexpected keyword argument 'file' ## Reproduction Steps ```python import requests payload = {"param_1": "value_1", "param_2": "value_2"} files = { 'json': (None, json.dumps(payload), 'application/json'), 'file': ('log', "11" ) } post = requests.post(API_HOST+API_URL, file=files) print(post.content) ``` ## System Information $ python -m requests.help ``` root@5cf05c9a3e78:/app# python3 -m requests.help { "chardet": { "version": "3.0.4" }, "cryptography": { "version": "" }, "idna": { "version": "2.6" }, "implementation": { "name": "CPython", "version": "3.5.3" }, "platform": { "release": "4.9.0-6-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.18.4" }, "system_ssl": { "version": "1010006f" }, "urllib3": { "version": "1.22" }, "using_pyopenssl": false } ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/814292?v=4", "events_url": "https://api.github.com/users/le9i0nx/events{/privacy}", "followers_url": "https://api.github.com/users/le9i0nx/followers", "following_url": "https://api.github.com/users/le9i0nx/following{/other_user}", "gists_url": "https://api.github.com/users/le9i0nx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/le9i0nx", "id": 814292, "login": "le9i0nx", "node_id": "MDQ6VXNlcjgxNDI5Mg==", "organizations_url": "https://api.github.com/users/le9i0nx/orgs", "received_events_url": "https://api.github.com/users/le9i0nx/received_events", "repos_url": "https://api.github.com/users/le9i0nx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/le9i0nx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/le9i0nx/subscriptions", "type": "User", "url": "https://api.github.com/users/le9i0nx", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/4563/reactions" }
https://api.github.com/repos/psf/requests/issues/4563/timeline
null
completed
null
null
false
[ "excuse me. I was inattentive\r\n", "I ran into the same issue — could you tell, how you worked it out?", "Argh, got it: the keyword is 'files', not 'file'." ]
https://api.github.com/repos/psf/requests/issues/4562
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/4562/labels{/name}
https://api.github.com/repos/psf/requests/issues/4562/comments
https://api.github.com/repos/psf/requests/issues/4562/events
https://github.com/psf/requests/pull/4562
309,143,535
MDExOlB1bGxSZXF1ZXN0MTc3ODcyODEx
4,562
respect reply-afer in automatic redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/1790880?v=4", "events_url": "https://api.github.com/users/kgk/events{/privacy}", "followers_url": "https://api.github.com/users/kgk/followers", "following_url": "https://api.github.com/users/kgk/following{/other_user}", "gists_url": "https://api.github.com/users/kgk/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kgk", "id": 1790880, "login": "kgk", "node_id": "MDQ6VXNlcjE3OTA4ODA=", "organizations_url": "https://api.github.com/users/kgk/orgs", "received_events_url": "https://api.github.com/users/kgk/received_events", "repos_url": "https://api.github.com/users/kgk/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kgk/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kgk/subscriptions", "type": "User", "url": "https://api.github.com/users/kgk", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2018-03-27T21:38:44Z
2021-08-31T00:07:15Z
2018-03-28T12:03:11Z
NONE
resolved
small patch that respects replay-after only in automatic redirects .. similar to chrome, firefox and others. reply-after is not handled for other status codes such as 503, and 429 as the handling may application specific. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
{ "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/4562/reactions" }
https://api.github.com/repos/psf/requests/issues/4562/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/4562.diff", "html_url": "https://github.com/psf/requests/pull/4562", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/4562.patch", "url": "https://api.github.com/repos/psf/requests/pulls/4562" }
true
[ "There's already logic for respecting the `Retry-After` header within urllib3, one of Requests core modules. You may need to write your own Adapter in order for this logic to be used.", "We did not see it being respected.\n\nwe have seen web-sites returning 30X with retry-after headers and we hit\nmax-redirects < 1 seconds while the site has exponential backoff.\nThese redirects are handled by major browsers correctly waiting the\nassigned period.\n\nII have scanned the urllib3 docs but did not come across any mention of the\nheader handling.. can you point me to it or some way to enable it ?\n\nThanks,\n\n\n\nOn Tue, Mar 27, 2018 at 2:59 PM, Seth M. Larson <[email protected]>\nwrote:\n\n> There's already logic for respecting the Retry-After header within\n> urllib3, one of Requests core modules. Is that not already being leveraged?\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/pull/4562#issuecomment-376689647>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ABtToApXulkzVvFYUzJVWHZ4YyAK22hBks5tirYwgaJpZM4S9rkS>\n> .\n>\n\n\n\n-- \nKristian G. Kvilekval ([email protected]) 805-636-1599\n", "See the parameter: `respect_retry_after_header` in the [documentation](https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.retry.Retry) and on [GitHub](https://github.com/shazow/urllib3/blob/master/urllib3/util/retry.py#L138).", "Hi @kgk, @SethMichaelLarson is right that urllib3 provides this functionality and it would be better to try and leverage that. The issue with redirects is that we don’t use urllib3 for those and instead create a new request ourselves. I know there are historical reasons for this but I can’t find an issue for reference immediately. I’ll try to take a look into what would be needed to support this tonight.", "A quick look at adapters.py makes me think it would be hard to put at\r\nurllib3 level since redirects are specifically disabled. Solutions such as\r\ncovered here\r\nhttps://www.peterbe.com/plog/best-practice-with-retries-with-requests make\r\nsense for the 503 and 429 status codes. But requests is handling 30X\r\ninternally (when allow_redirects is enabled) so it may need to also handle\r\nthe requested delays.\r\n\r\n", "You can leverage urllib3 retries directly as described [here](http://www.coglib.com/~icordasc/blog/2014/12/retries-in-requests.html)", "As mentioned by @nateprewitt redirect are disabled in urllib3 by requests. Retries (on failed connects, reads etc) can be implemented as described by @sigmavirus24 , but since redirects are not handled there it cannot be used. For the record, I have confirmed that urllib3 does support the retry-after header while requests does not. " ]