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/6108
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6108/labels{/name}
https://api.github.com/repos/psf/requests/issues/6108/comments
https://api.github.com/repos/psf/requests/issues/6108/events
https://github.com/psf/requests/issues/6108
1,205,810,592
I_kwDOABTKOs5H3zWg
6,108
Proxies are used by prepared requests without merging in environment settings
{ "avatar_url": "https://avatars.githubusercontent.com/u/29556373?v=4", "events_url": "https://api.github.com/users/JustAnotherArchivist/events{/privacy}", "followers_url": "https://api.github.com/users/JustAnotherArchivist/followers", "following_url": "https://api.github.com/users/JustAnotherArchivist/following{/other_user}", "gists_url": "https://api.github.com/users/JustAnotherArchivist/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JustAnotherArchivist", "id": 29556373, "login": "JustAnotherArchivist", "node_id": "MDQ6VXNlcjI5NTU2Mzcz", "organizations_url": "https://api.github.com/users/JustAnotherArchivist/orgs", "received_events_url": "https://api.github.com/users/JustAnotherArchivist/received_events", "repos_url": "https://api.github.com/users/JustAnotherArchivist/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JustAnotherArchivist/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JustAnotherArchivist/subscriptions", "type": "User", "url": "https://api.github.com/users/JustAnotherArchivist", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2022-04-15T19:21:31Z
2023-04-18T00:03:01Z
2022-04-16T14:53:25Z
NONE
resolved
According to the documentation, sending prepared requests does not merge in environment settings unless that is done manually via `s.merge_environment_settings`. However, I'm observing the `*_PROXY` variables being used while `REQUESTS_CA_BUNDLE` is not. mitmproxy on the default 127.0.0.1:8080; CPython 3.10.1, requests 2.27.1 on Debian Sid ### HTTP, no env merging > http_proxy=http://127.0.0.1:8080 HTTPS_PROXY=http://127.0.0.1:8080 REQUESTS_CA_BUNDLE=~/.mitmproxy/mitmproxy-ca.pem python3 -c 'import requests; s = requests.Session(); r = s.prepare_request(requests.Request("GET", "http://example.org/")); s.send(r)' This request goes through the proxy when it shouldn't. (The CA bundle is obviously not relevant.) ### HTTPS, no env merging ``` > http_proxy=http://127.0.0.1:8080 HTTPS_PROXY=http://127.0.0.1:8080 REQUESTS_CA_BUNDLE=~/.mitmproxy/mitmproxy-ca.pem python3 -c 'import requests; s = requests.Session(); r = s.prepare_request(requests.Request("GET", "https://example.org/")); s.send(r)' [...] ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997) ``` Again, uses the proxy when it shouldn't. However, the CA bundle is not loaded, causing the verification to fail. ### HTTPS with env merging > http_proxy=http://127.0.0.1:8080 HTTPS_PROXY=http://127.0.0.1:8080 REQUESTS_CA_BUNDLE=~/.mitmproxy/mitmproxy-ca.pem python3 -c 'import requests; s = requests.Session(); r = s.prepare_request(requests.Request("GET", "https://example.org/")); s.send(r, **s.merge_environment_settings(r.url, {}, None, None, None))' Goes through the proxy and passes certificate verification, as expected.
{ "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/6108/reactions" }
https://api.github.com/repos/psf/requests/issues/6108/timeline
null
completed
null
null
false
[ "Prepared Requests do not contain proxy settings as you seem to think they do. That is a separate step and is passed as a parameter to `Session.send` so the code you're using is making assumptions that are invalid. To control proxies, you must tell `Session.send` what to do.", "To be clear, the certificate bundle is also handled as a setting to `Session.send` because you're side-stepping https://github.com/psf/requests/blob/2d5517682b3b38547634d153cea43d48fbc8cdb5/requests/sessions.py#L453-L527 and so you need to be telling us what certificate bundle you intend for us to use etc. to get the behaviour you want.", "@sigmavirus24 But that's exactly my point. Prepared requests should not be using the environment variables, but as shown above, they *do* use the `*_PROXY` variable (but not the `REQUESTS_CA_BUNDLE` one).\r\n\r\nThe [documentation](https://docs.python-requests.org/en/latest/user/advanced/#prepared-requests) (at the end of that section) says:\r\n\r\n> When you are using the prepared request flow, keep in mind that it does not take into account the environment.\r\n\r\nTherefore, I would expect that it would ignore `*_PROXY` entirely without a `merge_environment_settings` call. But it doesn't do that...\r\n\r\nSo either this needs a doc update (undefined behaviour?), although the wording there shows a pretty clear intent of ignoring *all* environment variables, not just some. Or it's a bug.", "The documentation is _slightly_ incorrect. As I said, you need to pass something to `send` even if it's just `proxies={}`, otherwise, in order to provide a default we may conditionally pull it from the environment: https://github.com/psf/requests/blob/2d5517682b3b38547634d153cea43d48fbc8cdb5/requests/sessions.py#L619-L622\r\n\r\nIf you never want to trust the environment, you should always set `Session.trust_env = False` which is documented as being the canonical and correct way to ignore env vars.\r\n", "I see. That's not documented anywhere either as far as I can see. `Session.send`'s documentation doesn't even mention what kwargs it accepts. So yeah, definitely needs some documentation changes then I think, at least in the section I referenced but ideally also on `Session.send`." ]
https://api.github.com/repos/psf/requests/issues/6107
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6107/labels{/name}
https://api.github.com/repos/psf/requests/issues/6107/comments
https://api.github.com/repos/psf/requests/issues/6107/events
https://github.com/psf/requests/issues/6107
1,201,325,848
I_kwDOABTKOs5HmscY
6,107
Session() object proxies attribute override by Windows registry proxy settings
{ "avatar_url": "https://avatars.githubusercontent.com/u/100788243?v=4", "events_url": "https://api.github.com/users/guodan-atl/events{/privacy}", "followers_url": "https://api.github.com/users/guodan-atl/followers", "following_url": "https://api.github.com/users/guodan-atl/following{/other_user}", "gists_url": "https://api.github.com/users/guodan-atl/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/guodan-atl", "id": 100788243, "login": "guodan-atl", "node_id": "U_kgDOBgHoEw", "organizations_url": "https://api.github.com/users/guodan-atl/orgs", "received_events_url": "https://api.github.com/users/guodan-atl/received_events", "repos_url": "https://api.github.com/users/guodan-atl/repos", "site_admin": false, "starred_url": "https://api.github.com/users/guodan-atl/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/guodan-atl/subscriptions", "type": "User", "url": "https://api.github.com/users/guodan-atl", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-04-12T07:45:15Z
2023-04-13T00:02:58Z
2022-04-12T14:03:58Z
NONE
resolved
On Windows, the proxy settings in Windows Registry will override the `proxies` attribute in `session` object. Here is a sample code: ```python import requests url = 'https://finance.yahoo.com/quote/AAPL/history' params = {'period1': 1648497600, 'period2': 1649793599, 'interval': '1d', 'frequency': '1d', 'filter': 'history'} proxies = {'http': 'socks5h://127.0.0.1:10808', 'https': 'socks5h://127.0.0.1:10808'} headers = {'User-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} # using session session = requests.Session() session.headers.update(headers) session.proxies.update(proxies) # r1 = session.get(url, params=params) # this line will raise exception # # Exception has occurred: SSLError # HTTPSConnectionPool(host='finance.yahoo.com', port=443): Max retries exceeded with url: /quote/AAPL/history?period1=1648497600&period2=1649793599&interval=1d&frequency=1d&filter=history (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))) # using requests.get r2 = requests.get(url, params=params, headers=session.headers, proxies=session.proxies) # OKAY r3 = requests.get(url, params=params, headers=headers, proxies=proxies) # OKAY r4 = session.get(url, params=params, headers=headers, proxies=proxies) # OKAY ``` ## Expected Result By setting `proxies` in `Session` object, the `r1` line should use this setting and return successfully, like `r2`, `r3` and `r4`. ## Actual Result `r1 = session.get(url, params=params)` line raises exception, since it is not using the proxy as specified in my code. By tracing into the source code of `requests`, I found the `proxies` setting in `Session` object is override by Windows registry's proxy settings, hence an Exception is raised. Below I listed the relevant pieces of codes along with the variable content of proxies. ```python # my code proxies = {'https': 'socks5h://127.0.0.1:10808'} session.proxies.update(proxies) r1 = session.get(url, params=params) # requests > sessions.py > Session > get def get(self, url, **kwargs) #... return self.request('GET', url, **kwargs) # requests > sessions.py class Session: # ... def request(...): #... proxies = proxies or {} # after this, proxies is {} settings = self.merge_environment_settings( prep.url, proxies, stream, verify, cert ) # now settings['proxies'] is: #. OrderedDict([('https', 'https://127.0.0.1:10809'), ('http', 'http://127.0.0.1:10809'), ('ftp', 'ftp://127.0.0.1:10809')]) def merge_environment_settings(...): #... env_proxies = get_environ_proxies(url, no_proxy=no_proxy) # after this call, env_proxies ends to be: # {'http': 'http://127.0.0.1:10809', 'https': 'https://127.0.0.1:10809', 'ftp': 'ftp://127.0.0.1:10809'} #... # before entering merge_setting(), proxies= # {'http': 'http://127.0.0.1:10809', 'https': 'https://127.0.0.1:10809', 'ftp': 'ftp://127.0.0.1:10809'} # self.proxies={'https': 'socks5h://127.0.0.1:10808'} proxies = merge_setting(proxies, self.proxies) # after exit of merge_setting(), proxies= # OrderedDict([('https', 'https://127.0.0.1:10809'), ('http', 'http://127.0.0.1:10809'), ('ftp', 'ftp://127.0.0.1:10809')]) # which is completely different from what I expected # requests > utils.py def get_environ_proxies(url, no_proxy=None): #... return getproxies() # urllib> request.py def get proxies(): return getproxies_environment() or getproxies_registry() # urllib> request.py def getproxies_registry(): # .... return proxies # here, proxies ends to be: {'http': 'http://127.0.0.1:10809', 'https': 'https://127.0.0.1:10809', 'ftp': 'ftp://127.0.0.1:10809'}, which is taken from Windows Regsitry # requests > sessions.py def merge_setting(request_setting, session_setting, dict_class=OrderedDict): # this function considers the first argument as setting (eg proxies) within request; however, with the study above, # it could be a setting from system registry. My take is that it is of the lower priority than session setting, which is lower # request setting. ``` ## Reproduction Steps Refer to the post above. ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.8" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.7" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010cf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "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/6107/reactions" }
https://api.github.com/repos/psf/requests/issues/6107/timeline
null
completed
null
null
false
[ "In the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/6106
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6106/labels{/name}
https://api.github.com/repos/psf/requests/issues/6106/comments
https://api.github.com/repos/psf/requests/issues/6106/events
https://github.com/psf/requests/pull/6106
1,201,028,406
PR_kwDOABTKOs42Dr_0
6,106
Rewrite version checks and split using iteration protocol
{ "avatar_url": "https://avatars.githubusercontent.com/u/16971163?v=4", "events_url": "https://api.github.com/users/oyeyipo/events{/privacy}", "followers_url": "https://api.github.com/users/oyeyipo/followers", "following_url": "https://api.github.com/users/oyeyipo/following{/other_user}", "gists_url": "https://api.github.com/users/oyeyipo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/oyeyipo", "id": 16971163, "login": "oyeyipo", "node_id": "MDQ6VXNlcjE2OTcxMTYz", "organizations_url": "https://api.github.com/users/oyeyipo/orgs", "received_events_url": "https://api.github.com/users/oyeyipo/received_events", "repos_url": "https://api.github.com/users/oyeyipo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/oyeyipo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/oyeyipo/subscriptions", "type": "User", "url": "https://api.github.com/users/oyeyipo", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2022-04-12T04:37:35Z
2023-04-14T00:03:23Z
2022-04-12T04:41:12Z
NONE
resolved
Make use of `map` and sequence unpacking in an iteration context to make the codes a little bit declarative.
{ "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/6106/reactions" }
https://api.github.com/repos/psf/requests/issues/6106/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6106.diff", "html_url": "https://github.com/psf/requests/pull/6106", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6106.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6106" }
true
[ "Hi @oyeyipo, thanks for the PR. This is actually a duplicate of #5334 and #5281. Please make sure to check open and closed PRs before opening new ones.", "Hey @nateprewitt, thanks for the suggestion. Did do a cursory scan of opened pr first page. Now, took a practical look at search techniques at [github pr search](https://docs.github.com/en/enterprise-cloud@latest/search-github/searching-on-github/searching-issues-and-pull-requests) and also search for filename and code, could not surface this and the other closed PRs. How would you go about this? thanks.", "Searching either the function name \"[check_compatibility](https://github.com/psf/requests/pulls?q=is%3Apr+check_compatibility+is%3Aclosed)\" or phrase \"[version check](https://github.com/psf/requests/pulls?q=is%3Apr+version+check+is%3Aclosed+)\" like you've used will return the previous issues.", "confirmed :thumbsup: thanks" ]
https://api.github.com/repos/psf/requests/issues/6105
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6105/labels{/name}
https://api.github.com/repos/psf/requests/issues/6105/comments
https://api.github.com/repos/psf/requests/issues/6105/events
https://github.com/psf/requests/issues/6105
1,198,769,729
I_kwDOABTKOs5Hc8ZB
6,105
Session.close() doesn't work within WSL2
{ "avatar_url": "https://avatars.githubusercontent.com/u/8088354?v=4", "events_url": "https://api.github.com/users/RoadToDream/events{/privacy}", "followers_url": "https://api.github.com/users/RoadToDream/followers", "following_url": "https://api.github.com/users/RoadToDream/following{/other_user}", "gists_url": "https://api.github.com/users/RoadToDream/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/RoadToDream", "id": 8088354, "login": "RoadToDream", "node_id": "MDQ6VXNlcjgwODgzNTQ=", "organizations_url": "https://api.github.com/users/RoadToDream/orgs", "received_events_url": "https://api.github.com/users/RoadToDream/received_events", "repos_url": "https://api.github.com/users/RoadToDream/repos", "site_admin": false, "starred_url": "https://api.github.com/users/RoadToDream/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RoadToDream/subscriptions", "type": "User", "url": "https://api.github.com/users/RoadToDream", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-04-09T21:00:49Z
2023-04-11T00:03:29Z
2022-04-10T00:58:48Z
NONE
resolved
<!-- Summary. --> ## Expected Result <!-- What you expected. --> ## Actual Result <!-- What happened instead. --> I have a nodejs server uses session to store user login info and the auth will immediately invalidated after session closed. However, it still has access to the server after session closed. ## Reproduction Steps ```python import requests s=requests.Session() url_login = 'http://localhost:8080/login' url_postStatus = 'http://localhost:8080/postStatus' loginInfo={'UserEmail':[email protected]','UserPassword':'test'} s.post(url_login,data=loginInfo) s.post(url_postStatus) s.close() s.post(url_postStatus) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.2" }, "platform": { "release": "5.10.16.3-microsoft-standard-WSL2", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010bf" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": true, "using_pyopenssl": false } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6105/reactions" }
https://api.github.com/repos/psf/requests/issues/6105/timeline
null
completed
null
null
false
[ "This isn't a bug. You haven't read the documentation to understand what session.close does", "> This isn't a bug. You haven't read the documentation to understand what session.close does\r\n\r\nHi @sigmavirus24 , it's my bad that I didn't understand what session.close does. As I read from the documentation, quotes here: \"Closes all adapters and as such the session\". If that doesn't mean invalidate the current session, I guess I totally misunderstand the purpose of this method.\r\nMay I ask what is the appropriate way to close the current session? " ]
https://api.github.com/repos/psf/requests/issues/6104
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6104/labels{/name}
https://api.github.com/repos/psf/requests/issues/6104/comments
https://api.github.com/repos/psf/requests/issues/6104/events
https://github.com/psf/requests/issues/6104
1,194,891,723
I_kwDOABTKOs5HOJnL
6,104
ValueError when calling requests.get on windows systems.
{ "avatar_url": "https://avatars.githubusercontent.com/u/18689770?v=4", "events_url": "https://api.github.com/users/lsrzj/events{/privacy}", "followers_url": "https://api.github.com/users/lsrzj/followers", "following_url": "https://api.github.com/users/lsrzj/following{/other_user}", "gists_url": "https://api.github.com/users/lsrzj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/lsrzj", "id": 18689770, "login": "lsrzj", "node_id": "MDQ6VXNlcjE4Njg5Nzcw", "organizations_url": "https://api.github.com/users/lsrzj/orgs", "received_events_url": "https://api.github.com/users/lsrzj/received_events", "repos_url": "https://api.github.com/users/lsrzj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/lsrzj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lsrzj/subscriptions", "type": "User", "url": "https://api.github.com/users/lsrzj", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
{ "closed_at": "2022-06-09T17:44:05Z", "closed_issues": 8, "created_at": "2022-04-07T05:17:41Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/30", "id": 7852541, "labels_url": "https://api.github.com/repos/psf/requests/milestones/30/labels", "node_id": "MI_kwDOABTKOs4Ad9H9", "number": 30, "open_issues": 0, "state": "closed", "title": "2.28.0", "updated_at": "2022-06-09T17:44:05Z", "url": "https://api.github.com/repos/psf/requests/milestones/30" }
14
2022-04-06T17:14:25Z
2023-06-02T00:03:15Z
2022-06-01T17:38:00Z
NONE
resolved
<!-- Summary. --> Using windows I'm getting a ValueError in utils.py file telling that it's failing to parse to int ''. It's because the registry query is returning empty string instead of '0' or '1'. ## Expected Result The request be successful ## Actual Result File ...\site-packages\requests\utils.py, line 68, in proxy_bypass_registry proxyEnable = int(winreg.QueryValueEx(internetSettings, ValueError: invalid literal for int() with base 10: '' ## Reproduction Steps ```python import requests url = 'https://api.github.com/events' r = requests.get(url) ``` Here is the StackOverflow question of more people complaining about this issue and my answer with a solution for the problem https://stackoverflow.com/a/71770718/2726538 <!-- 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/6104/reactions" }
https://api.github.com/repos/psf/requests/issues/6104/timeline
null
completed
null
null
false
[ "Hi @lsrzj, can you please provide the debugging info from the issue template? Looking at the change that added the `int` requirement, I'm not sure why this hasn't been raised before. I don't see anything in the documentation suggesting this would need to be an integer. The second value in the tuple is explicitly and int though.\r\n\r\nWe may need a change here to support whatever the variance is in the registry, but that will need a closer look.", "> Hi @lsrzj, can you please provide the debugging info from the issue template? Looking at the change that added the `int` requirement, I'm not sure why this hasn't been raised before. I don't see anything in the documentation suggesting this would need to be an integer. The second value in the tuple is explicitly and int though.\r\n> \r\n> We may need a change here to support whatever the variance is in the registry, but that will need a closer look.\r\n\r\nProblem is that I'm on a remote machine with restricted internet access and I can't copy and paste from my Amazon Workspaces, so I gave the maximum detail I could with prints of the code and showing where the error is. By the way the remote machine is windows server 2016 datacenter version 1607. So I don't know if there's something different when querying Windows 10 or Windows 11 that makes this error not be raised. Fact is, more people is complaining as the sent StackOverflow link shows. And the int() convertion is already in the code, I don't know why it's necessary, the only thing I did was maintaining the original logic to convert it, as it's already converting, but, before converting, I'm checking if it's getting an empty string to not get a ValueError", "@lsrzj Would you at least be able to provide the Python version and Requests version by hand? It looks like this is just a registry issue though. The value is documented by Microsoft as being either 0 or 1, so the fact it returns '' seems like an issue with the registry.\r\n\r\nEither way, we should just be catching `ValueError` [here](https://github.com/psf/requests/blame/2d5517682b3b38547634d153cea43d48fbc8cdb5/requests/utils.py#L70) and bypassing the function if the value returned isn't discernible.", "> @lsrzj Would you at least be able to provide the Python version and Requests version by hand? It looks like this is just a registry issue though. The value is documented by Microsoft as being either 0 or 1, so the fact it returns '' seems like an issue with the registry.\r\n> \r\n> Either way, we should just be catching `ValueError` [here](https://github.com/psf/requests/blame/2d5517682b3b38547634d153cea43d48fbc8cdb5/requests/utils.py#L70) and bypassing the function if the value returned isn't discernible.\r\n\r\nPython version is 3.9.10 and requests version is 2.27.1. About the solution catching is really better.", "Hello @nateprewitt! I'm new to contributing to projects I would like to try to fix this issue, can you assign me this task? \r\nThanks!", "One thing that may make it difficult to make people upgrade requests library is that pip, itself, depends on requests library, so if windows users tries to update the requests library from pip, they'll get this error and pip will break it's execution. It will be necessary to put a documentation on how to workaround the problem before calling pip, and then, upgrade for the fixed version.", "Thanks for voluteering, @hugo-cachon! I've assigned you, please let us know if you have questions.\r\n\r\n@lsrzj I'm not sure I understand your concern. The current error has been possible in Requests for several years and is only triggered by bad registry entries. The proposed fix is to catch that, and disables use of registry proxy configurations when an unknown entry exists. That can only prevent an error in pip, not add one. We also [vendor Requests in pip](https://github.com/pypa/pip/tree/main/src/pip/_vendor/requests), so your installed version is entirely unrelated to its usage. If your pip installation is broken by the error, it has been broken since at least pip 10 (2017), and won't be fixed until we merge a fix downstream.", "> Thanks for voluteering, @hugo-cachon! I've assigned you, please let us know if you have questions.\r\n> \r\n> @lsrzj I'm not sure I understand your concern. The current error has been possible in Requests for several years and is only triggered by bad registry entries. The proposed fix is to catch that, and disables use of registry proxy configurations when an unknown entry exists. That can only prevent an error in pip, not add one. We also [vendor Requests in pip](https://github.com/pypa/pip/tree/main/src/pip/_vendor/requests), so your installed version is entirely unrelated to its usage. If your pip installation is broken by the error, it has been broken since at least pip 10 (2017), and won't be fixed until we merge a fix downstream.\r\n\r\nMy concern is about people that has this problem trying to download the requests fixed version from pip and not being able to do so, because, pip, itself, will have problem to download the fixed requests module version, because of this error. So, whoever has this problem, will have to, firstly, make a manual correction on the module to make it work, and, then, make the pip call to upgrade the requests module version.", "> My concern is about people that has this problem trying to download the requests fixed version from pip and not being able to do so, because, pip, itself, will have problem to download the fixed requests module version, because of this error. So, whoever has this problem, will have to, firstly, make a manual correction on the module to make it work, and, then, make the pip call to upgrade the requests module version.\r\n\r\nThat's incorrect, you'll need to download the new version of pip and the problem will be resolved. It's entirely unrelated to the version of Requests you've installed with pip as I stated in the last comment.", "Thanks @nateprewitt for putting me on this one! I'm thinking about trying to recreate the issue in a virtual machine using the same windows environnement/ python & Requests version. \r\nIs it okay to process the issue that way?\r\nIf that's so, I'll come back with further informations once I've made some tests on it", "@hugo-cachon, if it would help you build confidence in your fix, that's a fine approach. Note you'll need to modify your registry entry though as I don't believe this is related to default Windows.\r\n\r\nGiven we already know the outcome of the failure though, it may be sufficient to catch the error where I noted above, and write a mocked test to ensure proxy selection works as expected.", "Hello @nateprewitt !\r\nComing with updates and questions on this issue, I was wondering if catching the `ValueError` and just dealing with it using `pass` is sufficient or is it better to treat it with setting 0 or 1 as values if this error is raised and depending on what the value of `proxyEnable` is?\r\n\r\nThis question comes along the mock test where I was thinking testing the value returned by this method.\r\n\r\nThanks for your time and explanations!", "Hi @hugo-cachon,\r\n\r\nI don't believe we want to `pass` but rather return `False`. The exact change proposed is changing [this line](https://github.com/psf/requests/blame/2d5517682b3b38547634d153cea43d48fbc8cdb5/requests/utils.py#L70) to:\r\n```python\r\nexcept (OSError, ValueError):\r\n```\r\n\r\nWe don't have enough information to makes an assumption around 0 or 1, so we'll bypass the override.\r\n\r\nFor tests, it would be reasonable to test `0`, `1` and `\"\"` as return values for `winreg.QueryValueEx`.", "We've gone ahead and created a PR for this in #6149 to unblock the upcoming 2.28.0 release. Now that it's merged, we'll resolve this and the fix can be expected in the next release. Thanks again @lsrzj for reporting this." ]
https://api.github.com/repos/psf/requests/issues/6103
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6103/labels{/name}
https://api.github.com/repos/psf/requests/issues/6103/comments
https://api.github.com/repos/psf/requests/issues/6103/events
https://github.com/psf/requests/issues/6103
1,191,981,901
I_kwDOABTKOs5HDDNN
6,103
HTTPS proxy certificate is not validated
{ "avatar_url": "https://avatars.githubusercontent.com/u/7085494?v=4", "events_url": "https://api.github.com/users/arossert/events{/privacy}", "followers_url": "https://api.github.com/users/arossert/followers", "following_url": "https://api.github.com/users/arossert/following{/other_user}", "gists_url": "https://api.github.com/users/arossert/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/arossert", "id": 7085494, "login": "arossert", "node_id": "MDQ6VXNlcjcwODU0OTQ=", "organizations_url": "https://api.github.com/users/arossert/orgs", "received_events_url": "https://api.github.com/users/arossert/received_events", "repos_url": "https://api.github.com/users/arossert/repos", "site_admin": false, "starred_url": "https://api.github.com/users/arossert/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/arossert/subscriptions", "type": "User", "url": "https://api.github.com/users/arossert", "user_view_type": "public" }
[]
open
false
null
[]
null
5
2022-04-04T15:44:10Z
2024-11-08T08:12:35Z
null
NONE
null
When running a request using `HTTPS` proxy the proxy certificate is ignored even when `verify=True`. Is there a way to validate the proxy certificate? ``` >>> requests.get("https://www.google.com", proxies={"https": "https://100.117.2.81:3129"}, verify=True) >>> <Response [200]> ``` This is available using `pycurl` ``` curl.setopt(pycurl.PROXY_SSL_VERIFYPEER, True) curl.setopt(pycurl.PROXY_SSL_VERIFYHOST, True) ```
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/6103/reactions" }
https://api.github.com/repos/psf/requests/issues/6103/timeline
null
null
null
null
false
[ "Hello @arossert \r\nIf you have a copy of the self-signed certificate and key you can modify the code as follow:\r\n\r\n```python\r\nproxies = {\r\n 'http': 'http://127.0.0.1:24000',\r\n 'https': 'http://127.0.0.1:24000',\r\n}\r\n\r\ncertificate_path = os.path.join(CACERT_PATH, 'cacert.pem')\r\nkey_path = os.path.join(CACERT_KEY, 'cacert.key')\r\n\r\nresp = requests.get('https://api.myip.com',\r\n proxies=proxies,\r\n cert=(certificate_path, key_path))\r\nprint(resp.text)\r\n```", "@hasanozdem1r This will verify the target host `https://api.myip.com`, what I'm interested in is verifying the proxy server.\r\n```\r\nproxies = {'http': 'https://mp.proxy.com:1234', 'https': 'https://my.proxy.com:1234'}\r\nresp = requests.get('https://api.myip.com', proxies=proxies)\r\n```\r\nSo in this case I want to be able to validate `my.proxy.com` certificate, it is possible using `curl`/`pycurl`", "@arossert well I think you should make it clear with curl/ pycurl part. \r\nFollowing code you've mentioned will verify proxy server already.\r\n```python\r\nproxies = {'http': 'https://mp.proxy.com:1234', 'https': 'https://my.proxy.com:1234'}\r\nresp = requests.get('https://api.myip.com', proxies=proxies)\r\n```\r\nEven though here is more better approach\r\n```python\r\ndef check_proxy(proxy, timeout, list, proxy_type):\r\n global working\r\n global dead\r\n try:\r\n try:\r\n proxies = {\r\n 'http': f'{proxy_type}://{proxy}',\r\n 'https': f'{proxy_type}://{proxy}'\r\n }\r\n request.get(\"https://www.google.com/\", timeout=timeout, proxies=proxies)\r\n except Exception:\r\n printqueue.append(f\"[{proxy}]: Dead or timed out.\")\r\n dead += 1\r\n else:\r\n printqueue.append(f\"[{proxy}]: Working\")\r\n working += 1\r\n name = list.split(\"/\")[-1].split(\".\")[0]\r\n with open(f\"proxies/{name}-{proxy_type}-working.txt\", \"a+\") as handle:\r\n handle.write(f\"{proxy}\\n\")\r\n except Exception as e:\r\n printqueue.append(e) \r\n```\r\nDo you want to pass from curl proxies and verify or how ?\r\nHere also way to do that is explained how to verify proxy from curl\r\nhttps://oxylabs.io/blog/curl-with-proxy", "@hasanozdem1r Maybe I was not clear enough, but I want to verify the proxy server certificate, not that the proxy is working.\r\n\r\nWhen working with HTTPS, there is a certificate validation step that requests is skipping on the proxy server even when `verify=True`.\r\n\r\nHere is an example\r\nCurl\r\n```\r\ncurl --proxy https://100.117.2.81:3129 https://www.google.com\r\ncurl: (60) SSL: no alternative certificate subject name matches target host name '100.117.2.81'\r\n(can be skipped with --proxy-insecure)\r\n```\r\nRequest\r\n```\r\nimport requests\r\nrequests.get(\"https://www.google.com\", proxies={\"https\": \"https://100.117.2.81:3129\"}, verify=True)\r\n<Response [200]>\r\n```\r\nI expect the request to fail on a proxy certificate validation error.\r\n", "If try to access an http site with an https proxy, like\r\n```python\r\nrequests.get(\"http://www.google.com\", proxies={\"http\": \"https://100.117.2.81:3129\"}, verify=True)\r\n```\r\nThis will give a warning:\r\n\r\n```\r\n/usr/lib/python3/dist-packages/urllib3/connectionpool.py:1100: InsecureRequestWarning: Unverified HTTPS request is being made to host 'g3proxy.local'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\r\n warnings.warn(\r\n```" ]
https://api.github.com/repos/psf/requests/issues/6102
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6102/labels{/name}
https://api.github.com/repos/psf/requests/issues/6102/comments
https://api.github.com/repos/psf/requests/issues/6102/events
https://github.com/psf/requests/issues/6102
1,191,322,611
I_kwDOABTKOs5HAiPz
6,102
HTTPDigestAuth fails on non-latin credentials
{ "avatar_url": "https://avatars.githubusercontent.com/u/6469029?v=4", "events_url": "https://api.github.com/users/ondratu/events{/privacy}", "followers_url": "https://api.github.com/users/ondratu/followers", "following_url": "https://api.github.com/users/ondratu/following{/other_user}", "gists_url": "https://api.github.com/users/ondratu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ondratu", "id": 6469029, "login": "ondratu", "node_id": "MDQ6VXNlcjY0NjkwMjk=", "organizations_url": "https://api.github.com/users/ondratu/orgs", "received_events_url": "https://api.github.com/users/ondratu/received_events", "repos_url": "https://api.github.com/users/ondratu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ondratu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ondratu/subscriptions", "type": "User", "url": "https://api.github.com/users/ondratu", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
open
false
null
[]
null
3
2022-04-04T06:32:18Z
2024-04-17T16:41:29Z
null
NONE
null
There was issue reported, which is closed with bad results. https://github.com/psf/requests/blob/4f6c0187150af09d085c03096504934eb91c7a9e/requests/auth.py#L59-L63 Don't pass unicode strings in the arguments, but use UTF8 bytes instead. ``` self.session.get(main_url, auth=requests.auth.HTTPDigestAuth("Сергей_Ласточкин".encode('UTF-8'), '1234')) ``` _Originally posted by @D-stefaang in https://github.com/psf/requests/issues/5089#issuecomment-763569911_ But this is wrong! When i try to set user 'Ondřej' with this advice, requests send bad string: ``` HTTPDigestAuth('Ondřej'.encode('utf-8'), 'heslíčko') ``` creates header starts with wrong username! ``` Digest username="b'Ond\xc5\x99ej'" ```
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/6102/reactions" }
https://api.github.com/repos/psf/requests/issues/6102/timeline
null
null
null
null
false
[ "Hi @ondratu,\r\n\r\nCould you please clarify what you believe is wrong in this case? `ř` is the byte-sequence `\\xc5\\x99` in UTF-8, so we'd expect the bytes object to be `Ond\\xc5\\x99ej`. We can quickly verify this by checking:\r\n\r\n```python\r\n'Ondřej'.encode('utf-8') == b'Ond\\xc5\\x99ej'\r\n>>> True\r\n```\r\n\r\nIt's not clear what other value you'd be expecting.", "Hmm, on closer inspection this does appear to be a bug. We're using the bytes username as an argument to [format our string](https://github.com/psf/requests/blob/2d5517682b3b38547634d153cea43d48fbc8cdb5/requests/auth.py#L215-L225) for the header. This causes the full literal `\"b'Ond\\xc5\\x99ej'\"` to be used which I agree doesn't look correct. This header _should_ be encoded as bytes during creation but we currently defer that to be urllib3's problem.\r\n\r\nWhen not encoding the auth/password, we get this:\r\n\r\n```python\r\nTraceback (most recent call last):\r\n File \"/Users/nateprewitt/Work/OpenSource/requests/test.py\", line 3, in <module>\r\n r = requests.get('https://httpbin.org/digest-auth/auth/Ondřej/heslíčko', auth=h)\r\n File \"/Users/nateprewitt/Work/OpenSource/requests/requests/api.py\", line 73, in get\r\n return request(\"get\", url, params=params, **kwargs)\r\n [...]\r\n File \"/Users/nateprewitt/.pyenv/versions/3.10.3/lib/python3.10/http/client.py\", line 1323, in _send_request\r\n self.putheader(hdr, value)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.10.3/lib/python3.10/site-packages/urllib3/connection.py\", line 224, in putheader\r\n _HTTPConnection.putheader(self, header, *values)\r\n File \"/Users/nateprewitt/.pyenv/versions/3.10.3/lib/python3.10/http/client.py\", line 1255, in putheader\r\n values[i] = one_value.encode('latin-1')\r\nUnicodeEncodeError: 'latin-1' codec can't encode character '\\u0159' in position 20: ordinal not in range(256)\r\n```\r\n\r\nFixing this is unfortunately somewhat complicated for a couple reasons:\r\n\r\n1.) Users expect the output of `HTTPDigestAuth` to be a `str` in Python 3, changing that is likely breaking.\r\n2.) If we were to encode the string, the libraries current convention would be `latin-1` not `utf-8`. That wouldn't solve this issue.\r\n\r\nI don't believe we can ever format this correctly in Python 3 with the current behavior though. I'll need to look more tomorrow, but we may consider a behavior change if `self.username`/`self.password` is passed in as bytes.", "Hi all, \r\nwe encountered this week as we had a password policy change, too. Unicode is now optional requirement for passwords. But some may use it (I did...) and it broke twine, pip, and other things that would use `requests.auth` module for authentication.\r\n\r\nI saw the exception above, and knew immediately a quick test to see if charset encoding would fix it:\r\n```\r\n # requests/auth.py, _basic_auth_str()\r\n....\r\n if isinstance(password, str):\r\n # password = password.encode(\"latin1\")\r\n password = password.encode(\"utf-8\") # Hey! IT works,... now just make it an optional kwarg\r\n```\r\n\r\nI realize exposing encoding in the function signatures will have a ripple effect, but I don't think the `latin1` assumption is all that great either. \r\n\r\nRequested change: add encoding kwarg to `_basic_auth_str()` and its consumers\r\n```\r\ndef _basic_auth_str(username, passwd, encoding=\"latin1\"):\r\n ...\r\n password = password.encode(encoding)\r\n ..\r\n```\r\n\r\nOne line fix and I'm good to go.... hopefully you can include in an upcoming release. Password policy changes are now more frequently including Unicode." ]
https://api.github.com/repos/psf/requests/issues/6101
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6101/labels{/name}
https://api.github.com/repos/psf/requests/issues/6101/comments
https://api.github.com/repos/psf/requests/issues/6101/events
https://github.com/psf/requests/issues/6101
1,190,646,291
I_kwDOABTKOs5G99IT
6,101
Host header field contains scope of IPv6 address
{ "avatar_url": "https://avatars.githubusercontent.com/u/35783820?v=4", "events_url": "https://api.github.com/users/mib1185/events{/privacy}", "followers_url": "https://api.github.com/users/mib1185/followers", "following_url": "https://api.github.com/users/mib1185/following{/other_user}", "gists_url": "https://api.github.com/users/mib1185/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mib1185", "id": 35783820, "login": "mib1185", "node_id": "MDQ6VXNlcjM1NzgzODIw", "organizations_url": "https://api.github.com/users/mib1185/orgs", "received_events_url": "https://api.github.com/users/mib1185/received_events", "repos_url": "https://api.github.com/users/mib1185/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mib1185/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mib1185/subscriptions", "type": "User", "url": "https://api.github.com/users/mib1185", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2022-04-02T14:18:35Z
2023-05-29T00:03:17Z
2022-04-03T18:30:16Z
NONE
resolved
<!-- Summary. --> ## Expected Result when do a request to an ipv6 link local url `http://[fe80::1eed:6fff:fe30:3e4f%2]:49000/fboxdesc.xml`, i would expect just the IPv6 address without the scope in the host request-header field expected request header example ``` GET /fboxdesc.xml HTTP/1.1 Host: [fe80::1eed:6fff:fe30:3e4f]:49000 User-Agent: curl/7.74.0 Accept: */* ``` <!-- What you expected. --> ## Actual Result ``` GET /fboxdesc.xml HTTP/1.1 Host: [fe80::1eed:6fff:fe30:3e4f%2]:49000 User-Agent: python-requests/2.27.1 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive ``` <!-- What happened instead. --> ## Reproduction Steps ```python >>> import requests >>> x = requests.get("http://[fe80::1eed:6fff:fe30:3e4f%2]:49000/fboxdesc.xml") >>> x.content b'<HTML><HEAD><TITLE>400 Bad Request (ERR_INVALID_HOSTHEADER)</TITLE></HEAD><BODY><H1>400 Bad Request</H1><BR>ERR_INVALID_HOSTHEADER<HR><B>Webserver</B> Sat, 02 Apr 2022 13:31:50 GMT</BODY></HTML>\r\n' ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.0.4" }, "cryptography": { "version": "35.0.0" }, "idna": { "version": "2.10" }, "implementation": { "name": "CPython", "version": "3.9.2" }, "platform": { "release": "5.13.19-4-pve", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "101010cf", "version": "20.0.1" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010bf" }, "urllib3": { "version": "1.26.9" }, "using_charset_normalizer": false, "using_pyopenssl": true } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6101/reactions" }
https://api.github.com/repos/psf/requests/issues/6101/timeline
null
completed
null
null
false
[ "We don't generate the `Host` header ourselves. I believe this might be a bug with `urllib3` or `http.requests.HTTPConection`. @sethmlarson thoughts?", "The `Host` header is emitted by [`http.client.HTTPConnection`](https://github.com/python/cpython/blob/main/Lib/http/client.py#L1136) but we could potentially change the behavior on the `main` branch now that we're moving towards choosing headers ourselves.", "just to be sure - do \"you\" fix it here in the requests lib, or should i open an issue in cpython project for [`http.client.HTTPConnection`](https://github.com/python/cpython/blob/main/Lib/http/client.py#L1136)?", "fun fact - there is already an open issue for that since 5 years 😆 \r\nhttps://bugs.python.org/issue29375", "> just to be sure - do \\\"you\\\" fix it here in the requests lib, or should i open an issue in cpython project for http.client.HTTPConnection?\n\nIf we were a company you were paying support fees to, we'd handle the upstream big for sure. It's not reasonable to expect open source maintainers to report bugs upstream for you otherwise", "hi @sigmavirus24\r\nmy intention was not, to \"force\" or ask you to solve the issue for \"me\" in the upstream project - i know and life the open source community idea same as you 😉 \r\nMy question was more in reply to the comment of @sethmlarson : \"_but we could potentially change the behavior on the main branch now that we're moving towards choosing headers ourselves_\", since this sounds to me that you have already the plan, to move the header handling into the requests lib. If i miss understood/interpret this, than sorry 🙂 ", "I believe that plan is for urllib3 not requests", "> fun fact - there is already an open issue for that since 5 years 😆 https://bugs.python.org/issue29375\r\n\r\nthis has been migrated to https://github.com/python/cpython/issues/73561" ]
https://api.github.com/repos/psf/requests/issues/6100
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6100/labels{/name}
https://api.github.com/repos/psf/requests/issues/6100/comments
https://api.github.com/repos/psf/requests/issues/6100/events
https://github.com/psf/requests/issues/6100
1,190,502,000
I_kwDOABTKOs5G9Z5w
6,100
Potential security vulnerability
{ "avatar_url": "https://avatars.githubusercontent.com/u/25035884?v=4", "events_url": "https://api.github.com/users/ranjit-git/events{/privacy}", "followers_url": "https://api.github.com/users/ranjit-git/followers", "following_url": "https://api.github.com/users/ranjit-git/following{/other_user}", "gists_url": "https://api.github.com/users/ranjit-git/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ranjit-git", "id": 25035884, "login": "ranjit-git", "node_id": "MDQ6VXNlcjI1MDM1ODg0", "organizations_url": "https://api.github.com/users/ranjit-git/orgs", "received_events_url": "https://api.github.com/users/ranjit-git/received_events", "repos_url": "https://api.github.com/users/ranjit-git/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ranjit-git/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ranjit-git/subscriptions", "type": "User", "url": "https://api.github.com/users/ranjit-git", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-04-02T05:09:48Z
2023-04-03T00:02:59Z
2022-04-02T05:55:41Z
NONE
resolved
A potential security vulnerability has been disclosed for this repo https://huntr.dev/bounties/2c5789ab-213c-4568-9380-683d0612f1aa/ 3 months ago . But i see it still not addressed . Kindly validate the bug
{ "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/6100/reactions" }
https://api.github.com/repos/psf/requests/issues/6100/timeline
null
completed
null
null
false
[ "@ranjit-git we don't have an interest in third-party applications which require access to personal information to view the vulnerability.\n\nPlease follow our [security disclosure instructions](https://docs.python-requests.org/en/latest/community/vulnerabilities/).", "@nateprewitt huntr.dev team already sent you the report details to provided email in https://docs.python-requests.org/en/latest/community/vulnerabilities/ .\r\nYou should have received the report details in mail already . In that mail there is a magick unique link , by using this you can view the report details without signup . In mail just search for \"https://huntr.dev\" .\r\nI will ask the admin to send the report details again .", "https://huntr.dev/ is opensource bugbounty platform running since last 2.5 year " ]
https://api.github.com/repos/psf/requests/issues/6099
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6099/labels{/name}
https://api.github.com/repos/psf/requests/issues/6099/comments
https://api.github.com/repos/psf/requests/issues/6099/events
https://github.com/psf/requests/issues/6099
1,189,218,619
I_kwDOABTKOs5G4gk7
6,099
Requests not returning full html
{ "avatar_url": "https://avatars.githubusercontent.com/u/60905636?v=4", "events_url": "https://api.github.com/users/max-widmaier/events{/privacy}", "followers_url": "https://api.github.com/users/max-widmaier/followers", "following_url": "https://api.github.com/users/max-widmaier/following{/other_user}", "gists_url": "https://api.github.com/users/max-widmaier/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/max-widmaier", "id": 60905636, "login": "max-widmaier", "node_id": "MDQ6VXNlcjYwOTA1NjM2", "organizations_url": "https://api.github.com/users/max-widmaier/orgs", "received_events_url": "https://api.github.com/users/max-widmaier/received_events", "repos_url": "https://api.github.com/users/max-widmaier/repos", "site_admin": false, "starred_url": "https://api.github.com/users/max-widmaier/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/max-widmaier/subscriptions", "type": "User", "url": "https://api.github.com/users/max-widmaier", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-04-01T04:29:43Z
2023-04-02T00:03:21Z
2022-04-01T04:56:59Z
NONE
resolved
When using requests.post/get(url...) The html that is returned by using request.content/request.text is not the full html. For example I am trying to code a bot that will get data from a website called investopedia. This html is cut short and does not return the same html that can be seen in inspect element. ## Reproduction Steps ```python import requests with open("test.html", "w") as file: file.write(requests.get("https://www.google.com/").text) If you compare the html of test.html to the actual google it is very different ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "2.8" }, "implementation": { "name": "CPython", "version": "3.9.6" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010bf" }, "urllib3": { "version": "1.24.2" }, "using_charset_normalizer": false, "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/6099/reactions" }
https://api.github.com/repos/psf/requests/issues/6099/timeline
null
completed
null
null
false
[ "Hi @YeetmanLord, please check open and closed issues before filing new ones. You'll find most servers either truncate or completely change content for scrapers to reduce bandwidth or access. This is the behavior you're encountering with Google. The content you receive is still a complete and valid html file." ]
https://api.github.com/repos/psf/requests/issues/6098
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6098/labels{/name}
https://api.github.com/repos/psf/requests/issues/6098/comments
https://api.github.com/repos/psf/requests/issues/6098/events
https://github.com/psf/requests/pull/6098
1,186,192,831
PR_kwDOABTKOs41TMIV
6,098
minor clean up of python2 syntax
{ "avatar_url": "https://avatars.githubusercontent.com/u/51964909?v=4", "events_url": "https://api.github.com/users/beliaev-maksim/events{/privacy}", "followers_url": "https://api.github.com/users/beliaev-maksim/followers", "following_url": "https://api.github.com/users/beliaev-maksim/following{/other_user}", "gists_url": "https://api.github.com/users/beliaev-maksim/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/beliaev-maksim", "id": 51964909, "login": "beliaev-maksim", "node_id": "MDQ6VXNlcjUxOTY0OTA5", "organizations_url": "https://api.github.com/users/beliaev-maksim/orgs", "received_events_url": "https://api.github.com/users/beliaev-maksim/received_events", "repos_url": "https://api.github.com/users/beliaev-maksim/repos", "site_admin": false, "starred_url": "https://api.github.com/users/beliaev-maksim/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/beliaev-maksim/subscriptions", "type": "User", "url": "https://api.github.com/users/beliaev-maksim", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-03-30T09:54:58Z
2023-03-31T00:03:00Z
2022-03-30T11:53:01Z
NONE
resolved
null
{ "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/6098/reactions" }
https://api.github.com/repos/psf/requests/issues/6098/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6098.diff", "html_url": "https://github.com/psf/requests/pull/6098", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6098.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6098" }
true
[ "Duplicate of #6095" ]
https://api.github.com/repos/psf/requests/issues/6097
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6097/labels{/name}
https://api.github.com/repos/psf/requests/issues/6097/comments
https://api.github.com/repos/psf/requests/issues/6097/events
https://github.com/psf/requests/pull/6097
1,183,811,683
PR_kwDOABTKOs41LN5O
6,097
Fix inconsistent exception for JSONDecode error
{ "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
[]
{ "closed_at": "2022-06-09T17:44:05Z", "closed_issues": 8, "created_at": "2022-04-07T05:17:41Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/30", "id": 7852541, "labels_url": "https://api.github.com/repos/psf/requests/milestones/30/labels", "node_id": "MI_kwDOABTKOs4Ad9H9", "number": 30, "open_issues": 0, "state": "closed", "title": "2.28.0", "updated_at": "2022-06-09T17:44:05Z", "url": "https://api.github.com/repos/psf/requests/milestones/30" }
0
2022-03-28T18:17:06Z
2023-04-08T00:03:07Z
2022-03-28T18:51:28Z
MEMBER
resolved
This PR should address #6084 by adding appropriate handling for alternative utf encodings. The previous change in #5856 only accounted for the happy path where we would attempt to load directly from `.text`. This patch will now ensure we're also catching and raising the appropriate exception when we guess the encoding based on byte sequencing.
{ "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/6097/reactions" }
https://api.github.com/repos/psf/requests/issues/6097/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6097.diff", "html_url": "https://github.com/psf/requests/pull/6097", "merged_at": "2022-03-28T18:51:27Z", "patch_url": "https://github.com/psf/requests/pull/6097.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6097" }
true
[]
https://api.github.com/repos/psf/requests/issues/6096
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6096/labels{/name}
https://api.github.com/repos/psf/requests/issues/6096/comments
https://api.github.com/repos/psf/requests/issues/6096/events
https://github.com/psf/requests/pull/6096
1,181,288,184
PR_kwDOABTKOs41CyYo
6,096
Add support for non-latin1 basic auth encodings (such as utf-8)
{ "avatar_url": "https://avatars.githubusercontent.com/u/1565211?v=4", "events_url": "https://api.github.com/users/qbedard/events{/privacy}", "followers_url": "https://api.github.com/users/qbedard/followers", "following_url": "https://api.github.com/users/qbedard/following{/other_user}", "gists_url": "https://api.github.com/users/qbedard/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/qbedard", "id": 1565211, "login": "qbedard", "node_id": "MDQ6VXNlcjE1NjUyMTE=", "organizations_url": "https://api.github.com/users/qbedard/orgs", "received_events_url": "https://api.github.com/users/qbedard/received_events", "repos_url": "https://api.github.com/users/qbedard/repos", "site_admin": false, "starred_url": "https://api.github.com/users/qbedard/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/qbedard/subscriptions", "type": "User", "url": "https://api.github.com/users/qbedard", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-03-25T21:33:14Z
2023-03-26T00:03:27Z
2022-03-25T22:24:54Z
NONE
resolved
null
{ "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/6096/reactions" }
https://api.github.com/repos/psf/requests/issues/6096/timeline
null
null
true
{ "diff_url": "https://github.com/psf/requests/pull/6096.diff", "html_url": "https://github.com/psf/requests/pull/6096", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6096.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6096" }
true
[ "Hi @timbedard, thanks for the PR. Unfortunately, I don't believe we'll be able to accept it. The high level Requests APIs have been frozen for the majority of 2.x and we don't intend to change those interfaces.\n\nI believe the general consensus has also been to favor bytes in most cases going forward. It removes any guessing (which is impossible to do right consistently) and avoid us leaking an `encoding` argument on to every interface in Requests.", "Oh hey, no worries. It was a draft for a reason. I came to the same conclusion shortly after this and just came back to close it. Thanks for the fast response and keep up the good work!" ]
https://api.github.com/repos/psf/requests/issues/6095
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6095/labels{/name}
https://api.github.com/repos/psf/requests/issues/6095/comments
https://api.github.com/repos/psf/requests/issues/6095/events
https://github.com/psf/requests/pull/6095
1,178,614,087
PR_kwDOABTKOs406G2S
6,095
Add automatic code formatting to Requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
{ "closed_at": "2022-06-09T17:44:05Z", "closed_issues": 8, "created_at": "2022-04-07T05:17:41Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/30", "id": 7852541, "labels_url": "https://api.github.com/repos/psf/requests/milestones/30/labels", "node_id": "MI_kwDOABTKOs4Ad9H9", "number": 30, "open_issues": 0, "state": "closed", "title": "2.28.0", "updated_at": "2022-06-09T17:44:05Z", "url": "https://api.github.com/repos/psf/requests/milestones/30" }
1
2022-03-23T20:15:49Z
2023-04-30T00:03:01Z
2022-04-29T19:16:58Z
MEMBER
resolved
### Overview This is a draft PR for adding standardized code formatting to Requests. Now that we intend to drop Python 2 support, we have the opportunity to clean up multiple conflicting code styles that have crept into Requests over the years. This PR will introduce a few standard changes: * Integration of `black` for code formatting, bringing Requests in-line with what has largely become the standard. * Integration of `isort` to ensure our imports are automatically grouped and cleaned. * Integration of `pyupgrade` which will automatically pull most of the code base to Python 3.7 syntax. * Addition of a `.pre-commit-config.yaml` to orchestrate the above tools. ### TODO - [x] Rebase on to #6091 before merge - [x] Resolve formatting issues with server response line wrapping in `tests/test_lowlevel.py` - [x] Add .git-blame-ignore-revs file (#6116) - [x] Fix inconsistent f-string upgrades - [x] Enable and fix flake8 issues
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 3, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 3, "url": "https://api.github.com/repos/psf/requests/issues/6095/reactions" }
https://api.github.com/repos/psf/requests/issues/6095/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6095.diff", "html_url": "https://github.com/psf/requests/pull/6095", "merged_at": "2022-04-29T19:16:58Z", "patch_url": "https://github.com/psf/requests/pull/6095.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6095" }
true
[ "https://github.com/psf/requests/blob/main/docs/dev/contributing.rst#kenneth-reitzs-code-style is no longer necessary if you're formatting the code" ]
https://api.github.com/repos/psf/requests/issues/6094
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6094/labels{/name}
https://api.github.com/repos/psf/requests/issues/6094/comments
https://api.github.com/repos/psf/requests/issues/6094/events
https://github.com/psf/requests/issues/6094
1,178,140,499
I_kwDOABTKOs5GOP9T
6,094
HTTPBasicAuth does not handle non-latin-1 characters
{ "avatar_url": "https://avatars.githubusercontent.com/u/4068?v=4", "events_url": "https://api.github.com/users/frafra/events{/privacy}", "followers_url": "https://api.github.com/users/frafra/followers", "following_url": "https://api.github.com/users/frafra/following{/other_user}", "gists_url": "https://api.github.com/users/frafra/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/frafra", "id": 4068, "login": "frafra", "node_id": "MDQ6VXNlcjQwNjg=", "organizations_url": "https://api.github.com/users/frafra/orgs", "received_events_url": "https://api.github.com/users/frafra/received_events", "repos_url": "https://api.github.com/users/frafra/repos", "site_admin": false, "starred_url": "https://api.github.com/users/frafra/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/frafra/subscriptions", "type": "User", "url": "https://api.github.com/users/frafra", "user_view_type": "public" }
[]
open
false
null
[]
null
1
2022-03-23T13:40:56Z
2023-05-27T22:08:42Z
null
NONE
null
Hi, I have a password containing Norwegian characters, like "ø". I found that `HTTPBasicAuth` generates a wrong `Authentication` header, as the base64-encoded password differed from what I computed and successfully tested. It looks like `latin-1` is the default encoding instead of `utf-8`: https://github.com/psf/requests/blob/79f60274f7e461b8fd2f579e741f748438d7eadb/requests/auth.py#L59-L63 My workaround is to encode strings to `utf-8` before passing them to `HTTPBasicAuth`, but it looks like this would break starting with `requests >= 3.0.0`: https://github.com/psf/requests/blob/79f60274f7e461b8fd2f579e741f748438d7eadb/requests/auth.py#L36-L41 I do not know if different servers have different defaults, but if `requests` do not want to handle binary sequences, then it should probably allow specifying different encodings.
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/6094/reactions" }
https://api.github.com/repos/psf/requests/issues/6094/timeline
null
null
null
null
false
[ "Hi @frafra, this warning is a remnant from when Python 2 was still the main Python and `bytes`/`str` were synonymous. You'll see if you look at the definition for [`basestring`](https://github.com/psf/requests/blob/main/requests/compat.py#L79) that it is that same type union in Python 3. We may be able to make \"Non-string\" a bit clearer for Python 3.\r\n\r\n`bytes` will continue to be supported going forward and would in fact be our general recommendation for most Requests arguments. The library still assumes `latin-1`/`iso-8859-1` because that's what's formally documented for the web. You'll find in practice though that `utf-8` has superseded that in many cases." ]
https://api.github.com/repos/psf/requests/issues/6093
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6093/labels{/name}
https://api.github.com/repos/psf/requests/issues/6093/comments
https://api.github.com/repos/psf/requests/issues/6093/events
https://github.com/psf/requests/issues/6093
1,178,129,766
I_kwDOABTKOs5GONVm
6,093
request.get adds %20 to the end of the link and gives a 404 error
{ "avatar_url": "https://avatars.githubusercontent.com/u/52583698?v=4", "events_url": "https://api.github.com/users/Turkmen1Mehmet/events{/privacy}", "followers_url": "https://api.github.com/users/Turkmen1Mehmet/followers", "following_url": "https://api.github.com/users/Turkmen1Mehmet/following{/other_user}", "gists_url": "https://api.github.com/users/Turkmen1Mehmet/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Turkmen1Mehmet", "id": 52583698, "login": "Turkmen1Mehmet", "node_id": "MDQ6VXNlcjUyNTgzNjk4", "organizations_url": "https://api.github.com/users/Turkmen1Mehmet/orgs", "received_events_url": "https://api.github.com/users/Turkmen1Mehmet/received_events", "repos_url": "https://api.github.com/users/Turkmen1Mehmet/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Turkmen1Mehmet/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Turkmen1Mehmet/subscriptions", "type": "User", "url": "https://api.github.com/users/Turkmen1Mehmet", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-03-23T13:32:43Z
2023-03-24T00:03:34Z
2022-03-23T14:44:26Z
NONE
resolved
I am browsing the links from a list, the links are working, the headers are also defined, but when I send a request with requests.get, the response returns 404. When I look at it with debug, it adds %20 to the end of the main url, so the links are broken and the error returns. How do I solve this? i am giving an example mylink= https://example.net///2022/V/0/1/p/2710/583/742/2/w/2048/2710583742_6_2_1.jpg?ts=1645610622959 error= https://example.net///2022/V/0/1/p/2710/583/742/2/w/2048/2710583742_6_2_1.jpg?ts=1645610622959%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/6093/reactions" }
https://api.github.com/repos/psf/requests/issues/6093/timeline
null
completed
null
null
false
[ "Hi @Turkmen1Mehmet,\r\n\r\nPlease make sure to read the issue template before filing new issues. We won't be able to help with general usage questions on this issue tracker, those will need to be directed to [StackOverflow](https://stackoverflow.com/). Generally speaking, %20 denotes whitespace, so you'll likely want to take a close look at your url string." ]
https://api.github.com/repos/psf/requests/issues/6092
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6092/labels{/name}
https://api.github.com/repos/psf/requests/issues/6092/comments
https://api.github.com/repos/psf/requests/issues/6092/events
https://github.com/psf/requests/issues/6092
1,177,879,001
I_kwDOABTKOs5GNQHZ
6,092
Is there any disconnection detection exist on Stream feature?
{ "avatar_url": "https://avatars.githubusercontent.com/u/33682827?v=4", "events_url": "https://api.github.com/users/VahidTa/events{/privacy}", "followers_url": "https://api.github.com/users/VahidTa/followers", "following_url": "https://api.github.com/users/VahidTa/following{/other_user}", "gists_url": "https://api.github.com/users/VahidTa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/VahidTa", "id": 33682827, "login": "VahidTa", "node_id": "MDQ6VXNlcjMzNjgyODI3", "organizations_url": "https://api.github.com/users/VahidTa/orgs", "received_events_url": "https://api.github.com/users/VahidTa/received_events", "repos_url": "https://api.github.com/users/VahidTa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/VahidTa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/VahidTa/subscriptions", "type": "User", "url": "https://api.github.com/users/VahidTa", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-03-23T09:54:54Z
2023-03-25T00:02:57Z
2022-03-23T15:49:49Z
NONE
resolved
I have a post request to a stream API server. I tried to simulate disconnection during streaming. However, in my case, if I disconnect my connection to the API server which streams data, "requests" continues without breaking the connection or raising any exceptions. Is there any help to overcome this issue? Or is there a feature needs to be added to this kind of scenario?
{ "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/6092/reactions" }
https://api.github.com/repos/psf/requests/issues/6092/timeline
null
completed
null
null
false
[ "Hi @VahidTa,\r\n\r\nIf you're receiving incomplete data from the broken connection and no error, this is likely an issue in urllib3 that's been [fixed](https://github.com/urllib3/urllib3/pull/2514) in the upcoming urllib3 2.0. We don't have control over detecting this in Requests unfortunately though.", "I think it is good idea to have \"keep-alive\" like mechanism for connection status in streaming." ]
https://api.github.com/repos/psf/requests/issues/6091
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6091/labels{/name}
https://api.github.com/repos/psf/requests/issues/6091/comments
https://api.github.com/repos/psf/requests/issues/6091/events
https://github.com/psf/requests/pull/6091
1,177,445,849
PR_kwDOABTKOs402POC
6,091
Remove support for Python 2.7, 3.6 and Pypy3.6
{ "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
[]
{ "closed_at": "2022-06-09T17:44:05Z", "closed_issues": 8, "created_at": "2022-04-07T05:17:41Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/30", "id": 7852541, "labels_url": "https://api.github.com/repos/psf/requests/milestones/30/labels", "node_id": "MI_kwDOABTKOs4Ad9H9", "number": 30, "open_issues": 0, "state": "closed", "title": "2.28.0", "updated_at": "2022-06-09T17:44:05Z", "url": "https://api.github.com/repos/psf/requests/milestones/30" }
1
2022-03-23T00:27:13Z
2023-04-08T00:03:06Z
2022-03-25T16:50:34Z
MEMBER
resolved
This PR is a proposal to officially remove support for Python 2.7 as discussed in #6023. The next minor release (Requests 2.28.0) will no longer provide support for any of the end of life Python runtimes. Users are encouraged to upgrade to Python 3.8 or later. If you're unable to do so, we'd recommend pinning to `requests<2.28`. This will be the first of a few PRs that will be doing some general code clean up now that we're moving to a Python 3-only code base. I'll post the others as drafts shortly.
{ "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": 1, "laugh": 0, "rocket": 6, "total_count": 7, "url": "https://api.github.com/repos/psf/requests/issues/6091/reactions" }
https://api.github.com/repos/psf/requests/issues/6091/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6091.diff", "html_url": "https://github.com/psf/requests/pull/6091", "merged_at": "2022-03-25T16:50:34Z", "patch_url": "https://github.com/psf/requests/pull/6091.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6091" }
true
[ "Thanks @hugovk, those are all great call outs! `use_chardet_on_py3` is an unfortunate misnomer because it just forcing use of `chardet`. The only reason it references py3 is because chardet was the default for Python 2. I don't think we can change the extra name at this point.\r\n\r\nI addressed the rest of @sethmlarson's comments too and added a hard failure in the setup.py for anyone installing on `pip<9`." ]
https://api.github.com/repos/psf/requests/issues/6090
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6090/labels{/name}
https://api.github.com/repos/psf/requests/issues/6090/comments
https://api.github.com/repos/psf/requests/issues/6090/events
https://github.com/psf/requests/issues/6090
1,177,415,326
I_kwDOABTKOs5GLe6e
6,090
POST a Multipart-Encoded File freezes response code 500
{ "avatar_url": "https://avatars.githubusercontent.com/u/41475411?v=4", "events_url": "https://api.github.com/users/vaccarieli/events{/privacy}", "followers_url": "https://api.github.com/users/vaccarieli/followers", "following_url": "https://api.github.com/users/vaccarieli/following{/other_user}", "gists_url": "https://api.github.com/users/vaccarieli/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vaccarieli", "id": 41475411, "login": "vaccarieli", "node_id": "MDQ6VXNlcjQxNDc1NDEx", "organizations_url": "https://api.github.com/users/vaccarieli/orgs", "received_events_url": "https://api.github.com/users/vaccarieli/received_events", "repos_url": "https://api.github.com/users/vaccarieli/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vaccarieli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vaccarieli/subscriptions", "type": "User", "url": "https://api.github.com/users/vaccarieli", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-03-22T23:34:20Z
2023-03-24T00:03:34Z
2022-03-23T00:15:42Z
NONE
resolved
<!-- Summary. --> I am trying to send a single PDF/DOCX file using a single rest API and performing a single Post request. <!-- What you expected. --> When I run the code it hangs for almost 3 min, and then I got a response `{"error":true,"code":500,"message":"Error: Timed Out"}` from the server where I am trying to send the file to, <!-- What happened instead. --> ## Reproduction Steps ```python def send_document(ID, document): headers = { } params = { "key": userKey, } data = { "id": ID } files= { 'file': ('application.pdf', open(document, 'rb'), 'application/pdf') } response = post(f"{baseUrl}message/doc", headers=headers, params=params, data=data, files=files).content print(response) ``` ## System Information $ python -m requests.help ```json { { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.7" }, "cryptography": { "version": "36.0.0" }, "idna": { "version": "2.10" }, "implementation": { "name": "CPython", "version": "3.10.0" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "101010cf", "version": "21.0.0" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010cf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": false, "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/41475411?v=4", "events_url": "https://api.github.com/users/vaccarieli/events{/privacy}", "followers_url": "https://api.github.com/users/vaccarieli/followers", "following_url": "https://api.github.com/users/vaccarieli/following{/other_user}", "gists_url": "https://api.github.com/users/vaccarieli/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vaccarieli", "id": 41475411, "login": "vaccarieli", "node_id": "MDQ6VXNlcjQxNDc1NDEx", "organizations_url": "https://api.github.com/users/vaccarieli/orgs", "received_events_url": "https://api.github.com/users/vaccarieli/received_events", "repos_url": "https://api.github.com/users/vaccarieli/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vaccarieli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vaccarieli/subscriptions", "type": "User", "url": "https://api.github.com/users/vaccarieli", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6090/reactions" }
https://api.github.com/repos/psf/requests/issues/6090/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6089
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6089/labels{/name}
https://api.github.com/repos/psf/requests/issues/6089/comments
https://api.github.com/repos/psf/requests/issues/6089/events
https://github.com/psf/requests/issues/6089
1,176,502,598
I_kwDOABTKOs5GIAFG
6,089
Request 'params' are not encoded into URL (not documented)
{ "avatar_url": "https://avatars.githubusercontent.com/u/38643099?v=4", "events_url": "https://api.github.com/users/RafaelWO/events{/privacy}", "followers_url": "https://api.github.com/users/RafaelWO/followers", "following_url": "https://api.github.com/users/RafaelWO/following{/other_user}", "gists_url": "https://api.github.com/users/RafaelWO/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/RafaelWO", "id": 38643099, "login": "RafaelWO", "node_id": "MDQ6VXNlcjM4NjQzMDk5", "organizations_url": "https://api.github.com/users/RafaelWO/orgs", "received_events_url": "https://api.github.com/users/RafaelWO/received_events", "repos_url": "https://api.github.com/users/RafaelWO/repos", "site_admin": false, "starred_url": "https://api.github.com/users/RafaelWO/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RafaelWO/subscriptions", "type": "User", "url": "https://api.github.com/users/RafaelWO", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-03-22T09:26:19Z
2023-03-23T00:03:22Z
2022-03-22T14:36:29Z
NONE
resolved
I recently wrote some unit tests for functions that make API calls to a service using `requests`. The API calls also use `params` in their requests. For mocking this API I use `requests_mock` and the schema `mock://` as it is done in [their docs](https://requests-mock.readthedocs.io/en/latest/matching.html). For some reason, the unit tests failed due to `NoMockAddress` while the logs say that requests without params were made, but in the actual code, params are used (see minimal example below). I took me quite a while to figure out that apparently params are only passed for URLs starting with `http` ([source](https://github.com/psf/requests/blob/79f60274f7e461b8fd2f579e741f748438d7eadb/requests/models.py#L384)). If this is expected behavior, it would be great to have this documented somewhere, e.g. in [this section of the docs](https://docs.python-requests.org/en/latest/user/quickstart/#passing-parameters-in-urls). Related to https://github.com/psf/requests/issues/1879 ## Expected Result Passed params are encoded into the URL. ## Actual Result Passed params are **not** encoded into the URL. And: I could not find any documentation regarding this. ## Reproduction Steps ```python import requests import requests_mock BASE_URL = "mock://myservice.com" def list_items(limit: int = None): if limit: return requests.get(BASE_URL + "/items", params={"limit": limit}) return requests.get(BASE_URL + "/items") def test_list_items(): with requests_mock.Mocker() as m: m.get(BASE_URL + "/items", json=[1, 2, 3, 4, 5]) res = list_items() assert len(res.json()) == 5 history = m.request_history[0] assert history.method == "GET" assert history.query == f"" def test_list_items_limit(): with requests_mock.Mocker() as m: m.get(BASE_URL + "/items?limit=3", json=[1, 2, 3]) res = list_items(3) assert len(res.json()) == 3 history = m.request_history[0] assert history.method == "GET" assert history.query == "limit=3" ``` Running those tests with `pytest` results in an error for the second test: ``` requests_mock.exceptions.NoMockAddress: No mock address: GET mock://myservice.com/items ``` P.S. When replacing `mock://` with `http://` it works, of course (but it took me a long time to figure this out). ## System Information $ python -m requests.help ```json { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.0.10" }, "cryptography": { "version": "3.4.7" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.8.8" }, "platform": { "release": "5.13.0-35-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "101010bf", "version": "21.0.0" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010df" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": false, "using_pyopenssl": true } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6089/reactions" }
https://api.github.com/repos/psf/requests/issues/6089/timeline
null
completed
null
null
false
[ "All of those examples use a session to make it work. They don't work with the functional API which means that your bug is invalid. We don't support any scheme because this is an HTTP library, not arbitrary URI library. That is why requests mock shows sessions in every example on the page you linked", "Thanks for the fast response and clarification.\r\n\r\nP.S. I could finally a statement documenting the usage of `params` with schemas other that `http://` within the `requests_mock` docs:\r\n> [requests](http://python-requests.org/) only prepares URLs for http schemes (start with http and only contains letters, numbers, and the + and - signs). In particular params won’t work with the mock:// scheme, but will with http+mock://. \r\n\r\n([source](https://requests-mock.readthedocs.io/en/latest/adapter.html#adapter))" ]
https://api.github.com/repos/psf/requests/issues/6088
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6088/labels{/name}
https://api.github.com/repos/psf/requests/issues/6088/comments
https://api.github.com/repos/psf/requests/issues/6088/events
https://github.com/psf/requests/issues/6088
1,176,471,156
I_kwDOABTKOs5GH4Z0
6,088
Requests does not pass 'params
{ "avatar_url": "https://avatars.githubusercontent.com/u/38643099?v=4", "events_url": "https://api.github.com/users/RafaelWO/events{/privacy}", "followers_url": "https://api.github.com/users/RafaelWO/followers", "following_url": "https://api.github.com/users/RafaelWO/following{/other_user}", "gists_url": "https://api.github.com/users/RafaelWO/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/RafaelWO", "id": 38643099, "login": "RafaelWO", "node_id": "MDQ6VXNlcjM4NjQzMDk5", "organizations_url": "https://api.github.com/users/RafaelWO/orgs", "received_events_url": "https://api.github.com/users/RafaelWO/received_events", "repos_url": "https://api.github.com/users/RafaelWO/repos", "site_admin": false, "starred_url": "https://api.github.com/users/RafaelWO/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RafaelWO/subscriptions", "type": "User", "url": "https://api.github.com/users/RafaelWO", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-03-22T09:03:29Z
2023-03-23T00:03:23Z
2022-03-22T14:32:12Z
NONE
resolved
<!-- Summary. --> ## Expected Result <!-- What you expected. --> ## Actual Result <!-- What happened instead. --> ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ```json { "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/6088/reactions" }
https://api.github.com/repos/psf/requests/issues/6088/timeline
null
completed
null
null
false
[ "Sorry, I did not intend to open two issues..." ]
https://api.github.com/repos/psf/requests/issues/6087
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6087/labels{/name}
https://api.github.com/repos/psf/requests/issues/6087/comments
https://api.github.com/repos/psf/requests/issues/6087/events
https://github.com/psf/requests/issues/6087
1,170,769,932
I_kwDOABTKOs5FyIgM
6,087
Python3.6 - requests exceptions SSLError
{ "avatar_url": "https://avatars.githubusercontent.com/u/48598374?v=4", "events_url": "https://api.github.com/users/MrSled/events{/privacy}", "followers_url": "https://api.github.com/users/MrSled/followers", "following_url": "https://api.github.com/users/MrSled/following{/other_user}", "gists_url": "https://api.github.com/users/MrSled/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/MrSled", "id": 48598374, "login": "MrSled", "node_id": "MDQ6VXNlcjQ4NTk4Mzc0", "organizations_url": "https://api.github.com/users/MrSled/orgs", "received_events_url": "https://api.github.com/users/MrSled/received_events", "repos_url": "https://api.github.com/users/MrSled/repos", "site_admin": false, "starred_url": "https://api.github.com/users/MrSled/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MrSled/subscriptions", "type": "User", "url": "https://api.github.com/users/MrSled", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2022-03-16T09:41:05Z
2023-03-21T00:03:14Z
2022-03-16T10:28:41Z
NONE
resolved
Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance. Hi, I am having a problem with python3 script, that uses requests to perform API Get Request. The problem is that the communication should go through proxy, i had similar issue using python3.6 -m pip install package_name, and figured it out by defining http_proxy and https_proxy to use "http://proxy_ip:port", however trying to do the same in the python script keeps failing, because the target destination only allow https communication, and routing the traffic through the http_proxy wont work in this case, but the https_proxy should be working fine from my browser, however when running the request get the below error: """ Traceback (most recent call last): File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 700, in urlopen self._prepare_proxy(conn) File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _prepare_proxy conn.connect() File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connection.py", line 364, in connect conn = self._connect_tls_proxy(hostname, conn) File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connection.py", line 507, in _connect_tls_proxy ssl_context=ssl_context, File "/home/integration/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 453, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls) File "/home/integration/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 495, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock) File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 407, in wrap_socket _context=self, _session=session) File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 817, in __init__ self.do_handshake() File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:852) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/integration/.local/lib/python3.6/site-packages/requests/adapters.py", line 450, in send timeout=timeout File "/home/integration/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 786, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/home/integration/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ruh-services.sec.ibm.com', port=443): Max retries exceeded with url: /micro/ticket_detail (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/integration/.local/lib/python3.6/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/home/integration/.local/lib/python3.6/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/home/integration/.local/lib/python3.6/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "/home/integration/.local/lib/python3.6/site-packages/requests/sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "/home/integration/.local/lib/python3.6/site-packages/requests/adapters.py", line 517, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='ruh-services.sec.ibm.com', port=443): Max retries exceeded with url: /micro/ticket_detail (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:852)'),)) """ below is the python script i am using: import requests url="https://any_website" response = requests.get(url, headers={"User-Agent": "Opera/9.80 (X11; Linux x86_64; U; de) Presto/2.2.15 Version/10.00"}, auth = ("UserName", "Password"), proxies={"https": "https://proxy_ip:port"}) note * the error message is the same for all destinations, as i barely get the error immediately after running the script" Appreciate your support to identify the cause of such problem. 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/6087/reactions" }
https://api.github.com/repos/psf/requests/issues/6087/timeline
null
completed
null
null
false
[ "why you closed the case? @sigmavirus24 ", "You ignored the issue template telling you not to file an issue but to go to Stackoverflow. It's not a bug. Your proxy server is misbehaving probably because you've misconfigured it with requests. Stackoverflow can help better than we have the time to", "Excuse me I didn't mean that.\n\nThank you ", "@sigmavirus24 is there any other place to post my issue, as i am still stuck." ]
https://api.github.com/repos/psf/requests/issues/6086
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6086/labels{/name}
https://api.github.com/repos/psf/requests/issues/6086/comments
https://api.github.com/repos/psf/requests/issues/6086/events
https://github.com/psf/requests/issues/6086
1,170,383,353
I_kwDOABTKOs5FwqH5
6,086
urllib.request.proxy_bypass makes DNS request without using configured proxies when system has NO_PROXY configured at some level
{ "avatar_url": "https://avatars.githubusercontent.com/u/76849071?v=4", "events_url": "https://api.github.com/users/GiorgioComitini/events{/privacy}", "followers_url": "https://api.github.com/users/GiorgioComitini/followers", "following_url": "https://api.github.com/users/GiorgioComitini/following{/other_user}", "gists_url": "https://api.github.com/users/GiorgioComitini/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/GiorgioComitini", "id": 76849071, "login": "GiorgioComitini", "node_id": "MDQ6VXNlcjc2ODQ5MDcx", "organizations_url": "https://api.github.com/users/GiorgioComitini/orgs", "received_events_url": "https://api.github.com/users/GiorgioComitini/received_events", "repos_url": "https://api.github.com/users/GiorgioComitini/repos", "site_admin": false, "starred_url": "https://api.github.com/users/GiorgioComitini/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/GiorgioComitini/subscriptions", "type": "User", "url": "https://api.github.com/users/GiorgioComitini", "user_view_type": "public" }
[]
open
false
null
[]
null
15
2022-03-16T00:04:14Z
2022-03-28T16:47:16Z
null
NONE
null
When using Requests via a SOCKS5 proxy on one of the latest MacBook Pros (Apple Silicon), the DNS requests are not correctly passed to the proxy server even when using the "socks5h" scheme. Instead, the DNS resolution happens at the level of the client, causing a DNS leak. This happens with various versions/combinations of Requests/PySocks/Python, the latter being the Apple Silicon versions obtained through pyenv. I have tested this using the local SOCKS5 proxy server provided by Tor. In more detail, I tested the bug on various pyenv Python distributions, labeled 3.8 to 3.10 plus miniforge3, with Requests from v2.16.0 to v2.27.1, and PySocks from v1.5.7 to v1.7.1 (not every single version in between). In what follows, I'll use an example System Information output. Also, I used Wireshark to monitor the DNS requests, and I used curl with the --proxy socks5h://127.0.0.1:9050 flag as a control, to make sure that the local Tor proxy was working properly and that the DNS leak is indeed specific to Python/Requests/PySocks. I am not able to confirm whether the DNS leak also happens on Python versions obtained other than through pyenv. On an Intel MacBook using an Anaconda Python version and the latest Requests/PySocks, the leak does not occur. ## Expected Result When using the "socks5h" scheme, the DNS requests should be forwarded to the SOCKS proxy. ## Actual Result The DNS requests are sent from the client instead, causing a DNS leak. ## Reproduction Steps Install any Apple Silicon Python version from pyenv (see above for the versions I tested) and start Tor. ```python import requests proxies = { "http": "socks5h://127.0.0.1:9050", "https": "socks5h://127.0.0.1:9050", } resp = requests.get("https://"+url, proxies=proxies) ``` Monitor the outgoing DNS requests using Wireshark. If they are sent via the outbound network interface to your pre-configured DNS server (as opposed to the local interface, destination IP 127.0.0.1, port 9050), a DNS leak is occurring. ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.2" }, "platform": { "release": "21.4.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010df" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": true, "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). -->
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6086/reactions" }
https://api.github.com/repos/psf/requests/issues/6086/timeline
null
null
null
null
false
[ "Hi @GiorgioComitini, thanks for bringing this to our attention. From what you've described above, I believe we can already tell this is an issue at the [PySocks](https://github.com/Anorov/PySocks) layer or potentially even CPython. Requests doesn't actually handle any of the socks5 workflow, it's offloaded to urllib3 in [this module](https://github.com/urllib3/urllib3/blob/1.26.x/src/urllib3/contrib/socks.py), which then in turn calls into the socks connection from pysocks.\r\n\r\nI think the next step here would be to verify if PySocks actually works for this case, and work backwards from there. Presumably we could do something like the code below to verify:\r\n\r\n```python\r\nimport socks\r\n\r\ns = socks.socksocket() # Same API as socket.socket in the standard lib\r\ns.set_proxy(socks.PROXY_TYPE_SOCKS5, \"127.0.0.1\", 9050, rdns=True) \r\n\r\ns.connect((\"www.somesite.com\", 80))\r\ns.sendall(\"GET / HTTP/1.1 ...\")\r\nprint(s.recv(4096))\r\n```\r\n\r\nI don't have any of the above infrastructure set up currently or immediate access to an m1 mac. We can add this to the backlog, but it may be faster if you can use the above to check in your current setup.", "@nateprewitt From inspecting the code from urllib3 -> PySocks it appears that things are working as expected? Just like you it'd take a second for me to get a setup to verify the bytes sent over the wire.\r\n\r\n@GiorgioComitini could you also [try reproducing with only urllib3](https://urllib3.readthedocs.io/en/stable/advanced-usage.html#socks-proxies)?", "Hey there, thank you for the quick reply. I tried both your suggestions, and no DNS leak appears to occur when using either socks or urllib3 directly.", "So that's pretty interesting if it's the same versions being used with Requests. The only socks specific code in Requests is [here](https://github.com/psf/requests/blob/79f60274f7e461b8fd2f579e741f748438d7eadb/requests/adapters.py#L181-L191). We create a copy of urllib3's SOCKSProxyManager and then use that to service requests for any URL scheme starting with \"socks\". We pull the [connection](https://github.com/psf/requests/blob/79f60274f7e461b8fd2f579e741f748438d7eadb/requests/adapters.py#L304-L311) from that manager anytime a proxy is chosen.\r\n\r\nThe only other component that's unique to Requests would be our [proxy resolution](https://github.com/psf/requests/blob/main/requests/utils.py#L837-L861) logic. We do consider environment variables, .netrc files, and system configurations when determining if a proxy specification is actually used. Is it possible something is configured on your Mac that's excluding use of the `socks5h` proxy or routing it to a different proxy?", "I can confirm that the versions should be the same (by looking at the urllib3.\\_\\_file\\_\\_'s called by the main python script and from Requests' adapters module). My environment (see below) does not seem to contain any variable related to proxies:\r\n\r\n```bash\r\n\r\n$ /usr/bin/env\r\n\r\nPWD=/Users/giorgiocomitini/.pyenv/versions/3.10-base/lib/python3.10/site-packages/requests\r\nPYENV_ROOT=/Users/giorgiocomitini/.pyenv\r\nTERM_SESSION_ID=[xxx]\r\nHOME=/Users/giorgiocomitini\r\nCONDA_SHLVL=0\r\nTMPDIR=[xxx]\r\nSHELL=/opt/homebrew/bin/fish\r\nCONDA_PYTHON_EXE=/Users/giorgiocomitini/.pyenv/versions/conda/bin/python\r\nSHLVL=1\r\nTERM_PROGRAM=Apple_Terminal\r\nUSER=giorgiocomitini\r\nPYENV_SHELL=fish\r\nTERM=xterm-256color\r\nSSH_AUTH_SOCK=/private/tmp/com.apple.launchd.[xxx]/Listeners\r\nPATH=/Users/giorgiocomitini/.pyenv/versions/conda/condabin:/Users/giorgiocomitini/.pyenv/shims:/Users/giorgiocomitini/.pyenv/bin:/Users/giorgiocomitini/.shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\r\nXPC_SERVICE_NAME=0\r\nXPC_FLAGS=0x0\r\nTERM_PROGRAM_VERSION=444\r\nCONDA_EXE=/Users/giorgiocomitini/.pyenv/versions/conda/bin/conda\r\nLANG=it_IT.UTF-8\r\nLOGNAME=giorgiocomitini\r\n__CFBundleIdentifier=com.apple.Terminal\r\n```\r\n\r\n(I also ran the script with bash with the same results, so the problem is not related to the fish shell. Moreover, I checked the config files for both fish and bash, and there's nothing there related to proxies).\r\n\r\nAre you able to point me to any configuration specifically considered by Requests, to make sure that nothing is interfering with the proxy resolution?\r\n\r\nOther tests I did:\r\n\r\n- I used a custom SSH SOCKS proxy instead of the Tor one, and it still leaks (so the problem is not Tor-related)\r\n- I used a non-pyenv version of Python (namely, the homebrew-installed 3.10 Python version) with the latest Requests and PySocks, and it still leaks (so the problem is not pyenv-related)\r\n- As a control, I used both the Tor and the SSH proxy on Firefox (with remote DNS on), and it doesn't leak (so the problem is not system-wide, as already confirmed by using curl and bare urllib3)\r\n\r\nSome other hints:\r\n\r\n```python\r\n>> resp = requests.get(...)\r\n\r\n>> resp.connection.proxy_manager\r\n{'socks5h://127.0.0.1:9050': <urllib3.contrib.socks.SOCKSProxyManager at 0x111640730>}\r\n\r\n>> resp.connection.proxy_manager['socks5h://127.0.0.1:9050'].proxy_url\r\n'socks5h://127.0.0.1:9050'\r\n```\r\n\r\nso the scheme seems to have gone through to the SOCKSProxyManager object (though I don't really know how it works, so I might be mistaken).\r\n\r\nFinally, in the utils module, I added a debug line to print out the resolved proxies:\r\n\r\n```python\r\ndef resolve_proxies(request, proxies, trust_env=True):\r\n proxies = proxies if proxies is not None else {}\r\n url = request.url\r\n scheme = urlparse(url).scheme\r\n no_proxy = proxies.get('no_proxy')\r\n new_proxies = proxies.copy()\r\n\r\n if trust_env and not should_bypass_proxies(url, no_proxy=no_proxy):\r\n environ_proxies = get_environ_proxies(url, no_proxy=no_proxy)\r\n\r\n proxy = environ_proxies.get(scheme, environ_proxies.get('all'))\r\n\r\n if proxy:\r\n new_proxies.setdefault(scheme, proxy)\r\n print(new_proxies) #DEBUG\r\n return new_proxies\r\n```\r\n\r\nand I get the correct proxies:\r\n\r\n```python\r\nOrderedDict([('http', 'socks5h://127.0.0.1:9050'), ('https', 'socks5h://127.0.0.1:9050')])\r\n```", "I suspect https://github.com/psf/requests/blob/79f60274f7e461b8fd2f579e741f748438d7eadb/requests/utils.py#L789 is our problem. All the way in `urllib.request` it calls `gethostbyname` https://github.com/python/cpython/blob/ba76f901923d80ad9b24bb1636aa751d55e0c768/Lib/urllib/request.py#L2594", "The quickest way to confirm that would be to set `trust_env` to False and see if the behavior goes away.", "Setting trust_env to False indeed prevents the leak!\r\n\r\nSo, if it's not an environment variable (since no proxy variable is returned by /usr/bin/env), what could it be? I found no .netrc nor _netrc files in my system.\r\n\r\nI don't understand if @sigmavirus24's suggestion is related to the env or not.\r\n", "It's related to how we check if you have the host you're trying to visit configured in the NO_PROXY setting. It's a standard library function that doesn't understand socks", "Yes, that's it!\r\n\r\nSo, in my system settings for the proxies (Network->Advanced->Proxies) I have an \"Ignore the proxy settings for the following hosts and domains\" field, and the hosts and domains to be ignored are *.local and 169.254/16 (which by the way are precisely those reported in the comments in urllib.request). If I delete these, the DNS doesn't leak anymore. This is why my old Mac didn't leak: it's not that it's an Intel vs. Apple CPU, it's just that I did not have those exceptions on (I guess they are set by default depending on the MacOS version). This issue's title needs to be changed, then.\r\n\r\nI see where's the problem. The standard library's urllib needs to know the host's IP in order to compare it with the system exceptions. If it does not know it, it issues a DNS request. This behavior may be consistent with an observation I had made previously, namely that a single DNS request is subject to the leak, as opposed to e.g. multiple requests that would need to be issued if DN resolution were to be performed completely on the client's side (think about redirections). The rest of the conversation happens on the proxy as it should be.\r\n\r\nShall I assume then that this is an actual bug, albeit related to how Requests interacts with urllib and MacOS?\r\n\r\n", "> Shall I assume then that this is an actual bug, albeit related to how Requests interacts with urllib and MacOS?\r\n\r\nThere's absolutely nothing we can do to fix this short of completely re-implementing large portions of `urllib.request`.\r\n\r\nThis might be a \"Known Issue\" with PySocks+Requests (because I suspect there are similar settings on Linux and Windows) that we can document a user-based change for, but we will not accept the maintenance burden necessary to \"fix\" this.", "I understand this, and I think documenting the issue is a good start.\r\n\r\nNonetheless, I believe that this might be a (quite severe) security issue that should still be addressed in some way. For future versions of Requests, would it be feasible - or even desirable, for general-purpose usage - to have the proxy resolution logic not look at the environment/system as soon as proxies are specified to Requests as arguments? After all, if I'm using proxies through Requests (as opposed to at the system level), it's because I want Requests - and not my system - to manage the proxies. Of course, I do not have a clear picture of the proxy resolution logic, so if this does not make sense to you I apologize.", "> After all, if I'm using proxies through Requests (as opposed to at the system level), it's because I want Requests - and not my system - to manage the proxies\r\n\r\nThat's what `trust_env=False` is for. Unfortunately, many people expect to be able to override one specific value and merge the rest together which is why we perform the behaviour you've observed.\r\n\r\nSome folks want the behaviour of having an environment with `http_proxy` and `https_proxy` and `no_proxy` and then to override in a single request `requests.get(url, proxies={\"http\": \"..\"})` but to still use `https_proxy` and `no_proxy`. The best way to disable that is `trust_env=False`.", "Got it, thanks. This is why I asked if it would even be desirable (to me, yes, but to others, it depends).\r\n\r\nDo you confirm that the only way to set ```trust_env``` to ```False``` is either to change the code in https://github.com/psf/requests/blob/main/requests/sessions.py#L398 or to issue requests exclusively through sessions objects? E.g.\r\n\r\n```python\r\n>> from requests import Session\r\n\r\n>> session = Session()\r\n\r\n>> session.trust_env=False\r\n\r\n>> session.request(...)\r\n```\r\nI.e. that ```trust_env``` cannot be passed as a parameter to one of the API functions?\r\n\r\nAnyways, thanks to you all guys for the useful answers.", "Hi @GiorgioComitini,\r\n\r\nApologies for the delay. Yes, this is intended to be a Session-wide setting rather than per request. Either you trust the host or you don't. In general with Requests, you should always be using your own Session for anything outside of basic testing/prototyping. If you truly need to toggle between trusting and not trusting the environment in the same code base, you might consider doing something like:\r\n\r\n```python\r\ntrusted_session = Session()\r\nuntrusted_session = Session()\r\nuntrusted_session.trust_env = False\r\n[...]\r\n```\r\n\r\nIt's probably worth taking a closer look to determine if that's really necessary though." ]
https://api.github.com/repos/psf/requests/issues/6085
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6085/labels{/name}
https://api.github.com/repos/psf/requests/issues/6085/comments
https://api.github.com/repos/psf/requests/issues/6085/events
https://github.com/psf/requests/issues/6085
1,169,523,189
I_kwDOABTKOs5FtYH1
6,085
Session preparation does not preserve the underlying cookie jar policy
{ "avatar_url": "https://avatars.githubusercontent.com/u/47358913?v=4", "events_url": "https://api.github.com/users/isidentical/events{/privacy}", "followers_url": "https://api.github.com/users/isidentical/followers", "following_url": "https://api.github.com/users/isidentical/following{/other_user}", "gists_url": "https://api.github.com/users/isidentical/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/isidentical", "id": 47358913, "login": "isidentical", "node_id": "MDQ6VXNlcjQ3MzU4OTEz", "organizations_url": "https://api.github.com/users/isidentical/orgs", "received_events_url": "https://api.github.com/users/isidentical/received_events", "repos_url": "https://api.github.com/users/isidentical/repos", "site_admin": false, "starred_url": "https://api.github.com/users/isidentical/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/isidentical/subscriptions", "type": "User", "url": "https://api.github.com/users/isidentical", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-03-15T11:05:33Z
2023-03-16T00:03:11Z
2022-03-15T14:48:53Z
NONE
resolved
Python (through `http.cookiejar`) allows different cookie policies to be set to customize the behavior of certain attributes (e.g secure); but on the `prepare_request` stage of sessions, `requests` looses the information regarding the custom policy. https://github.com/psf/requests/blob/79f60274f7e461b8fd2f579e741f748438d7eadb/requests/sessions.py#L433-L435 More specifically, the `merge_cookies` method only carries out the policy of the newly created `RequestsCookieJar`, even though the cookie jar that is bound to that session might have different properties (including a policy) ## Reproduction Steps ```python import json import requests from http import cookiejar from requests.cookies import RequestsCookieJar class AllowEverythingPolicy(cookiejar.DefaultCookiePolicy): def return_ok_secure(self, cookie, request): """Check whether the given cookie is sent to a secure host.""" return True jar = RequestsCookieJar(policy=AllowEverythingPolicy()) jar.set('secure_cookie', 'value', secure=True) jar.set('insecure_cookie', 'value', secure=False) session = requests.Session() session.cookies = jar request = requests.Request( 'GET', 'http://localhost', ) prepared_request = session.prepare_request(request) print(prepared_request.headers['Cookie']) ``` ## Expected Result ``` insecure_cookie=value; secure_cookie=value ``` ## Actual Result ``` insecure_cookie=value ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.0.10" }, "cryptography": { "version": "3.4.8" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.5" }, "platform": { "release": "5.11.0-49-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "101010cf", "version": "20.0.1" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010af" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": false, "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/6085/reactions" }
https://api.github.com/repos/psf/requests/issues/6085/timeline
null
completed
null
null
false
[ "Hi @isidentical, thanks for the ticket. In the future please check open and closed issues before posting new ones. This is a long standing issue in Requests that has had a number of attempts to address. The main problem is doing this in a non-breaking manner. I'm going to resolve this in favor of the existing [ticket](https://github.com/psf/requests/issues/5449).\r\n\r\nRelevant:\r\n#3416\r\n#3463\r\n#4000\r\n#4042\r\n#4513" ]
https://api.github.com/repos/psf/requests/issues/6084
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6084/labels{/name}
https://api.github.com/repos/psf/requests/issues/6084/comments
https://api.github.com/repos/psf/requests/issues/6084/events
https://github.com/psf/requests/issues/6084
1,169,399,064
I_kwDOABTKOs5Fs50Y
6,084
response.json() raises inconsistent exception type
{ "avatar_url": "https://avatars.githubusercontent.com/u/7398948?v=4", "events_url": "https://api.github.com/users/JeremyVriens/events{/privacy}", "followers_url": "https://api.github.com/users/JeremyVriens/followers", "following_url": "https://api.github.com/users/JeremyVriens/following{/other_user}", "gists_url": "https://api.github.com/users/JeremyVriens/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JeremyVriens", "id": 7398948, "login": "JeremyVriens", "node_id": "MDQ6VXNlcjczOTg5NDg=", "organizations_url": "https://api.github.com/users/JeremyVriens/orgs", "received_events_url": "https://api.github.com/users/JeremyVriens/received_events", "repos_url": "https://api.github.com/users/JeremyVriens/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JeremyVriens/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JeremyVriens/subscriptions", "type": "User", "url": "https://api.github.com/users/JeremyVriens", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-03-15T09:24:03Z
2023-03-29T00:03:09Z
2022-03-28T18:54:25Z
NONE
resolved
This is a follow up on https://github.com/psf/requests/issues/5794, the issue is marked as resolved, but it's not completely resolved. ## Expected Result When no encoding is returned, you have simplejson installed and the content is not JSON, a requests.exceptions.JSONDecodeError should be raised. ## Actual Result A simplejson.errors.JSONDecodeError is raised. ## Reproduction Steps In the PR, related to the issue mentioned, the JSONDecodeError is only caught when there's an encoding (https://github.com/psf/requests/pull/5856/files#diff-633feaee006d302c2988a1f73e39e76a55ec077b595d8c0a093f72d75fb1799cR909-R911), this except clause should also be there a few lines above (when there's no encoding).
{ "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/6084/reactions" }
https://api.github.com/repos/psf/requests/issues/6084/timeline
null
completed
null
null
false
[ "Hi @JeremyVriens, thanks for bringing this to our attention! This was definitely a miss in the original PR. I've pushed up a quick test and fix (#6097) to appropriately catch and wrap the JSONDecodeError. Please let us know if you have any comments or concerns on the PR, otherwise, this should be addressed in the next minor release.", "We've gone ahead and merged #6097. I'll close this since it's now on the path for release, but please feel free to leave any further comments here or on the PR." ]
https://api.github.com/repos/psf/requests/issues/6083
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6083/labels{/name}
https://api.github.com/repos/psf/requests/issues/6083/comments
https://api.github.com/repos/psf/requests/issues/6083/events
https://github.com/psf/requests/issues/6083
1,166,442,716
I_kwDOABTKOs5FhoDc
6,083
ValueError is raised instead of InvalidHeader
{ "avatar_url": "https://avatars.githubusercontent.com/u/7085494?v=4", "events_url": "https://api.github.com/users/arossert/events{/privacy}", "followers_url": "https://api.github.com/users/arossert/followers", "following_url": "https://api.github.com/users/arossert/following{/other_user}", "gists_url": "https://api.github.com/users/arossert/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/arossert", "id": 7085494, "login": "arossert", "node_id": "MDQ6VXNlcjcwODU0OTQ=", "organizations_url": "https://api.github.com/users/arossert/orgs", "received_events_url": "https://api.github.com/users/arossert/received_events", "repos_url": "https://api.github.com/users/arossert/repos", "site_admin": false, "starred_url": "https://api.github.com/users/arossert/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/arossert/subscriptions", "type": "User", "url": "https://api.github.com/users/arossert", "user_view_type": "public" }
[]
closed
true
null
[]
{ "closed_at": "2022-06-09T17:44:05Z", "closed_issues": 8, "created_at": "2022-04-07T05:17:41Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/30", "id": 7852541, "labels_url": "https://api.github.com/repos/psf/requests/milestones/30/labels", "node_id": "MI_kwDOABTKOs4Ad9H9", "number": 30, "open_issues": 0, "state": "closed", "title": "2.28.0", "updated_at": "2022-06-09T17:44:05Z", "url": "https://api.github.com/repos/psf/requests/milestones/30" }
6
2022-03-11T13:53:53Z
2023-06-09T00:03:11Z
2022-06-08T18:04:26Z
NONE
resolved
When using an invalid header name it is not checked in the `requests.utils.check_header_validity` function, only the value is checked. This causes the underline HTTPConnection to fail when trying to write the header on `ValueError`, seems like that it is checked against: `_is_legal_header_name = re.compile(rb'[^:\s][^:\r\n]*').fullmatch` The expected exception, in this case, will be `InvalidHeader` ```python import requests requests.get("https://www.google.com", headers={":bad": "header"}) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.10" }, "platform": { "release": "5.4.0-1068-aws", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "1010100f" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": true, "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/6083/reactions" }
https://api.github.com/repos/psf/requests/issues/6083/timeline
null
completed
null
null
false
[ "In `requests.utils.check_header_validity` there is a validation only for value, I think we have to validate both name and value of the header. \r\n\r\nAs per the IMF (refer [https://www.rfc-editor.org/rfc/rfc2822#section-2.2](https://www.rfc-editor.org/rfc/rfc2822#section-2.2)) \r\n\r\n> A field name MUST be composed of printable US-ASCII characters (i.e., characters that have values between 33 and 126, inclusive), except colon.\r\n\r\nI figured the fix for this one (the regex for validating header name goes like this `'^[!-9\\[;-~]*$'`), I am a first timer, but seasoned developer. Please assign it to me, I would like to contribute.", "Thanks for volunteering @Khasim481. The RFC linked is quite old and has been obsolete for almost a decade. I believe you're looking for the definition in the current RFC [7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2). You'll find the exact ABNF is 1 or more `tchar` as defined in [section 3.2.6](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6).\r\n\r\nWe strictly adhere to the spec for field-values but it's correct we omitted the field-name when this was first done. The change was explicitly to solve security risks with header values. This issue is more cosmetic, but I do agree we should have consistency with the error type. We actually already have a [branch](https://github.com/psf/requests/tree/improved_header_validation) in place with most of the fix for this but it's still needs some final refactoring.", "The changes in the [branch](https://github.com/psf/requests/tree/improved_header_validation) looks perfect, If you mention those cosmetic changes broadly here, I can be of help.", "@Khasim481 Any estimation when this will be fixed? ", "It's currently a candidate fix for the next release, 2.28.0.", "This has been merged in #6154 and will be available in the next release. Thanks everyone!" ]
https://api.github.com/repos/psf/requests/issues/6082
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6082/labels{/name}
https://api.github.com/repos/psf/requests/issues/6082/comments
https://api.github.com/repos/psf/requests/issues/6082/events
https://github.com/psf/requests/issues/6082
1,165,403,959
I_kwDOABTKOs5Fdqc3
6,082
Connection broken: InvalidChunkLength error when adding custom request header value with uuid4()
{ "avatar_url": "https://avatars.githubusercontent.com/u/48382094?v=4", "events_url": "https://api.github.com/users/Bakhtiyar-Garashov/events{/privacy}", "followers_url": "https://api.github.com/users/Bakhtiyar-Garashov/followers", "following_url": "https://api.github.com/users/Bakhtiyar-Garashov/following{/other_user}", "gists_url": "https://api.github.com/users/Bakhtiyar-Garashov/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Bakhtiyar-Garashov", "id": 48382094, "login": "Bakhtiyar-Garashov", "node_id": "MDQ6VXNlcjQ4MzgyMDk0", "organizations_url": "https://api.github.com/users/Bakhtiyar-Garashov/orgs", "received_events_url": "https://api.github.com/users/Bakhtiyar-Garashov/received_events", "repos_url": "https://api.github.com/users/Bakhtiyar-Garashov/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Bakhtiyar-Garashov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Bakhtiyar-Garashov/subscriptions", "type": "User", "url": "https://api.github.com/users/Bakhtiyar-Garashov", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-03-10T15:54:22Z
2023-03-12T00:03:28Z
2022-03-10T16:10:28Z
NONE
resolved
<!-- Summary. --> When using UUID v4 as a value for the custom request header in POST request I am facing with error: `{"errorMessage": "(\"Connection broken: InvalidChunkLength(got length b'', 0 bytes read)\", InvalidChunkLength(got length b'', 0 bytes read))", "errorType": "ChunkedEncodingError", "requestId": "844e5761-df0d-4627-8fc3-484bb35cd28d", "stackTrace": [" File \"/var/task/handlers/mw_request.py\", line 23, in lambda_handler\n mw_response = requests.post(\n", " File \"/opt/python/requests/api.py\", line 117, in post\n return request('post', url, data=data, json=json, **kwargs)\n", " File \"/opt/python/requests/api.py\", line 61, in request\n return session.request(method=method, url=url, **kwargs)\n", " File \"/opt/python/requests/sessions.py\", line 529, in request\n resp = self.send(prep, **send_kwargs)\n", " File \"/opt/python/requests/sessions.py\", line 687, in send\n r.content\n", " File \"/opt/python/requests/models.py\", line 838, in content\n self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''\n", " File \"/opt/python/requests/models.py\", line 763, in generate\n raise ChunkedEncodingError(e)\n"]}` ## Expected Result <!-- What you expected. --> Successful POST request ## Actual Result Got the error: {"errorMessage": "(\"Connection broken: InvalidChunkLength(got length b'', 0 bytes read)\", InvalidChunkLength(got length b'', 0 bytes read))", "errorType": "ChunkedEncodingError", "requestId": "844e5761-df0d-4627-8fc3-484bb35cd28d", "stackTrace": [" File \"/var/task/handlers/mw_request.py\", line 23, in lambda_handler\n mw_response = requests.post(\n", " File \"/opt/python/requests/api.py\", line 117, in post\n return request('post', url, data=data, json=json, **kwargs)\n", " File \"/opt/python/requests/api.py\", line 61, in request\n return session.request(method=method, url=url, **kwargs)\n", " File \"/opt/python/requests/sessions.py\", line 529, in request\n resp = self.send(prep, **send_kwargs)\n", " File \"/opt/python/requests/sessions.py\", line 687, in send\n r.content\n", " File \"/opt/python/requests/models.py\", line 838, in content\n self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''\n", " File \"/opt/python/requests/models.py\", line 763, in generate\n raise ChunkedEncodingError(e)\n"]} <!-- What happened instead. --> ## Reproduction Steps ```python import requests import uuid response = requests.post( config.api_url + "/external/customers", json={"request": {"customers": customer}}, headers={"Troy-Correlation-Id": str(uuid.uuid4()}, # here is my custom request header auth=( config.username, config.password, ), ) ``` ## System Information $ python -m requests.help ```json { "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/6082/reactions" }
https://api.github.com/repos/psf/requests/issues/6082/timeline
null
completed
null
null
false
[ "Hi @Bakhtiyar-Garashov,\r\n\r\nI don't believe this is directly related to your supplied header. The server is responding claiming chunked encoding and violating the protocol. We'd need to see the bytes coming across the wire to confirm, but I don't believe there's anything for Requests to do here. If you are able to retrieve the response with a tool like Wireshark AND confirm the response is properly formatted, feel free to reopen." ]
https://api.github.com/repos/psf/requests/issues/6081
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6081/labels{/name}
https://api.github.com/repos/psf/requests/issues/6081/comments
https://api.github.com/repos/psf/requests/issues/6081/events
https://github.com/psf/requests/issues/6081
1,163,968,920
I_kwDOABTKOs5FYMGY
6,081
Call request api very slowly
{ "avatar_url": "https://avatars.githubusercontent.com/u/86577210?v=4", "events_url": "https://api.github.com/users/workingxx92/events{/privacy}", "followers_url": "https://api.github.com/users/workingxx92/followers", "following_url": "https://api.github.com/users/workingxx92/following{/other_user}", "gists_url": "https://api.github.com/users/workingxx92/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/workingxx92", "id": 86577210, "login": "workingxx92", "node_id": "MDQ6VXNlcjg2NTc3MjEw", "organizations_url": "https://api.github.com/users/workingxx92/orgs", "received_events_url": "https://api.github.com/users/workingxx92/received_events", "repos_url": "https://api.github.com/users/workingxx92/repos", "site_admin": false, "starred_url": "https://api.github.com/users/workingxx92/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/workingxx92/subscriptions", "type": "User", "url": "https://api.github.com/users/workingxx92", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-03-09T13:53:43Z
2023-03-12T00:03:29Z
2022-03-10T14:30:20Z
NONE
resolved
<!-- Summary. --> Macos: Monterey (12.0.1) Python call request API very slowly (>8 minutes). Please check the video recording screen bugs ## Expected Result <!-- What you expected. --> ## Actual Result <!-- What happened instead. --> ## Reproduction Steps ```python import requests # This is a sample Python script.im import requests import logging import http.client http.client.HTTPConnection.debuglevel = 1 logging.basicConfig() logging.getLogger().setLevel(logging.DEBUG) requests_log = logging.getLogger("requests.packages.urllib3") requests_log.setLevel(logging.DEBUG) requests_log.propagate = True def print_hi(name): # Use a breakpoint in the code line below to debug your script. print(f'Hi, {name}') # Press ⌘F8 to toggle the breakpoint. # Press the green button in the gutter to run the script. if __name__ == '__main__': print_hi('PyCharm') r = requests.get('https://www.google.com/') print(r.text) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.2" }, "platform": { "release": "21.1.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010df" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": true, "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). --> Video Bugs:
{ "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/6081/reactions" }
https://api.github.com/repos/psf/requests/issues/6081/timeline
null
completed
null
null
false
[ "Hi @workingxx92, this isn't something that is affected by Requests, either your IDE is halting at a break point or there's something in your local network delaying the response. We typically wouldn't expect the connection to the server to be kept open for that long to begin with.\r\n\r\nFor questions on debugging, please use [StackOverflow](https://stackoverflow.com/). We won't be able to provide help with that on this issue tracker." ]
https://api.github.com/repos/psf/requests/issues/6080
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6080/labels{/name}
https://api.github.com/repos/psf/requests/issues/6080/comments
https://api.github.com/repos/psf/requests/issues/6080/events
https://github.com/psf/requests/issues/6080
1,161,256,693
I_kwDOABTKOs5FN171
6,080
How to uinstall requests library using setup.py?
{ "avatar_url": "https://avatars.githubusercontent.com/u/18608358?v=4", "events_url": "https://api.github.com/users/ashokchandran/events{/privacy}", "followers_url": "https://api.github.com/users/ashokchandran/followers", "following_url": "https://api.github.com/users/ashokchandran/following{/other_user}", "gists_url": "https://api.github.com/users/ashokchandran/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ashokchandran", "id": 18608358, "login": "ashokchandran", "node_id": "MDQ6VXNlcjE4NjA4MzU4", "organizations_url": "https://api.github.com/users/ashokchandran/orgs", "received_events_url": "https://api.github.com/users/ashokchandran/received_events", "repos_url": "https://api.github.com/users/ashokchandran/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ashokchandran/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ashokchandran/subscriptions", "type": "User", "url": "https://api.github.com/users/ashokchandran", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-03-07T10:57:39Z
2023-03-08T00:03:28Z
2022-03-07T11:47:23Z
NONE
resolved
We are in a factory environment where we cannot use pip. We installed request library using python install setup.py. Is it possible to uninstall requests library using setup.py. Please share the command.
{ "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/6080/reactions" }
https://api.github.com/repos/psf/requests/issues/6080/timeline
null
completed
null
null
false
[ "Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here." ]
https://api.github.com/repos/psf/requests/issues/6079
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6079/labels{/name}
https://api.github.com/repos/psf/requests/issues/6079/comments
https://api.github.com/repos/psf/requests/issues/6079/events
https://github.com/psf/requests/issues/6079
1,161,171,767
I_kwDOABTKOs5FNhM3
6,079
UnicodeEncodeError: 'latin-1' codec can't encode character '\u0335' in position 19: ordinal not in range(256)
{ "avatar_url": "https://avatars.githubusercontent.com/u/85980399?v=4", "events_url": "https://api.github.com/users/DeloitteYuvarajan/events{/privacy}", "followers_url": "https://api.github.com/users/DeloitteYuvarajan/followers", "following_url": "https://api.github.com/users/DeloitteYuvarajan/following{/other_user}", "gists_url": "https://api.github.com/users/DeloitteYuvarajan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DeloitteYuvarajan", "id": 85980399, "login": "DeloitteYuvarajan", "node_id": "MDQ6VXNlcjg1OTgwMzk5", "organizations_url": "https://api.github.com/users/DeloitteYuvarajan/orgs", "received_events_url": "https://api.github.com/users/DeloitteYuvarajan/received_events", "repos_url": "https://api.github.com/users/DeloitteYuvarajan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DeloitteYuvarajan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DeloitteYuvarajan/subscriptions", "type": "User", "url": "https://api.github.com/users/DeloitteYuvarajan", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-03-07T09:59:58Z
2022-03-07T11:47:55Z
2022-03-07T10:00:17Z
NONE
null
https://github.com/psf/requests/blob/79f60274f7e461b8fd2f579e741f748438d7eadb/requests/auth.py#L60 I got the below error on authenticating a Gmail user in my app, P.S: I have client-id and client-secret stored in a file from GCP project. `File "/venv/lib/python3.9/site-packages/google_auth_oauthlib/flow.py", line 240, in fetch_token return self.oauth2session.fetch_token( File "/venv/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 341, in fetch_token r = self.request( File "/venv/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 521, in request return super(OAuth2Session, self).request( File "/venv/lib/python3.9/site-packages/requests/sessions.py", line 515, in request prep = self.prepare_request(req) File "/venv/lib/python3.9/site-packages/requests/sessions.py", line 443, in prepare_request p.prepare( File "/venv/lib/python3.9/site-packages/requests/models.py", line 322, in prepare self.prepare_auth(auth, url) File "/venv/lib/python3.9/site-packages/requests/models.py", line 558, in prepare_auth r = auth(self) File "/venv/lib/python3.9/site-packages/requests/auth.py", line 96, in __call__ r.headers['Authorization'] = _basic_auth_str(self.username, self.password) File "/venv/lib/python3.9/site-packages/requests/auth.py", line 60, in _basic_auth_str username = username.encode('latin1') UnicodeEncodeError: 'latin-1' codec can't encode character '\u0335' in position 19: ordinal not in range(256) `
{ "avatar_url": "https://avatars.githubusercontent.com/u/85980399?v=4", "events_url": "https://api.github.com/users/DeloitteYuvarajan/events{/privacy}", "followers_url": "https://api.github.com/users/DeloitteYuvarajan/followers", "following_url": "https://api.github.com/users/DeloitteYuvarajan/following{/other_user}", "gists_url": "https://api.github.com/users/DeloitteYuvarajan/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DeloitteYuvarajan", "id": 85980399, "login": "DeloitteYuvarajan", "node_id": "MDQ6VXNlcjg1OTgwMzk5", "organizations_url": "https://api.github.com/users/DeloitteYuvarajan/orgs", "received_events_url": "https://api.github.com/users/DeloitteYuvarajan/received_events", "repos_url": "https://api.github.com/users/DeloitteYuvarajan/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DeloitteYuvarajan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DeloitteYuvarajan/subscriptions", "type": "User", "url": "https://api.github.com/users/DeloitteYuvarajan", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6079/reactions" }
https://api.github.com/repos/psf/requests/issues/6079/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/6078
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6078/labels{/name}
https://api.github.com/repos/psf/requests/issues/6078/comments
https://api.github.com/repos/psf/requests/issues/6078/events
https://github.com/psf/requests/issues/6078
1,158,154,865
I_kwDOABTKOs5FCApx
6,078
conda update and conda install throws error with traceback to requests\adapters.py conn = self.get_connection(request.url, proxies)
{ "avatar_url": "https://avatars.githubusercontent.com/u/9674662?v=4", "events_url": "https://api.github.com/users/DrWhen/events{/privacy}", "followers_url": "https://api.github.com/users/DrWhen/followers", "following_url": "https://api.github.com/users/DrWhen/following{/other_user}", "gists_url": "https://api.github.com/users/DrWhen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/DrWhen", "id": 9674662, "login": "DrWhen", "node_id": "MDQ6VXNlcjk2NzQ2NjI=", "organizations_url": "https://api.github.com/users/DrWhen/orgs", "received_events_url": "https://api.github.com/users/DrWhen/received_events", "repos_url": "https://api.github.com/users/DrWhen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/DrWhen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/DrWhen/subscriptions", "type": "User", "url": "https://api.github.com/users/DrWhen", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2022-03-03T09:12:37Z
2022-03-04T14:26:46Z
2022-03-03T11:18:51Z
NONE
null
Anaconda is able to use Requests to update or install packages from my Windows 10 Enterprise desktop environment, but throws an unexpected error in my Windows Server 2022 Standard environment. ## Expected Result With the below proxy settings in .condarc file in the Windows environment, conda update or conda install packages work. For example: ``` conda update conda conda -c conda-forge fuzzywuzzy ``` ## Actual Result In the server environment, using same .condarc file, if I run any conda update or install command, I get the following error: ERROR REPORT Traceback (most recent call last): File "C:\Users\dyer01\Anaconda3\lib\site-packages\requests\adapters.py", line 412, in send conn = self.get_connection(request.url, proxies) File "C:\Users\dyer01\Anaconda3\lib\site-packages\requests\adapters.py", line 309, in get_connection proxy_manager = self.proxy_manager_for(proxy) File "C:\Users\dyer01\Anaconda3\lib\site-packages\requests\adapters.py", line 193, in proxy_manager_for manager = self.proxy_manager[proxy] = proxy_from_url( File "C:\Users\dyer01\Anaconda3\lib\site-packages\urllib3\poolmanager.py", line 536, in proxy_from_url return ProxyManager(proxy_url=url, **kw) File "C:\Users\dyer01\Anaconda3\lib\site-packages\urllib3\poolmanager.py", line 480, in __init__ raise ProxySchemeUnknown(proxy.scheme) urllib3.exceptions.ProxySchemeUnknown: Proxy URL had no scheme, should start with http:// or https:// During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__ return func(*args, **kwargs) File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main exit_code = do_call(args, p) File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_call return getattr(module, func_name)(args, parser) File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\cli\main_install.py", line 20, in execute install(args, parser, 'install') File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\cli\install.py", line 261, in install unlink_link_transaction = solver.solve_for_transaction( File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transaction unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier, File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 157, in solve_for_diff final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned, File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state ssc = self._collect_all_metadata(ssc) File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated return f(*args, **kwds) File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 425, in _collect_all_metadata index, r = self._prepare(prepared_specs) File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 1020, in _prepare reduced_index = get_reduced_index(self.prefix, self.channels, File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\index.py", line 288, in get_reduced_index new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs, File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 140, in que-ry_all result = tuple(concat(executor.map(subdir_query, channel_urls))) File "C:\Users\dyer01\Anaconda3\lib\concurrent\futures\_base.py", line 608, in result_iterator yield fs.pop().result() File "C:\Users\dyer01\Anaconda3\lib\concurrent\futures\_base.py", line 445, in result return self.__get_result() File "C:\Users\dyer01\Anaconda3\lib\concurrent\futures\_base.py", line 390, in __get_result raise self._exception File "C:\Users\dyer01\Anaconda3\lib\concurrent\futures\thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 132, in <lambda> subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query( File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 145, in query self.load() File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 210, in load _internal_state = self._load() File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 375, in _load raw_repodata_str = fetch_repodata_remote_request( File "C:\Users\dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 701, in fetch_repodata_remote_request resp = session.get(join_url(url, filename), headers=headers, proxies=session.proxies, File "C:\Users\dyer01\Anaconda3\lib\site-packages\requests\sessions.py", line 555, in get return self.request('GET', url, **kwargs) File "C:\Users\dyer01\Anaconda3\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "C:\Users\dyer01\Anaconda3\lib\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "C:\Users\dyer01\Anaconda3\lib\site-packages\requests\adapters.py", line 414, in send raise InvalidURL(e, request=request) requests.exceptions.InvalidURL: Proxy URL had no scheme, should start with http:// or https:// $ C:\Users\dyer01\Anaconda3\Scripts\conda-script.py install -c conda-forge fuzzywuzzy environment variables: CIO_TEST=<not set> CONDA_DEFAULT_ENV=base CONDA_EXE=C:\Users\dyer01\Anaconda3\condabin\..\Scripts\conda.exe CONDA_EXES="C:\Users\dyer01\Anaconda3\condabin\..\Scripts\conda.exe" CONDA_PREFIX=C:\Users\dyer01\Anaconda3 CONDA_PROMPT_MODIFIER=(base) CONDA_PYTHON_EXE=C:\Users\dyer01\Anaconda3\python.exe CONDA_ROOT=C:\Users\dyer01\Anaconda3 CONDA_SHLVL=1 CURL_CA_BUNDLE=<not set> HOMEPATH=\ PATH=C:\Users\dyer01\Anaconda3;C:\Users\dyer01\Anaconda3\Library\mingw-w64\ bin;C:\Users\dyer01\Anaconda3\Library\usr\bin;C:\Users\dyer01\Anaconda 3\Library\bin;C:\Users\dyer01\Anaconda3\Scripts;C:\Users\dyer01\Anacon da3\bin;C:\Users\dyer01\Anaconda3;C:\Users\dyer01\Anaconda3\Library\mi ngw-w64\bin;C:\Users\dyer01\Anaconda3\Library\usr\bin;C:\Users\dyer01\ Anaconda3\Library\bin;C:\Users\dyer01\Anaconda3\Scripts;C:\Users\dyer0 1\Anaconda3\bin;C:\Users\dyer01\Anaconda3\condabin;C:\Users\dyer01\Ana conda3;C:\Users\dyer01\Anaconda3\Library\mingw-w64\bin;C:\Users\dyer01 \Anaconda3\Library\usr\bin;C:\Users\dyer01\Anaconda3\Library\bin;C:\Us ers\dyer01\Anaconda3\Scripts;C:\Windows\system32;C:\Windows;C:\Windows \System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\S ystem32\OpenSSH;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Azure Data Studio\bin;C:\Users\dyer01\AppData\Local\Microsoft\WindowsApps;. PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\Windows PowerShell\v1.0\Modules REQUESTS_CA_BUNDLE=<not set> SSL_CERT_FILE=<not set> active environment : base active env location : C:\Users\dyer01\Anaconda3 shell level : 1 user config file : C:\Users\dyer01\.condarc populated config files : C:\Users\dyer01\.condarc conda version : 4.10.3 conda-build version : 3.21.6 python version : 3.9.7.final.0 virtual packages : __win=0=0 __archspec=1=x86_64 base environment : C:\Users\dyer01\Anaconda3 (writable) conda av data dir : C:\Users\dyer01\Anaconda3\etc\conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/win-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : C:\Users\dyer01\Anaconda3\pkgs C:\Users\dyer01\.conda\pkgs C:\Users\dyer01\AppData\Local\conda\conda\pkgs envs directories : C:\Users\dyer01\Anaconda3\envs C:\Users\dyer01\.conda\envs C:\Users\dyer01\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.10.3 requests/2.26.0 CPython/3.9.7 Windows/10 Windows/10.0.20348 administrator : False netrc file : None offline mode : False ## Reproduction Steps Requests used in conda install or update work in one environment, but not in other. Modifying the .condarc file (adding "http" and/or quotes and/or slashes and/or indents) fails to connect to proxy server. Testing internet connection using Requests, as decribed [here](https://www.kite.com/python/answers/how-to-check-internet-connection-in-python), works in both environments. ## System Information **Windows environment:** { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.0.4" }, "cryptography": { "version": "3.4.8" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.8.11" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "101010cf", "version": "21.0.0" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010bf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": false, "using_pyopenssl": true } **Server environment:** { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.0.4" }, "cryptography": { "version": "3.4.8" }, "idna": { "version": "3.2" }, "implementation": { "name": "CPython", "version": "3.9.7" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "101010cf", "version": "21.0.0" }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "101010cf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": false, "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/6078/reactions" }
https://api.github.com/repos/psf/requests/issues/6078/timeline
null
completed
null
null
false
[ "You seem to have a proxy configured without an explicit scheme.\n\n```\nrequests.exceptions.InvalidURL: Proxy URL had no scheme, should start with http:// or https://\n```\n\nQuoting from your report. Fix that and everything should be fine", "Unfortunately, whenever I use the full scheme, I get the following error: \r\n\r\nCollecting package metadata (current_repodata.json): failed\r\nProxyError: Conda cannot proceed due to an error in your proxy configuration.\r\nCheck for typos and other configuration errors in any '.netrc' file in your home directory,\r\nany environment variables ending in '_PROXY', and any other system-wide proxy\r\nconfiguration settings.\r\n\r\nIn the windows environment, I was getting this same error until I removed the scheme, and it worked(s) fine.\r\n\r\nI have tried all manner of changes to the .condarc file, including schemes, slashes, quotes, indents. Maybe there is still something I haven't thought of to try. This is what works in the windows environemnt:\r\n\r\n```\r\nproxy_servers:\r\n http: blah.ldd.rnk:8080\r\n https: blah.ldd.rnk:8080\r\n```", "I don't use conda so I can't help you fix this. I've told you what the issue is with requests. You should use stack overflow or a different conda support channel to figure out your other issues", "Stack overflow advise says to do exactly what you suggest, but it never worked. After the pain I went through, in August last year, I even posted [the solution without the scheme](https://stackoverflow.com/questions/36729023/how-to-make-anaconda-work-behind-http-proxy-not-https/68724703#68724703), which has helped at least one person. I don't see any options but to raise it with conda, who may say it's not a conda issue either.", "I was completing a report for conda, and made the following typo:\r\n```\r\nproxy_servers:\r\n http: http://rnkserv14.lra.rnk:8080\r\n https: http://rnkserv14.lra.rnk:8080\r\n```\r\nNote - the lack of 's' in the https: scheme. \r\n\r\nIt works. I don't have anything to do with our proxy server, but I guess it is set up like this." ]
https://api.github.com/repos/psf/requests/issues/6077
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6077/labels{/name}
https://api.github.com/repos/psf/requests/issues/6077/comments
https://api.github.com/repos/psf/requests/issues/6077/events
https://github.com/psf/requests/issues/6077
1,154,717,309
I_kwDOABTKOs5E05Z9
6,077
Got ssl.SSLEOFError when working behind a vpn
{ "avatar_url": "https://avatars.githubusercontent.com/u/50520540?v=4", "events_url": "https://api.github.com/users/Andrew-Goo/events{/privacy}", "followers_url": "https://api.github.com/users/Andrew-Goo/followers", "following_url": "https://api.github.com/users/Andrew-Goo/following{/other_user}", "gists_url": "https://api.github.com/users/Andrew-Goo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Andrew-Goo", "id": 50520540, "login": "Andrew-Goo", "node_id": "MDQ6VXNlcjUwNTIwNTQw", "organizations_url": "https://api.github.com/users/Andrew-Goo/orgs", "received_events_url": "https://api.github.com/users/Andrew-Goo/received_events", "repos_url": "https://api.github.com/users/Andrew-Goo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Andrew-Goo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Andrew-Goo/subscriptions", "type": "User", "url": "https://api.github.com/users/Andrew-Goo", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-03-01T00:54:50Z
2022-05-30T01:28:55Z
2022-03-01T01:13:06Z
NONE
resolved
Hi guys I m working behind a vpn and trying to use requests, but I keep getting `ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1123)`. Once I turned down the vpn it worked as excepted. Is there any way to work around this issue? ### Example ``` import requests requests.get('https://www.google.com') ``` ### Result ``` Traceback (most recent call last): File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\urllib3\connectionpool.py", line 700, in urlopen self._prepare_proxy(conn) File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\urllib3\connectionpool.py", line 994, in _prepare_proxy conn.connect() File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\urllib3\connection.py", line 364, in connect conn = self._connect_tls_proxy(hostname, conn) File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\urllib3\connection.py", line 501, in _connect_tls_proxy socket = ssl_wrap_socket( File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls) File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock) File "D:\Programming\Python\Python39\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "D:\Programming\Python\Python39\lib\ssl.py", line 1040, in _create self.do_handshake() File "D:\Programming\Python\Python39\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1123) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\requests\adapters.py", line 440, in send resp = conn.urlopen( File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\urllib3\connectionpool.py", line 785, in urlopen retries = retries.increment( File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\urllib3\util\retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1123)'))) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Programming\Projects\Python\Scripts\crawling\util.py", line 197, in <module> main() File "D:\Programming\Projects\Python\Scripts\crawling\util.py", line 189, in main requests.get('https://www.google.com') File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, **kwargs) File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\requests\sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\requests\sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "D:\Programming\Projects\Python\Scripts\venv\lib\site-packages\requests\adapters.py", line 517, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1123)'))) ```
{ "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/6077/reactions" }
https://api.github.com/repos/psf/requests/issues/6077/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\nYour proxy is messing with TCP state in violation of the specification, we can't fix this for you.", "Alright thanks anyway." ]
https://api.github.com/repos/psf/requests/issues/6076
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6076/labels{/name}
https://api.github.com/repos/psf/requests/issues/6076/comments
https://api.github.com/repos/psf/requests/issues/6076/events
https://github.com/psf/requests/issues/6076
1,153,423,968
I_kwDOABTKOs5Ev9pg
6,076
Throwing a UnicodeEncodeError
{ "avatar_url": "https://avatars.githubusercontent.com/u/51775887?v=4", "events_url": "https://api.github.com/users/killabit/events{/privacy}", "followers_url": "https://api.github.com/users/killabit/followers", "following_url": "https://api.github.com/users/killabit/following{/other_user}", "gists_url": "https://api.github.com/users/killabit/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/killabit", "id": 51775887, "login": "killabit", "node_id": "MDQ6VXNlcjUxNzc1ODg3", "organizations_url": "https://api.github.com/users/killabit/orgs", "received_events_url": "https://api.github.com/users/killabit/received_events", "repos_url": "https://api.github.com/users/killabit/repos", "site_admin": false, "starred_url": "https://api.github.com/users/killabit/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/killabit/subscriptions", "type": "User", "url": "https://api.github.com/users/killabit", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-02-27T22:22:06Z
2022-05-28T23:00:37Z
2022-02-27T22:24:47Z
NONE
resolved
Traceback (most recent call last): File "/usr/share/doc/hackingtool/hackingtool.py", line 109, in <module> all_tools.show_options() File "/usr/share/doc/hackingtool/core.py", line 161, in show_options self.show_info() File "/usr/share/doc/hackingtool/hackingtool.py", line 71, in show_info print(logo + '\033[0m \033[97m') UnicodeEncodeError: 'latin-1' codec can't encode characters in position 9-10: ordinal not in range(256)
{ "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/6076/reactions" }
https://api.github.com/repos/psf/requests/issues/6076/timeline
null
completed
null
null
false
[ "Hi @killabit,\n\nNothing in this stacktrace is related to Requests. We won't be able to help here." ]
https://api.github.com/repos/psf/requests/issues/6075
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6075/labels{/name}
https://api.github.com/repos/psf/requests/issues/6075/comments
https://api.github.com/repos/psf/requests/issues/6075/events
https://github.com/psf/requests/pull/6075
1,152,698,140
PR_kwDOABTKOs4zlv3g
6,075
Drop EOL Python 3.6
{ "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
4
2022-02-27T02:58:21Z
2022-05-28T17:04:13Z
2022-02-27T13:11:33Z
CONTRIBUTOR
resolved
See: - https://endoflife.date/python - https://www.python.org/dev/peps/pep-0494/#lifespan
{ "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/6075/reactions" }
https://api.github.com/repos/psf/requests/issues/6075/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6075.diff", "html_url": "https://github.com/psf/requests/pull/6075", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6075.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6075" }
true
[ "We haven't even dropped 2.7. Please don't spam this project", "@sigmavirus24 I know we haven't dropped Python 2, that won't happen until v3 AFAIU. Are you saying dropping EOL 3.x is blocked on dropping 2.7? I saw commits dropping [3.4](https://github.com/psf/requests/commit/68e581f1b5b4425a0ee950a2433fc3c92e671d0f) and [3.5](https://github.com/psf/requests/commit/f6c0619d892a41dcf84933810ffda89e9f6b10d4) which is why I thought it was alright to open this PR.\r\n\r\nAlso, I don't think it's quite right to characterize a contribution as spam. I came along and saw something that might need doing so I tried to help out (was going push a final commit to update docs files later today).\r\n\r\nI understand there's a lot going on in the world right now though, so no worries.", "Hi @ofek,\r\n\r\nWe are planning to drop [Python 2.7](https://github.com/psf/requests/issues/6023) and 3.6 in the next minor release. We're currently keeping `main` clean for any other hotfix issues that may come in before that release. Thanks for contribution and we'll look at trying to pull some of this in when it's time.", "@nateprewitt Oh that's awesome, thank you!" ]
https://api.github.com/repos/psf/requests/issues/6074
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6074/labels{/name}
https://api.github.com/repos/psf/requests/issues/6074/comments
https://api.github.com/repos/psf/requests/issues/6074/events
https://github.com/psf/requests/pull/6074
1,150,740,629
PR_kwDOABTKOs4zew1Y
6,074
Fix environment CA Bundle resolution
{ "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
[]
{ "closed_at": "2022-06-09T17:44:05Z", "closed_issues": 8, "created_at": "2022-04-07T05:17:41Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/30", "id": 7852541, "labels_url": "https://api.github.com/repos/psf/requests/milestones/30/labels", "node_id": "MI_kwDOABTKOs4Ad9H9", "number": 30, "open_issues": 0, "state": "closed", "title": "2.28.0", "updated_at": "2022-06-09T17:44:05Z", "url": "https://api.github.com/repos/psf/requests/milestones/30" }
2
2022-02-25T18:36:12Z
2022-07-25T13:55:11Z
2022-02-26T13:39:28Z
MEMBER
null
This is a proposal to address #6071. Rather than settling on the final value from `CURL_CA_BUNDLE` we'll end the conditional change with `verify`. This ensures we don't accidentally take a "falsey" value and disable verification for misconfigured environments.
{ "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/6074/reactions" }
https://api.github.com/repos/psf/requests/issues/6074/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6074.diff", "html_url": "https://github.com/psf/requests/pull/6074", "merged_at": "2022-02-26T13:39:28Z", "patch_url": "https://github.com/psf/requests/pull/6074.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6074" }
true
[ "So... we considered this a feature and not a bug. How can we control `verify=False` through environmental variables now?", "Use case when call of `requests` api is buried deep in the dependency stack and you **need to force** `verify=False`" ]
https://api.github.com/repos/psf/requests/issues/6073
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6073/labels{/name}
https://api.github.com/repos/psf/requests/issues/6073/comments
https://api.github.com/repos/psf/requests/issues/6073/events
https://github.com/psf/requests/issues/6073
1,149,334,187
I_kwDOABTKOs5EgXKr
6,073
Problem with cert between python2 and python3
{ "avatar_url": "https://avatars.githubusercontent.com/u/71830807?v=4", "events_url": "https://api.github.com/users/luanon404/events{/privacy}", "followers_url": "https://api.github.com/users/luanon404/followers", "following_url": "https://api.github.com/users/luanon404/following{/other_user}", "gists_url": "https://api.github.com/users/luanon404/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/luanon404", "id": 71830807, "login": "luanon404", "node_id": "MDQ6VXNlcjcxODMwODA3", "organizations_url": "https://api.github.com/users/luanon404/orgs", "received_events_url": "https://api.github.com/users/luanon404/received_events", "repos_url": "https://api.github.com/users/luanon404/repos", "site_admin": false, "starred_url": "https://api.github.com/users/luanon404/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/luanon404/subscriptions", "type": "User", "url": "https://api.github.com/users/luanon404", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-02-24T14:09:13Z
2022-05-25T20:00:28Z
2022-02-24T19:57:07Z
NONE
resolved
**My package i used** + requests: 2.27.0 + openssl: 1.1.1m 2021 + certifi: 2021.10.8 **Problem** + python2: can use param cert=**("cert.pem", "cert.key")** or add **br** to Accept-Encoding (python2 only has gzip and deflate), headers={"Accept-Encoding: "gzip, deflate, **br**"} to access cloudflare checking + python3: i used same method but seem like it is not working i tried to fix the requests module but its still not working, if you know anything please tell me, your every word is a good suggestion :)
{ "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/6073/reactions" }
https://api.github.com/repos/psf/requests/issues/6073/timeline
null
completed
null
null
false
[ "Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here." ]
https://api.github.com/repos/psf/requests/issues/6072
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6072/labels{/name}
https://api.github.com/repos/psf/requests/issues/6072/comments
https://api.github.com/repos/psf/requests/issues/6072/events
https://github.com/psf/requests/issues/6072
1,148,662,941
I_kwDOABTKOs5EdzSd
6,072
HTTPS-proxy [Errno 111] Connection refused
{ "avatar_url": "https://avatars.githubusercontent.com/u/1911342?v=4", "events_url": "https://api.github.com/users/karray/events{/privacy}", "followers_url": "https://api.github.com/users/karray/followers", "following_url": "https://api.github.com/users/karray/following{/other_user}", "gists_url": "https://api.github.com/users/karray/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/karray", "id": 1911342, "login": "karray", "node_id": "MDQ6VXNlcjE5MTEzNDI=", "organizations_url": "https://api.github.com/users/karray/orgs", "received_events_url": "https://api.github.com/users/karray/received_events", "repos_url": "https://api.github.com/users/karray/repos", "site_admin": false, "starred_url": "https://api.github.com/users/karray/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/karray/subscriptions", "type": "User", "url": "https://api.github.com/users/karray", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-02-23T22:52:05Z
2022-05-25T01:29:44Z
2022-02-24T00:40:19Z
NONE
resolved
<!-- Summary. --> While all other protocols are working, I can't access an URL using an HTTPS-proxy ([StackOverflow](https://stackoverflow.com/questions/71150284/python-request-https-proxy-errno-111-connection-refused)) ## Expected Result Open an HTTPS-URL using HTTPS-proxy. <!-- What you expected. --> ## Actual Result [Errno 111] Connection refused ``` --------------------------------------------------------------------------- ConnectionRefusedError Traceback (most recent call last) [/usr/local/lib/python3.7/dist-packages/urllib3/connection.py](https://localhost:8080/#) in _new_conn(self) 158 conn = connection.create_connection( --> 159 (self._dns_host, self.port), self.timeout, **extra_kw) 160 14 frames [/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py](https://localhost:8080/#) in create_connection(address, timeout, source_address, socket_options) 79 if err is not None: ---> 80 raise err 81 [/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py](https://localhost:8080/#) in create_connection(address, timeout, source_address, socket_options) 69 sock.bind(source_address) ---> 70 sock.connect(sa) 71 return sock ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: NewConnectionError Traceback (most recent call last) [/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 593 if is_new_proxy_conn: --> 594 self._prepare_proxy(conn) 595 [/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in _prepare_proxy(self, conn) 804 conn.set_tunnel(self._proxy_host, self.port, self.proxy_headers) --> 805 conn.connect() 806 [/usr/local/lib/python3.7/dist-packages/urllib3/connection.py](https://localhost:8080/#) in connect(self) 300 # Add certificate verification --> 301 conn = self._new_conn() 302 hostname = self.host [/usr/local/lib/python3.7/dist-packages/urllib3/connection.py](https://localhost:8080/#) in _new_conn(self) 167 raise NewConnectionError( --> 168 self, "Failed to establish a new connection: %s" % e) 169 NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fc4f55256d0>: Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: MaxRetryError Traceback (most recent call last) [/usr/local/lib/python3.7/dist-packages/requests/adapters.py](https://localhost:8080/#) in send(self, request, stream, timeout, verify, cert, proxies) 449 retries=self.max_retries, --> 450 timeout=timeout 451 ) [/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 637 retries = retries.increment(method, url, error=e, _pool=self, --> 638 _stacktrace=sys.exc_info()[2]) 639 retries.sleep() [/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py](https://localhost:8080/#) in increment(self, method, url, response, error, _pool, _stacktrace) 398 if new_retry.is_exhausted(): --> 399 raise MaxRetryError(_pool, url, error or ResponseError(cause)) 400 MaxRetryError: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc4f55256d0>: Failed to establish a new connection: [Errno 111] Connection refused'))) During handling of the above exception, another exception occurred: ProxyError Traceback (most recent call last) [<ipython-input-5-0042a445fda6>](https://localhost:8080/#) in <module>() 5 print(proxy_url) 6 ----> 7 r = requests.get('https://google.com/', proxies = {protocol: proxy_url}) 8 r.status_code [/usr/local/lib/python3.7/dist-packages/requests/api.py](https://localhost:8080/#) in get(url, params, **kwargs) 73 """ 74 ---> 75 return request('get', url, params=params, **kwargs) 76 77 [/usr/local/lib/python3.7/dist-packages/requests/api.py](https://localhost:8080/#) in request(method, url, **kwargs) 59 # cases, and look like a memory leak in others. 60 with sessions.Session() as session: ---> 61 return session.request(method=method, url=url, **kwargs) 62 63 [/usr/local/lib/python3.7/dist-packages/requests/sessions.py](https://localhost:8080/#) in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 527 } 528 send_kwargs.update(settings) --> 529 resp = self.send(prep, **send_kwargs) 530 531 return resp [/usr/local/lib/python3.7/dist-packages/requests/sessions.py](https://localhost:8080/#) in send(self, request, **kwargs) 643 644 # Send the request --> 645 r = adapter.send(request, **kwargs) 646 647 # Total elapsed time of the request (approximately) [/usr/local/lib/python3.7/dist-packages/requests/adapters.py](https://localhost:8080/#) in send(self, request, stream, timeout, verify, cert, proxies) 511 512 if isinstance(e.reason, _ProxyError): --> 513 raise ProxyError(e, request=request) 514 515 if isinstance(e.reason, _SSLError): ProxyError: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc4f55256d0>: Failed to establish a new connection: [Errno 111] Connection refused'))) ``` <!-- What happened instead. --> ## Reproduction Steps Here is also a google [colab](https://colab.research.google.com/drive/1mlRyfHna4jH1R27SYJoRO9udoQYu5UsB?usp=sharing) that reproduces this issue. ```python import requests import random PROXY_LIST_URL = 'https://proxylist.geonode.com/api/proxy-list?limit=50&page=1&sort_by=lastChecked&sort_type=desc&protocols=https' proxies = requests.get(PROXY_LIST_URL).json()['data'] proxy = random.choice(proxies) protocol = proxy['protocols'][0] proxy_url = f"{protocol}://{proxy['ip']}:{proxy['port']}" print(proxy_url) r = requests.get('https://google.com', proxies = {protocol: proxy_url}) print(r.status_code) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.12" }, "cryptography": { "version": "" }, "idna": { "version": "2.10" }, "implementation": { "name": "CPython", "version": "3.7.12" }, "platform": { "release": "5.4.144+", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "1010100f" }, "urllib3": { "version": "1.24.3" }, "using_charset_normalizer": false, "using_pyopenssl": false } ``` <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6072/reactions" }
https://api.github.com/repos/psf/requests/issues/6072/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\nAdditionally, in the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/6071
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6071/labels{/name}
https://api.github.com/repos/psf/requests/issues/6071/comments
https://api.github.com/repos/psf/requests/issues/6071/events
https://github.com/psf/requests/issues/6071
1,148,620,184
I_kwDOABTKOs5Edo2Y
6,071
CURL_CA_BUNDLE= disables certificate verification
{ "avatar_url": "https://avatars.githubusercontent.com/u/1145674?v=4", "events_url": "https://api.github.com/users/owtaylor/events{/privacy}", "followers_url": "https://api.github.com/users/owtaylor/followers", "following_url": "https://api.github.com/users/owtaylor/following{/other_user}", "gists_url": "https://api.github.com/users/owtaylor/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/owtaylor", "id": 1145674, "login": "owtaylor", "node_id": "MDQ6VXNlcjExNDU2NzQ=", "organizations_url": "https://api.github.com/users/owtaylor/orgs", "received_events_url": "https://api.github.com/users/owtaylor/received_events", "repos_url": "https://api.github.com/users/owtaylor/repos", "site_admin": false, "starred_url": "https://api.github.com/users/owtaylor/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/owtaylor/subscriptions", "type": "User", "url": "https://api.github.com/users/owtaylor", "user_view_type": "public" }
[]
closed
true
null
[]
null
24
2022-02-23T21:54:42Z
2022-12-20T22:25:04Z
2022-02-26T13:39:28Z
NONE
null
<!-- Summary. --> I'm not the first to notice this, see: https://stackoverflow.com/questions/48391750/disable-python-requests-ssl-validation-for-an-imported-module Which implies people have even relied on the current behavior as a hack ... but I think it's pretty clear that the current behavior is an accidental bug, which should be fixed (for requests 3?) Vaguely related to #3829 ## Expected Result An empty-string CURL_CA_BUNDLE should use default system verification, the same way as: * An unset CURL_CA_BUNDLE * An empty-string or unset REQUESTS_CA_BUNDLE * Behavior of curl/libcurl with an empty-string or unset CURL_CA_BUNDLE ## Actual Result Empty CURL_CA_BUNDLE disables certificate verification ## Reproduction Steps * Set CURL_CA_BUNDLE to an empty value, try to fetch a self-signed or invalid HTTPS endpoint => success
{ "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": 1, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6071/reactions" }
https://api.github.com/repos/psf/requests/issues/6071/timeline
null
completed
null
null
false
[ "Hi @owtaylor,\r\n\r\nThanks for bringing this to our attention! This was definitely not intended behavior and we agree it's a bug. We've pushed up a PR (#6074) to fix the issue in the next minor release of Requests. While this may be breaking for the workflow discussed in Stackoverflow, that was never a supported method for disabling verification.\r\n\r\nPlease let us know if you have any other concerns or comments on the PR. Thanks!\r\n\r\n", "@nateprewitt : It pains me to request this, but given how popular the hack is, do you think it might make sense to create an environment variable for globally disabling SSL validation in requests?", "> given how popular the hack is,\n\nCan you give evidence of this being popular? ", "> > given how popular the hack is,\r\n> \r\n> Can you give evidence of this being popular?\r\n\r\nhttps://stackoverflow.com/questions/48391750/disable-python-requests-ssl-validation-for-an-imported-module has approximately 50 upvotes and 29k views.", "> > > given how popular the hack is,\n> > \n> > Can you give evidence of this being popular?\n> \n> https://stackoverflow.com/questions/48391750/disable-python-requests-ssl-validation-for-an-imported-module has approximately 50 upvotes and 29k views.\n\nYeah, we're not interested in giving people a global hammer to misuse based off of view numbers that don't reflect how widely used that was. I have viewed stack overflow answers that were useless because a search engine thought them relevant. You're qualification for popular is deeply flawed", "> do you think it might make sense to create an environment variable for globally disabling SSL validation in requests?\r\n\r\nWhile we take breakages very seriously in Requests due its wide usage, I think this falls far outside the realm of intended behavior. I don't believe we have interest in adding an alternative environment variable either. Requests has historically limited usage of env vars because of their \"magic\" behavior between systems.\r\n\r\nThe main concern is once this is set, it's very easy to forget, leading to unintended consequences. Globally disabling cert verification not only affects direct Requests invocations but any tool using Requests, which is not something we want to support.\r\n\r\nIf tools using Requests are working against endpoints without an accessible cert bundle, they should either expose a configurable endpoint or method to disable verification which is then passed to requests `verify` argument.", "@nateprewitt `they should either expose a configurable endpoint or method to disable verification which is then passed to requests verify argument` - maybe they should, but they don't always do, so having **any** option to disable the verification after removing the above hack would be quite important. Cannot `verify` be also configured with some envar like `REQUESTS_SSL_VERIFY=[true|false]`?", "It can not, no. We don't support that. We _shouldn't_ support that. To quote myself:\r\n\r\n> Yeah, we're not interested in giving people a global hammer\r\n\r\nAnd quoting Nate, \r\n\r\n> The main concern is once this is set, it's very easy to forget, leading to unintended consequences. Globally disabling cert verification not only affects direct Requests invocations but any tool using Requests, which is not something we want to support.\r\n\r\nThis isn't going to happen.", "@sigmavirus24 / @nateprewitt - so what would be your \"unofficial\" recommendation to disable SSL verification for `requests` calls in 3rd party libraries (other than waiting for maintainers to address the issue / forking the repo to add `verify=False`)? Ofc the best solution would be to provide custom CA_BUNDLE and pass the verification, but sometimes it's problematic to figure out the proper one if the internal networking setup is messy, and you need a way to bypass that in the meantime to allow people do their job.", "> you need a way to bypass that in the meantime to allow people do their job.\r\n\r\nPin/Cap the version of Requests you use and use the old bypass. We can't and won't support 100% of possible users. We have to do the best to secure as many users as possible and prevent them from accidentally injuring themselves with a large and dangerous weapon.", "Also if your jobs are so dependent upon this software, your employers should be sponsoring the PSF", "@sigmavirus24 I didn't mean to convince you to implement the workaround, I see your point, I just wanted to ask if there were some non-obvious, probably no less dirty than the old one, workarounds which can be used in such situation which you were aware of. \r\n\r\nI heard about `PYTHONHTTPSVERIFY=0`, but it seems it doesn't have any effect on `requests`, right?\r\n\r\n> Also if your jobs are so dependent upon this software, your employers should be sponsoring the PSF\r\n\r\nIf developers had impact on corporate budgets, especially in non-IT-first companies... Book-size topic.", "@89z it's highly unlikely this issue is affecting your usage, unless you've installed Requests directly from this Github repository. The change is not publicly available on PyPI.", "Just an FYI guys, this is actually really widely used out there. This is going to break quite a lot CICD pipelines, applications and whatnot, especially in a corporate setting where private CAs are a common thing. I understand your reasoning and I sort of agree. But you should likely prepare for a bunch of complaints :) for most that have to deal with private CAs, this is not a bug, it's a feature.", "> Just an FYI guys, this is actually really widely used out there. This is going to break quite a lot CICD pipelines, applications and whatnot, especially in a corporate setting where private CAs are a common thing. I understand your reasoning and I sort of agree. But you should likely prepare for a bunch of complaints :) for most that have to deal with private CAs, this is not a bug, it's a feature.\n\nFor the security people trying to ensure a company has secure CI/CD pipelines and can trust what you're doing, this is a significant improvement. For management that may have to deal with regulatory fines as a result of an engineer bypassing internal attempts at securing the software pipeline that can be undermined so easily, this is an improvement.\n\nRequests bears a lot of responsibility. People are constantly trying to gain access to my accounts here and elsewhere ostensibly to take malicious control of this and other packages. Requests is so widely used that the slightest thing can be leveraged wide and far. This seems like such a tiny thing, but so many large scale attacks are combinations of things deemed too small to be worth fixing.\n\nWhen we fix it we're demonized by developers for making their lives harder. When we're one link in the chain when a company's data or network is compromised, we're demonized for not having been proactive enough. Personally, I would rather do everything I can to protect anyone relying on this library whether they know it or not than I would rather protect someone's ability to bypass internal measures they feel are too difficult to comply with. ", "@89z, we'd ask you participate in the conversation transparently and constructively. Retroactively deleting your comments and misrepresenting others statements doesn't move the conversation forward. You can find the code of conduct [here](https://www.python.org/psf/conduct/) if you have questions.\r\n\r\nIn regards to the issue at hand, we have patched a security issue that was never intended to exist in the library. What is being asked for is a feature addition that we don't plan to add. As stated above, we acknowledge the immediate transition may be difficult for some user, but is the best long term decision. Fixing this in other tools is a one line change and will give users more fine grained control if they do intend to disable verification. That's the safest path forward for the community.", "> \n> > Retroactively deleting your comments\n> \n> @nateprewitt Since youre not my employer, I dont think you get to dictate how I use the site.\n> \n> > misrepresenting others statements\n> \n> So if @sigmavirus24 misrepresents developer actions, then its fine, but if I call him on it, then its not?\n> \n> > You can find the code of conduct [here](https://www.python.org/psf/conduct/) if you have questions.\n> \n> No thanks. @sigmavirus24 started the off topic comments, not me. So point your links to them instead.\n> \n\nI was responding to someone else, not to you but if you feel those statements apply to you, perhaps that's not a problem with what I said.\n\nIf you think what I have said violates the code of conduct, please do report me. ", "> Requests bears a lot of responsibility\r\n\r\nI know it does, and everyone is thankful for the work you are doing. On the other hand, I see it as a big limitation of software freedom to prevent people to do whatever they like on their own stuff, and the responsibility for what they do should never fall onto the library developer", "> > Requests bears a lot of responsibility\n> \n> I know it does, and everyone is thankful for the work you are doing. On the other hand, I see it as a big limitation of software freedom to prevent people to do whatever they like on their own stuff, and the responsibility for what they do should never fall onto the library developer\n\nYou fundamentally misunderstand software freedom. It's not the freedom to have the software be preprogrammed to do whatever you wish, no matter how inadvisable and insecure. It's the ability to read and modify the source to fix issues and then release those for others. You still have software freedom.\n\nAll software has politics. This project's politics is that it shouldn't be easy to lose one's life savings or a cool hundred million because a large caliber pre-loaded firearm is pointed at every user's (& users of dependent software) foot. If you disagree with our politics, you have software freedom and can do what you like", "> > Just an FYI guys, this is actually really widely used out there. This is going to break quite a lot CICD pipelines, applications and whatnot, especially in a corporate setting where private CAs are a common thing. I understand your reasoning and I sort of agree. But you should likely prepare for a bunch of complaints :) for most that have to deal with private CAs, this is not a bug, it's a feature.\r\n> \r\n> For the security people trying to ensure a company has secure CI/CD pipelines and can trust what you're doing, this is a significant improvement. For management that may have to deal with regulatory fines as a result of an engineer bypassing internal attempts at securing the software pipeline that can be undermined so easily, this is an improvement.\r\n> \r\n> Requests bears a lot of responsibility. People are constantly trying to gain access to my accounts here and elsewhere ostensibly to take malicious control of this and other packages. Requests is so widely used that the slightest thing can be leveraged wide and far. This seems like such a tiny thing, but so many large scale attacks are combinations of things deemed too small to be worth fixing.\r\n> \r\n> When we fix it we're demonized by developers for making their lives harder. When we're one link in the chain when a company's data or network is compromised, we're demonized for not having been proactive enough. Personally, I would rather do everything I can to protect anyone relying on this library whether they know it or not than I would rather protect someone's ability to bypass internal measures they feel are too difficult to comply with.\r\n\r\nThanks for the response :) I understand the viewpoint, and as mentioned, I sort of agree. Demonization is a strong word, I wouldn't really say that, you really are just forcing developers to do the right thing, and from this point of view, I completely agree.\r\n\r\nThere are however instances where it's just going to be tedious and unnecessary. F.e. when your compute lies in an isolated VPN, where the entire communication inside this network is already protected and quite restricted, then there is an \"internal trust\" between the servers inside of the VPN. Therefore no need to verify (if you can reach the machine, you trust each other essentially).\r\n\r\nGit is also a widely used project, likely even more than requests, and they do offer the `GIT_SSL_NO_VERIFY` env variable. I still believe it's a feature to disable SSL verification by an env variable, I do agree that the variable shouldn't be called `CURL_CA_BUNDLE`, perhaps `REQUESTS_SSL_NO_VERIFY` instead. I also believe you shouldn't bear the responsibility of people doing dumb stuff with your library :)\r\n\r\nAnyway, thanks for the response. I just wanted to voice opinions from my nearby community of Python developers. We will respect any decisions you make.", "@sigmavirus24 You're claiming that you prevent misconfigured environments by providing this fix, but you're also forgetting that the workaround is actively used by corporate developers that sit behind a firewall that acts like man in the middle proxy, where the development environment *is* misconfigured out of the box, as the firewall certificate is never installed in any machines, nor software that would go through that firewall. I would agree with your viewpoint that it's \"more secure\" to prevent this if we were forced to pin certificates, but sadly we're not. \r\n\r\nOther than that, you could atleast provide a proper workaround, like creating your own CA bundle, and adding certificates there, and steer people to the proper solution on SO citing your status.", "> Other than that, you could atleast provide a proper workaround, like creating your own CA bundle, and adding certificates there, and steer people to the proper solution on SO citing your status.\n\nRead the license. You aren't entitled to my time. What we do, we do with limited time and resources and generally without help at this point whilst only ever receiving criticism. I am not responsible for documenting easily Google-able instructions for problems at least a decade old. ", "I would also like to point out that we use non-valid certificates in development (for example, staging lets-encrypt certs which simulate the certification processs without issuing anything that is actually valid) for the microservices ecosystems we manage. We control configuration of all these services via ConfigMaps and Secrets that are attached to Deployments on Kubernetes, thereby setting variable env vars and config files.\r\n\r\nWhenever we have to drop something in that is python-based it is an _enormous_ chore to get this working since there is no way to globally deactivate SSL verification for anything that uses requests. I would be very happy to see something like a REQUESTS_SSL_NO_VERIFY global env var.", "> Can you give evidence of this being popular?\r\n\r\nHere's one example: `authlib` [recommends in their docs controlling verification in this way](https://docs.authlib.org/en/latest/client/requests.html). (See also https://github.com/lepture/authlib/issues/474 requesting an update to `authlib` docs.) `authlib` in turn is widely used as a base library for building auth clients.\r\n\r\n\r\n" ]
https://api.github.com/repos/psf/requests/issues/6070
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6070/labels{/name}
https://api.github.com/repos/psf/requests/issues/6070/comments
https://api.github.com/repos/psf/requests/issues/6070/events
https://github.com/psf/requests/issues/6070
1,144,124,020
I_kwDOABTKOs5EMfJ0
6,070
Migrate test suite to support Flask>2.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-02-19T01:42:34Z
2024-08-13T00:03:49Z
2023-08-13T16:58:07Z
MEMBER
resolved
As shown in #5846 and #6069, our test suite is now thoroughly broken from Flask 2.0 onwards. We never did a deep dive to understand what caused the breakage and now changes in the underlying modules (markupsafe, werkzeug) are causing further problems. We need to sit down and work out the issue, unblocking upgrading Flask if possible.
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6070/reactions" }
https://api.github.com/repos/psf/requests/issues/6070/timeline
null
completed
null
null
false
[ "Ping.", "Resolved in #6496." ]
https://api.github.com/repos/psf/requests/issues/6069
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6069/labels{/name}
https://api.github.com/repos/psf/requests/issues/6069/comments
https://api.github.com/repos/psf/requests/issues/6069/events
https://github.com/psf/requests/pull/6069
1,144,118,567
PR_kwDOABTKOs4zJFOW
6,069
Pin markupsafe for older versions of Jinja2
{ "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
2022-02-19T01:38:37Z
2022-05-20T19:00:23Z
2022-02-19T13:34:48Z
MEMBER
resolved
Fix for build issue in #6068. The release of `markupsafe==2.1` broke older versions of Jinja2 (specifically <3.0). We're still stuck on Flask<2.0 because our test suite broke when it was released and never got fixed. This is a temporary patch to get the test suite working again and I'm going to open an issue to track resolving the Flask issue. Upstream issue: pallets/markupsafe#283
{ "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/6069/reactions" }
https://api.github.com/repos/psf/requests/issues/6069/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6069.diff", "html_url": "https://github.com/psf/requests/pull/6069", "merged_at": "2022-02-19T13:34:48Z", "patch_url": "https://github.com/psf/requests/pull/6069.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6069" }
true
[]
https://api.github.com/repos/psf/requests/issues/6068
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6068/labels{/name}
https://api.github.com/repos/psf/requests/issues/6068/comments
https://api.github.com/repos/psf/requests/issues/6068/events
https://github.com/psf/requests/pull/6068
1,144,098,905
PR_kwDOABTKOs4zJAqx
6,068
Reword proxies section and add warning
{ "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
2022-02-19T01:24:21Z
2022-05-21T00:00:48Z
2022-02-19T23:04:07Z
MEMBER
resolved
This adds a warning around the Session proxies issues in Requests 2.x and cleans up a few erroneous sentences in the following section. Notably, rewording the environment intro to match the warning above, and removing `curl_ca_bundle` which was added in #5670. It's not particularly relevant to this section and is covered elsewhere. ## Preview Render <img width="738" alt="Screen Shot 2022-02-18 at 6 20 06 PM" src="https://user-images.githubusercontent.com/5271761/154780254-5e7e16ac-b446-4fe8-93d4-917029f8f50e.png">
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6068/reactions" }
https://api.github.com/repos/psf/requests/issues/6068/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6068.diff", "html_url": "https://github.com/psf/requests/pull/6068", "merged_at": "2022-02-19T23:04:07Z", "patch_url": "https://github.com/psf/requests/pull/6068.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6068" }
true
[]
https://api.github.com/repos/psf/requests/issues/6067
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6067/labels{/name}
https://api.github.com/repos/psf/requests/issues/6067/comments
https://api.github.com/repos/psf/requests/issues/6067/events
https://github.com/psf/requests/issues/6067
1,141,707,964
I_kwDOABTKOs5EDRS8
6,067
Pydantic SecretStr support
{ "avatar_url": "https://avatars.githubusercontent.com/u/9877444?v=4", "events_url": "https://api.github.com/users/Diego-MX/events{/privacy}", "followers_url": "https://api.github.com/users/Diego-MX/followers", "following_url": "https://api.github.com/users/Diego-MX/following{/other_user}", "gists_url": "https://api.github.com/users/Diego-MX/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Diego-MX", "id": 9877444, "login": "Diego-MX", "node_id": "MDQ6VXNlcjk4Nzc0NDQ=", "organizations_url": "https://api.github.com/users/Diego-MX/orgs", "received_events_url": "https://api.github.com/users/Diego-MX/received_events", "repos_url": "https://api.github.com/users/Diego-MX/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Diego-MX/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Diego-MX/subscriptions", "type": "User", "url": "https://api.github.com/users/Diego-MX", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2022-02-17T18:33:36Z
2022-05-22T21:00:33Z
2022-02-17T18:43:58Z
NONE
resolved
This post is about guidance on a specific feature request that I came accross when using `requests` and `pydantic`. I also raised the issue in `pydantic` forum: [link to issue](https://github.com/samuelcolvin/pydantic/discussions/3808) ### Description* I store credentials in a dictionary such as: ``` some_headers = { 'user' : 'myself', 'password' : SecretStr('asdfghk') } ``` When passing this to `requests`, I get something of the type: ```the_response = requests.get('http://some-url.com', headers=some_headers) InvalidHeader: Value for header {user: **********} must be of type str or bytes, not <class 'pydantic.types.SecretStr'>``` I've read the documentation on handling the headers through Session and Request objects. And I did manage to solve it in my specific use case. Would this be somethiing that the package is interested in handling altogether? I would also want to try my skills on contributing, but I may need some assurence that the issue is handleable and interesting. Thank you for the consideration.
{ "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/6067/reactions" }
https://api.github.com/repos/psf/requests/issues/6067/timeline
null
completed
null
null
false
[ "Unless you're trying to send `*****` over the wire I don't believe this is going to work. The class also doesn't support base `str` operations like `decode`, which means this class can't be converted to `bytes` easily. I don't believe we have intention to support something like this at this time. You might consider some intermediary function to convert from this class into `bytes` for use with Requests.", "I would go further and say that Requests handles native types only. We don't need to support every library's custom data types as those should be converted to a native type by that library's developers or by users of both who know what behavior they want. ", "Thank you for your answers. That makes sense. \r\nI'll use it in my own classes, and if I find a stronger case of use, I'll come back to the forum. \r\nBest. ", "@Diego-MX to make sure I was clear - We will not accept any contribution that adds support for SecretStr." ]
https://api.github.com/repos/psf/requests/issues/6066
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6066/labels{/name}
https://api.github.com/repos/psf/requests/issues/6066/comments
https://api.github.com/repos/psf/requests/issues/6066/events
https://github.com/psf/requests/issues/6066
1,141,262,580
I_kwDOABTKOs5EBkj0
6,066
Ignoring ssl certificate does not suppress urllib3 log warning entries
{ "avatar_url": "https://avatars.githubusercontent.com/u/11428188?v=4", "events_url": "https://api.github.com/users/Blindfreddy/events{/privacy}", "followers_url": "https://api.github.com/users/Blindfreddy/followers", "following_url": "https://api.github.com/users/Blindfreddy/following{/other_user}", "gists_url": "https://api.github.com/users/Blindfreddy/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Blindfreddy", "id": 11428188, "login": "Blindfreddy", "node_id": "MDQ6VXNlcjExNDI4MTg4", "organizations_url": "https://api.github.com/users/Blindfreddy/orgs", "received_events_url": "https://api.github.com/users/Blindfreddy/received_events", "repos_url": "https://api.github.com/users/Blindfreddy/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Blindfreddy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Blindfreddy/subscriptions", "type": "User", "url": "https://api.github.com/users/Blindfreddy", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-02-17T12:15:26Z
2022-05-18T17:06:34Z
2022-02-17T16:26:13Z
NONE
resolved
Specifying ```verify=False``` to ignore ssl certificate does not suppress urllib3 warning log entries, causing the log to fill up with unwanted warnings. ## Expected Result When certificate verification is purposely suppressed, no log entries warning about this condition should be emitted. ## Actual Result Even with ```verify=False ```, log entries such as the following are written to the log: ``` Feb 17 11:57:27 rpi4 python[8811]: warnings.warn( Feb 17 11:57:27 rpi4 python[8811]: /root/pyvenv/<...>/urllib3/connectionpool.py:1043: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.178.216'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings ``` This can easily fill up the log when there are many such requests. ## Reproduction Steps ```python import requests requests.get('https://kennethreitz.org', verify=False) <Response [200]> ``` Then check syslog, e.g ```journalctl -u <applicable unit>``` and note log entries such as the above ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.11" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.1" }, "platform": { "release": "5.10.63-v7+", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "1010104f" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": true, "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/6066/reactions" }
https://api.github.com/repos/psf/requests/issues/6066/timeline
null
completed
null
null
false
[ "In the future, please search **closed and** open issues before creating new ones that are duplicates.", "Oh apologies, I couldn't find a duplicate, otherwise I wouldn't have posted. Would you kindly share the link to the original ? Many thanks." ]
https://api.github.com/repos/psf/requests/issues/6065
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6065/labels{/name}
https://api.github.com/repos/psf/requests/issues/6065/comments
https://api.github.com/repos/psf/requests/issues/6065/events
https://github.com/psf/requests/pull/6065
1,136,382,719
PR_kwDOABTKOs4yvKYD
6,065
prepare url if http or ws
{ "avatar_url": "https://avatars.githubusercontent.com/u/7768398?v=4", "events_url": "https://api.github.com/users/heyarnold1/events{/privacy}", "followers_url": "https://api.github.com/users/heyarnold1/followers", "following_url": "https://api.github.com/users/heyarnold1/following{/other_user}", "gists_url": "https://api.github.com/users/heyarnold1/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/heyarnold1", "id": 7768398, "login": "heyarnold1", "node_id": "MDQ6VXNlcjc3NjgzOTg=", "organizations_url": "https://api.github.com/users/heyarnold1/orgs", "received_events_url": "https://api.github.com/users/heyarnold1/received_events", "repos_url": "https://api.github.com/users/heyarnold1/repos", "site_admin": false, "starred_url": "https://api.github.com/users/heyarnold1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/heyarnold1/subscriptions", "type": "User", "url": "https://api.github.com/users/heyarnold1", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-02-13T20:08:08Z
2022-05-15T13:10:59Z
2022-02-14T12:53:31Z
NONE
resolved
websockets can also include params and so should be prepared as well
{ "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/6065/reactions" }
https://api.github.com/repos/psf/requests/issues/6065/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6065.diff", "html_url": "https://github.com/psf/requests/pull/6065", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6065.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6065" }
true
[ "Requests doesn't support websockets" ]
https://api.github.com/repos/psf/requests/issues/6064
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6064/labels{/name}
https://api.github.com/repos/psf/requests/issues/6064/comments
https://api.github.com/repos/psf/requests/issues/6064/events
https://github.com/psf/requests/issues/6064
1,133,621,183
I_kwDOABTKOs5Dka-_
6,064
requests raises requests.exceptions.ReadTimeout: HTTPConnectionPool while other libraries work fine
{ "avatar_url": "https://avatars.githubusercontent.com/u/1055747?v=4", "events_url": "https://api.github.com/users/5j9/events{/privacy}", "followers_url": "https://api.github.com/users/5j9/followers", "following_url": "https://api.github.com/users/5j9/following{/other_user}", "gists_url": "https://api.github.com/users/5j9/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/5j9", "id": 1055747, "login": "5j9", "node_id": "MDQ6VXNlcjEwNTU3NDc=", "organizations_url": "https://api.github.com/users/5j9/orgs", "received_events_url": "https://api.github.com/users/5j9/received_events", "repos_url": "https://api.github.com/users/5j9/repos", "site_admin": false, "starred_url": "https://api.github.com/users/5j9/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/5j9/subscriptions", "type": "User", "url": "https://api.github.com/users/5j9", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2022-02-12T05:27:20Z
2022-05-19T08:00:28Z
2022-02-17T18:47:27Z
NONE
resolved
Consider the following script: ```python from requests import Session from time import sleep print('requests') session = Session() url = 'http://tsetmc.com/Loader.aspx?ParTree=15' r = session.get(url, timeout=5) # 200 OK print(r.status_code) sleep(200) # if the idle time is greater than ~120 seconds, then the next `session.get` attempt will fail r = session.get(url, timeout=5) print(r.status_code) ``` the above script fails with: ``` requests 200 Traceback (most recent call last): File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse() File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1374, in getresponse response.begin() File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 318, in begin version, status, reason = self._read_status() File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 279, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\socket.py", line 705, in readinto return self._sock.recv_into(b) TimeoutError: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 440, in send resp = conn.urlopen( File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 785, in urlopen retries = retries.increment( File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\packages\six.py", line 770, in reraise raise value File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 451, in _make_request self._raise_timeout(err=e, url=url, timeout_value=read_timeout) File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 340, in _raise_timeout raise ReadTimeoutError( urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='tsetmc.com', port=80): Read timed out. (read timeout=5) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\a\AppData\Roaming\JetBrains\PyCharmCE2021.3\scratches\scratch_3.py", line 13, in <module> r = session.get(url, timeout=5) File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 542, in get return self.request('GET', url, **kwargs) File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "C:\Users\a\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 532, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPConnectionPool(host='tsetmc.com', port=80): Read timed out. (read timeout=5) Process finished with exit code 1 ``` I believe there is some issue with how requests retries connections from the connection pool. Apparently similar script works fine when using other libraries. I've tried the following: ```python import aiohttp import asyncio print('aiohttp') url = 'http://tsetmc.com/Loader.aspx?ParTree=15' async def main(): async with aiohttp.ClientSession() as session: async with session.get('http://httpbin.org/get') as resp: print(resp.status) await asyncio.sleep(200) async with session.get('http://httpbin.org/get') as resp: print(resp.status) asyncio.run(main()) ``` ```python import urllib3 from time import sleep print('urllib3') http = urllib3.PoolManager() url = 'http://tsetmc.com/Loader.aspx?ParTree=15' resp = http.request('GET', url) print(resp.status) sleep(200) resp = http.request('GET', url) print(resp.status) ``` ```python import httpx from time import sleep print('httpx') client = httpx.Client() url = 'http://tsetmc.com/Loader.aspx?ParTree=15' r = client.get('https://example.com') print(r.status_code) sleep(200) r = client.request('GET', url) print(r.status_code) ``` ## Expected Result <!-- What you expected. --> `requests` should be able to handle the underlying situation like other libraries. ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.10" }, "cryptography": { "version": "36.0.1" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.2" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "101010df", "version": "22.0.0" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010df" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": true, "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/6064/reactions" }
https://api.github.com/repos/psf/requests/issues/6064/timeline
null
completed
null
null
false
[ "Hi @5j9, Requests uses urllib3 under the hood so this issue appears specific to how the service is handling calls from the Requests user-agent. If you look through closed issues you'll find it's very common practice for web servers to restrict access via Requests due to abusive scraper behavior. This isn't something we provide support for but is widely answered on platforms such as StackOverflow.", "Hi @nateprewitt ,\r\nI don't belive that user-agent is the key here. I retested my urllib3 script above with an additional `headers={'User-Agent': 'python-requests/2.27.1'}` parameter. It was still able to communicate properly.\r\n\r\n```python\r\nimport urllib3\r\nfrom time import sleep\r\n\r\n\r\nprint('urllib3')\r\nhttp = urllib3.PoolManager()\r\nurl = 'http://tsetmc.com/Loader.aspx?ParTree=15'\r\n\r\nresp = http.request('GET', url, headers={'User-Agent': 'python-requests/2.27.1'})\r\nprint(resp.status)\r\n\r\nsleep(200)\r\n\r\nresp = http.request('GET', url, headers={'User-Agent': 'python-requests/2.27.1'})\r\nprint(resp.status)\r\n\r\n# will print \r\n# 200\r\n# 200\r\n```\r\n\r\nAlso, it does not seem to be a case of restricting access to requests, if it was so, why would the first request succeed and only the second request fail with a timeout? It does not make sense to me, if the server wanted to block `requests` it could have done so on the initial attempt.\r\n", "I might be wrong, but I think I've found the culprit:\r\nhttps://github.com/psf/requests/blob/95f456733656ed93645ff0250bfa54f6d256f6fe/requests/adapters.py#L117\r\n\r\nAs you can see, requests has set `DEFAULT_RETRIES` to `0`. I guess all other libraries retry when facing a failed connections from the connection pool:\r\n\r\nhttps://github.com/urllib3/urllib3/blob/f0dffb4e2437cb2da2ba0a6bbea6211f6fd0fa4b/src/urllib3/util/retry.py#L526\r\nhttps://github.com/encode/httpcore/blob/54567ac1df3761c14f50f2cf55769921f60cd8b3/httpcore/_sync/connection_pool.py#L238\r\n\r\nMounting an `HTTPAdapter` with a retry value other than 0 fixed the issue for me. All I had to do was:\r\n```python\r\nfrom requests.adapters import HTTPAdapter, Retry\r\n\r\nsession = Session()\r\n\r\nretries = Retry(total=1)\r\nsession.mount('http://', HTTPAdapter(max_retries=retries))\r\n...\r\n```", "In HTTP 1.1, all connections are considered persistent unless declared otherwise. However, many HTTP servers use a timeout for connections.[1] Since a client has no way of knowing a connection has been dropped by the server in such cases, it sounds only logical to me for client to retry any apparently closed connection from the connection pool instead of raising an error. Thus, I think requests should change the default retry value of 0 for DEFAULT_RETRIES or implement some other way to retry on closed connections.\r\n\r\n[1]: https://en.wikipedia.org/wiki/HTTP_persistent_connection#HTTP_1.1" ]
https://api.github.com/repos/psf/requests/issues/6063
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6063/labels{/name}
https://api.github.com/repos/psf/requests/issues/6063/comments
https://api.github.com/repos/psf/requests/issues/6063/events
https://github.com/psf/requests/issues/6063
1,129,542,552
I_kwDOABTKOs5DU3OY
6,063
How to set multi same key in request header
{ "avatar_url": "https://avatars.githubusercontent.com/u/24947060?v=4", "events_url": "https://api.github.com/users/djerryz/events{/privacy}", "followers_url": "https://api.github.com/users/djerryz/followers", "following_url": "https://api.github.com/users/djerryz/following{/other_user}", "gists_url": "https://api.github.com/users/djerryz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/djerryz", "id": 24947060, "login": "djerryz", "node_id": "MDQ6VXNlcjI0OTQ3MDYw", "organizations_url": "https://api.github.com/users/djerryz/orgs", "received_events_url": "https://api.github.com/users/djerryz/received_events", "repos_url": "https://api.github.com/users/djerryz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/djerryz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/djerryz/subscriptions", "type": "User", "url": "https://api.github.com/users/djerryz", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-02-10T06:57:55Z
2022-05-11T14:00:43Z
2022-02-10T13:29:25Z
NONE
resolved
To Bypass some WAF, I Wanna Send a Malformed HTTP request like this: ``` POST /123123 HTTP/1.1 Host: a.b.com Hello: hello1 Hello: hello2 a=b ``` Request have two same key in headers. Try: ``` headers = [('interests', 'football'), ('interests', 'basketball')] headers = {'interests': ['football', 'basketball']} ``` are all execept. Try: ``` from urllib3._collections import HTTPHeaderDict headers = HTTPHeaderDict() headers .add('interests', 'football') headers .add('interests', 'basketball') ``` The request will be : ``` POST /123123 HTTP/1.1 Host: a.b.com interests: football, basketball ``` Please help me to know , how to set same key with diff value in request header, 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/6063/reactions" }
https://api.github.com/repos/psf/requests/issues/6063/timeline
null
completed
null
null
false
[ "Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here." ]
https://api.github.com/repos/psf/requests/issues/6062
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6062/labels{/name}
https://api.github.com/repos/psf/requests/issues/6062/comments
https://api.github.com/repos/psf/requests/issues/6062/events
https://github.com/psf/requests/issues/6062
1,126,098,006
I_kwDOABTKOs5DHuRW
6,062
request using a proxy never returns a response
{ "avatar_url": "https://avatars.githubusercontent.com/u/17355461?v=4", "events_url": "https://api.github.com/users/ahmedmani/events{/privacy}", "followers_url": "https://api.github.com/users/ahmedmani/followers", "following_url": "https://api.github.com/users/ahmedmani/following{/other_user}", "gists_url": "https://api.github.com/users/ahmedmani/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ahmedmani", "id": 17355461, "login": "ahmedmani", "node_id": "MDQ6VXNlcjE3MzU1NDYx", "organizations_url": "https://api.github.com/users/ahmedmani/orgs", "received_events_url": "https://api.github.com/users/ahmedmani/received_events", "repos_url": "https://api.github.com/users/ahmedmani/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ahmedmani/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahmedmani/subscriptions", "type": "User", "url": "https://api.github.com/users/ahmedmani", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-02-07T14:52:37Z
2022-05-08T18:00:20Z
2022-02-07T17:37:58Z
NONE
resolved
a request using a wrong content-length header and a proxy never returns a response ## Expected Result ```python header = { "content-length": "9999999", } r = requests.get("https://www.github.com", headers=header, verify=False, proxies={"https": "https://localhost:8080"}) ``` a normal response should be returned ## Actual Result the certificate verification alert is printed and a response is never returned, the request is not sent since it never shows up in mitm proxy ```python header = { "content-length": "9999999", } r = requests.get("https://www.github.com", headers=header) ``` if i remove the proxy a request is sent and a response is returned normally ## System Information ```json { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.6" }, "cryptography": { "version": "3.2.1" }, "idna": { "version": "2.10" }, "implementation": { "name": "CPython", "version": "3.7.9" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "1010108f", "version": "19.1.0" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "1010107f" }, "urllib3": { "version": "1.25.11" }, "using_charset_normalizer": false, "using_pyopenssl": true } ``` also im not sure if this a bug or expected behaviour since it took me 2 days to identify the issue
{ "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/6062/reactions" }
https://api.github.com/repos/psf/requests/issues/6062/timeline
null
completed
null
null
false
[ "This is likely your proxy's fault because you're sending the wrong content-type header. It's likely trying to continue reading from the socket while we're also trying to read a response. This isn't a bug in requests. Don't set headers that Requests usually manages for you so you don't run into issues like this" ]
https://api.github.com/repos/psf/requests/issues/6061
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6061/labels{/name}
https://api.github.com/repos/psf/requests/issues/6061/comments
https://api.github.com/repos/psf/requests/issues/6061/events
https://github.com/psf/requests/issues/6061
1,125,122,399
I_kwDOABTKOs5DEAFf
6,061
Is there anyway that I can set system proxy using requests on Windows?
{ "avatar_url": "https://avatars.githubusercontent.com/u/68642492?v=4", "events_url": "https://api.github.com/users/yc-cui/events{/privacy}", "followers_url": "https://api.github.com/users/yc-cui/followers", "following_url": "https://api.github.com/users/yc-cui/following{/other_user}", "gists_url": "https://api.github.com/users/yc-cui/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yc-cui", "id": 68642492, "login": "yc-cui", "node_id": "MDQ6VXNlcjY4NjQyNDky", "organizations_url": "https://api.github.com/users/yc-cui/orgs", "received_events_url": "https://api.github.com/users/yc-cui/received_events", "repos_url": "https://api.github.com/users/yc-cui/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yc-cui/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yc-cui/subscriptions", "type": "User", "url": "https://api.github.com/users/yc-cui", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-02-06T06:43:34Z
2022-05-07T16:00:26Z
2022-02-06T15:04:16Z
NONE
resolved
When I get a url by setting proxy in requests, it doesn't change the proxy on my computer. How can I change the global proxy on my computer so that I can always use this proxy next time ? I know how to set proxy to my computer manually. I want to do that by coding.
{ "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/6061/reactions" }
https://api.github.com/repos/psf/requests/issues/6061/timeline
null
completed
null
null
false
[ "Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here." ]
https://api.github.com/repos/psf/requests/issues/6059
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6059/labels{/name}
https://api.github.com/repos/psf/requests/issues/6059/comments
https://api.github.com/repos/psf/requests/issues/6059/events
https://github.com/psf/requests/issues/6059
1,124,761,312
I_kwDOABTKOs5DCn7g
6,059
Session Object Doesn't Honor Proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/5131271?v=4", "events_url": "https://api.github.com/users/achapkowski/events{/privacy}", "followers_url": "https://api.github.com/users/achapkowski/followers", "following_url": "https://api.github.com/users/achapkowski/following{/other_user}", "gists_url": "https://api.github.com/users/achapkowski/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/achapkowski", "id": 5131271, "login": "achapkowski", "node_id": "MDQ6VXNlcjUxMzEyNzE=", "organizations_url": "https://api.github.com/users/achapkowski/orgs", "received_events_url": "https://api.github.com/users/achapkowski/received_events", "repos_url": "https://api.github.com/users/achapkowski/repos", "site_admin": false, "starred_url": "https://api.github.com/users/achapkowski/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/achapkowski/subscriptions", "type": "User", "url": "https://api.github.com/users/achapkowski", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2022-02-05T01:15:02Z
2022-05-18T22:00:41Z
2022-02-16T20:02:59Z
NONE
resolved
In 2.27.1, if I define a proxy as this: ```proxy = {"http": "http://127.0.0.1:8888", "https": "http://127.0.0.1:8888"}``` and then I create a session ```python import requests s = requests.Session() s.proxies = proxy s.get("https://google.com").text ``` The proxy setting is not honored. A solution can be inserted here: ``` proxies = proxies or self.proxies or {} ``` This can be found in the PR:
{ "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/6059/reactions" }
https://api.github.com/repos/psf/requests/issues/6059/timeline
null
completed
null
null
false
[ "Dupe of #2018.", "To quote @nateprewitt from way back in Aug 11, 2016:\r\n\r\n> It may be worth noting that it's PR #2839 that fixes this.\r\n> \r\n> _Originally posted by @nateprewitt in https://github.com/psf/requests/issues/3506#issuecomment-239304816_\r\n> \r\n\r\n[BTW that pr does exactly what I was attempting to suggest in my original comment to @achapkowski 's pr :) ]\r\n\r\nI guess one reason why this isn't as urgent as one might think, is there is a simple if annoying workaround. If you need to ensure proxy use, ALWAY specify it in your requests instead of relying on the session.proxies.\r\n\r\nI suppose one thing that could be done immediately is change the documentation to warn people NOT to depend on session.proxies if there is a chance that they also have environmental proxies set? I was using the free Psiphon proxy on Windows so it was blazingly obvious something was going wrong because I kept getting \r\n\r\n ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)\r\n\r\nexceptions whenever Psiphon was connected. Helpfully, the error message also suggests that you change your https proxy url to use the http url instead, which turns out to work as long as you can get it set correctly, which is when I ran into this bug.", "@dmich2 I'd accept a succinct sentence or two [here](https://github.com/psf/requests/blame/main/docs/user/advanced.rst#L605) to clarify this behavior if people think it would be helpful. I agree that's probably the best immediate term solution.", "@nateprewitt How about:\r\n\r\n```\r\n.. warning:: In Requests versions prior to 3.0, overriding these environmental proxies (those returned by \r\n `urllib.request.getproxies()<https://docs.python.org/3/library/urllib.request.html#urllib.request.getproxies>`),\r\n by using ``session.proxies.update(proxies)`` does not work correctly. \r\n To ensure the use of proxies in the presence of environmental proxies, explicitly specify the ``proxies`` argument\r\n on all individual requests as initially explained above.\r\n\r\n See `PR #2839 <https://github.com/psf/requests/pull/2839>` for details.\r\n```\r\n\r\nalthough I think it should go [here](https://github.com/psf/requests/blame/main/docs/user/advanced.rst#L620) after the discussion of environment variables.\r\n", "@dmich2 this would be very helpful. Thank you", "Reading them again it would be better to reference Issue #2018 (which has more background) rather than PR #2839 (which is what actually fixed the bug) in the documentation. \r\n\r\nThere's been a whole slew of discussions on this over the years so it's hard to choose :)", "> although I think it should go [here](https://github.com/psf/requests/blame/main/docs/user/advanced.rst#L620) after the discussion of environment variables.\r\n\r\nWe're trying to add the warning from a usage perspective. The `Session.proxies` user is likely not going to care about or read the environment sub-section. We probably want to keep it as close to the impacted section as possible.\r\n\r\n\r\nI think the wording looks good. I've made a few inline edits to omit an explicit version call out and rephrase this from `session.proxies` perspective rather than environment. Let me know what you think.\r\n```\r\n.. warning:: Setting ``session.proxies`` may behave differently than expected. Values provided will be overwritten by\r\n environmental proxies (those returned by `urllib.request.getproxies(<https://docs.python.org/3/library/urllib.request.html#urllib.request.getproxies>`),\r\n To ensure the use of proxies in the presence of environmental proxies, explicitly specify the ``proxies`` argument\r\n on all individual requests as initially explained above.\r\n\r\n See `PR #2018 <https://github.com/psf/requests/pull/2018>` for details.\r\n```", "Looks good. When 3.0 comes out, someone will have to remember to retest and probably reword/remove the warning." ]
https://api.github.com/repos/psf/requests/issues/6058
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6058/labels{/name}
https://api.github.com/repos/psf/requests/issues/6058/comments
https://api.github.com/repos/psf/requests/issues/6058/events
https://github.com/psf/requests/pull/6058
1,124,761,252
PR_kwDOABTKOs4yHJiT
6,058
fix session proxy issue
{ "avatar_url": "https://avatars.githubusercontent.com/u/5131271?v=4", "events_url": "https://api.github.com/users/achapkowski/events{/privacy}", "followers_url": "https://api.github.com/users/achapkowski/followers", "following_url": "https://api.github.com/users/achapkowski/following{/other_user}", "gists_url": "https://api.github.com/users/achapkowski/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/achapkowski", "id": 5131271, "login": "achapkowski", "node_id": "MDQ6VXNlcjUxMzEyNzE=", "organizations_url": "https://api.github.com/users/achapkowski/orgs", "received_events_url": "https://api.github.com/users/achapkowski/received_events", "repos_url": "https://api.github.com/users/achapkowski/repos", "site_admin": false, "starred_url": "https://api.github.com/users/achapkowski/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/achapkowski/subscriptions", "type": "User", "url": "https://api.github.com/users/achapkowski", "user_view_type": "public" }
[]
closed
true
null
[]
null
12
2022-02-05T01:14:53Z
2022-02-17T16:55:38Z
2022-02-16T20:02:38Z
NONE
resolved
Fix session proxy issue where Session.proxies is ignore on self.request(). #### Reproducible Code ```python import requests s = requests.Session() s.proxies = proxy s.get("https://google.com").text ```
{ "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/6058/reactions" }
https://api.github.com/repos/psf/requests/issues/6058/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6058.diff", "html_url": "https://github.com/psf/requests/pull/6058", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6058.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6058" }
true
[ "resolves: https://github.com/psf/requests/issues/6059", "Hey @nateprewitt or @sigmavirus24 how do you get a PR reviewed for a future release? This is a simple fix that allows Session objects to honor proxy settings. ", "Patience. We have busy lives being open source. Also I suspect this to be a duplicate of a well documented backwards incompatible PR that we have discussed ad nauseum. ", "@sigmavirus24 thanks, I just wanted to ensure I have everything that is needed to assist getting this in or rejected. Hopefully it will be added.", "Session proxies are generally a mess right now and changing them has unexpected transitive effects.\n\nI think this is slightly different than some of our long running issues but it's going to take some dedicated effort to map out impact.", "@nateprewitt I understand that it might have an effect, but it seems ```self.proxies``` does nothing. This just adds it back into the chain if set. I think what is a bigger issue is the fact the the `Session.proxies` are not used at all. All this does is ensure if set, it's acknowledged in the proxy workflow. \r\n\r\n### Original\r\n```\r\nproxies = proxies or {}\r\n```\r\n\r\n### Change\r\n\r\n```\r\nproxies = proxies or self.proxies or {}\r\n```\r\n\r\nIt seems when `proxies` was set, it was never pulled in from the class level. \r\n", "Hi @achapkowski,\r\n\r\nWe understand the problem you're seeing but I think this PR is jumping to incorrect conclusions. It's important we understand what is actually happening rather than what's being observed before making changes.\r\n\r\nIf you read the next line, you'll see a call to our [resolver](https://github.com/psf/requests/blob/main/requests/sessions.py#L519-L521) for session settings. We do in fact [use `self.proxies`](https://github.com/psf/requests/blob/95f456733656ed93645ff0250bfa54f6d256f6fe/requests/sessions.py#L712). This function takes in to account several factors though for determining the proxies used by a session. Something in that flow isn't choosing your Session level proxy when considering changes. The proposed solution here is likely overly simplistic for the underlying problem though.", "This fix is wrong if you have tried to set proxies in both your request & session. Then it still ignores your Session.proxies.\r\n\r\nThe problem is in [merge_environment_settings()](https://github.com/psf/requests/blob/95f456733656ed93645ff0250bfa54f6d256f6fe/requests/sessions.py#L691)\r\n\r\nIf self.trust_env is True it sets the environment proxies on top of the request proxies (if they aren't already set). Then it later does `proxies = merge_setting(proxies, self.proxies)` which unilaterally clobbers any session.proxies.\r\n\r\nWhat really needs to be done is NOT to change the initial request proxies argument but keep the env_proxies separate.\r\nThen update the env_proxies with the session proxies, and THEN update that dict with the incoming requests proxies.\r\n\r\nSomething like:\r\n\r\n proxies_env = merge_setting({}, env_proxies)\r\n proxies_env_session = merge_setting(self.proxies, proxies_env)\r\n proxies = merge_setting(original_proxies, proxies_env_session)\r\n\r\nWhere I wasn't sure about just doing dict.copy() in this case or what happens if I update env_proxies directly.", "I didn't know what proxy order took priority. \r\n", "This is definitely a dupe of #3197 and #2018 then. Thanks for taking a look @dmich2. We’ll close this and the issue and track things in the original. This already has a patch but isn’t mergeable until a major version bump is made.", "@nateprewitt I don't think closing it is the right thing. Is there now a time schedule for the next major release?, if not, this issue will just be a major issue for people.\r\n", "@achapkowski this is the wrong solution and a duplicate. This has been an issue for 8 years. Ignoring this context is not conducive to fixing this. Based on past interactions I've witnessed with you and experiences of my own, I'm locking this." ]
https://api.github.com/repos/psf/requests/issues/6057
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6057/labels{/name}
https://api.github.com/repos/psf/requests/issues/6057/comments
https://api.github.com/repos/psf/requests/issues/6057/events
https://github.com/psf/requests/pull/6057
1,124,744,727
PR_kwDOABTKOs4yHGXk
6,057
Wrap urllib3's SSLError as requests' SSLError
{ "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
[]
{ "closed_at": "2022-06-09T17:44:05Z", "closed_issues": 8, "created_at": "2022-04-07T05:17:41Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/30", "id": 7852541, "labels_url": "https://api.github.com/repos/psf/requests/milestones/30/labels", "node_id": "MI_kwDOABTKOs4Ad9H9", "number": 30, "open_issues": 0, "state": "closed", "title": "2.28.0", "updated_at": "2022-06-09T17:44:05Z", "url": "https://api.github.com/repos/psf/requests/milestones/30" }
0
2022-02-05T00:41:55Z
2023-04-08T00:03:06Z
2022-02-05T18:56:05Z
MEMBER
resolved
This should handle the issue raised in #6056 by wrapping the `SSLError` from urllib3 (`urllib3.exception.SSLError`) with ours (`requests.exception.SSLError`). Test was added to ensure we're doing the expected exception translation for everything we remap on streamed responses.
{ "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/6057/reactions" }
https://api.github.com/repos/psf/requests/issues/6057/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6057.diff", "html_url": "https://github.com/psf/requests/pull/6057", "merged_at": "2022-02-05T18:56:05Z", "patch_url": "https://github.com/psf/requests/pull/6057.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6057" }
true
[]
https://api.github.com/repos/psf/requests/issues/6056
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6056/labels{/name}
https://api.github.com/repos/psf/requests/issues/6056/comments
https://api.github.com/repos/psf/requests/issues/6056/events
https://github.com/psf/requests/issues/6056
1,123,974,649
I_kwDOABTKOs5C_n35
6,056
Catch `urllib3.exceptions.SSLError` in `Response.iter_content`
{ "avatar_url": "https://avatars.githubusercontent.com/u/8550471?v=4", "events_url": "https://api.github.com/users/anadius/events{/privacy}", "followers_url": "https://api.github.com/users/anadius/followers", "following_url": "https://api.github.com/users/anadius/following{/other_user}", "gists_url": "https://api.github.com/users/anadius/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/anadius", "id": 8550471, "login": "anadius", "node_id": "MDQ6VXNlcjg1NTA0NzE=", "organizations_url": "https://api.github.com/users/anadius/orgs", "received_events_url": "https://api.github.com/users/anadius/received_events", "repos_url": "https://api.github.com/users/anadius/repos", "site_admin": false, "starred_url": "https://api.github.com/users/anadius/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/anadius/subscriptions", "type": "User", "url": "https://api.github.com/users/anadius", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-02-04T09:13:03Z
2022-05-06T19:00:32Z
2022-02-05T18:56:36Z
NONE
resolved
I believe requests should catch that and raise `requests.exceptions.SSLError`: ``` Traceback (most recent call last): File "urllib3\response.py", line 438, in _error_catcher File "urllib3\response.py", line 519, in read File "http\client.py", line 465, in read File "socket.py", line 705, in readinto File "ssl.py", line 1273, in recv_into File "ssl.py", line 1129, in read ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2536) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "tkinter\__init__.py", line 1921, in __call__ File "tkinter\__init__.py", line 839, in callit File "updater_gui.py", line 421, in metadata_cached File "concurrent\futures\_base.py", line 438, in result File "concurrent\futures\_base.py", line 390, in __get_result File "concurrent\futures\thread.py", line 58, in run File "updater\updater.py", line 314, in get_metadata File "pzd.py", line 256, in get_info File "pzd.py", line 216, in _get_central_dir File "pzd.py", line 176, in _get_chunk File "pzd.py", line 170, in _get_range File "requests\models.py", line 836, in content File "requests\models.py", line 758, in generate File "urllib3\response.py", line 576, in stream File "urllib3\response.py", line 512, in read File "contextlib.py", line 153, in __exit__ File "urllib3\response.py", line 449, in _error_catcher urllib3.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2536) ``` This is requests 2.26.0. That's some edge case and I've seen that happen only once (this is automatic error report from my program so I don't know any details, it's anonymous). I'm not trying to solve the problem, I just want to be able to catch `requests.exceptions.SSLError` instead of `urllib3.exceptions.SSLError`.
{ "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/6056/reactions" }
https://api.github.com/repos/psf/requests/issues/6056/timeline
null
completed
null
null
false
[ "Thanks for reporting the issue @anadius. We've definitely had a few cases where either new or rarely raised exceptions from urllib3 leak through. I've added #6057 as a proposal to handle this.", "We've merged #6057, so I'd expect this change to be available in the next release." ]
https://api.github.com/repos/psf/requests/issues/6055
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6055/labels{/name}
https://api.github.com/repos/psf/requests/issues/6055/comments
https://api.github.com/repos/psf/requests/issues/6055/events
https://github.com/psf/requests/issues/6055
1,119,529,016
I_kwDOABTKOs5Cuqg4
6,055
Help! RemoteDisconnected('Remote end closed connection without response')
{ "avatar_url": "https://avatars.githubusercontent.com/u/36852564?v=4", "events_url": "https://api.github.com/users/hmzakhalid/events{/privacy}", "followers_url": "https://api.github.com/users/hmzakhalid/followers", "following_url": "https://api.github.com/users/hmzakhalid/following{/other_user}", "gists_url": "https://api.github.com/users/hmzakhalid/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hmzakhalid", "id": 36852564, "login": "hmzakhalid", "node_id": "MDQ6VXNlcjM2ODUyNTY0", "organizations_url": "https://api.github.com/users/hmzakhalid/orgs", "received_events_url": "https://api.github.com/users/hmzakhalid/received_events", "repos_url": "https://api.github.com/users/hmzakhalid/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hmzakhalid/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hmzakhalid/subscriptions", "type": "User", "url": "https://api.github.com/users/hmzakhalid", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-01-31T14:49:39Z
2022-05-01T18:00:30Z
2022-01-31T15:38:52Z
NONE
resolved
I'm using residential proxies from https://www.dreamproxies.io/ The proxies seem to be all live, checked it on multiple proxy checkers but i keep getting Proxy error `HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response')))` **Here's my code:** ``` import requests try: proxies = { "http": 'http://<username>:<password>@<ip>:<port>', "https": 'http://<username>:<password>@<ip>:<port>' } r = requests.get('https://www.google.com/', proxies=proxies) print(r.status_code, "Proxy works") except Exception as e: print(e) ``` **Output for: `python -m requests.help`** ``` { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.10" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.2" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010df" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": true, "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/6055/reactions" }
https://api.github.com/repos/psf/requests/issues/6055/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.\n\nFurther, you have patted credentials into a public issue and should revoke those as quickly as you can to prevent abuse" ]
https://api.github.com/repos/psf/requests/issues/6054
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6054/labels{/name}
https://api.github.com/repos/psf/requests/issues/6054/comments
https://api.github.com/repos/psf/requests/issues/6054/events
https://github.com/psf/requests/pull/6054
1,118,587,583
PR_kwDOABTKOs4xy1Nr
6,054
Add hooks `prepared` and `request`
{ "avatar_url": "https://avatars.githubusercontent.com/u/26604856?v=4", "events_url": "https://api.github.com/users/Speedlulu/events{/privacy}", "followers_url": "https://api.github.com/users/Speedlulu/followers", "following_url": "https://api.github.com/users/Speedlulu/following{/other_user}", "gists_url": "https://api.github.com/users/Speedlulu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Speedlulu", "id": 26604856, "login": "Speedlulu", "node_id": "MDQ6VXNlcjI2NjA0ODU2", "organizations_url": "https://api.github.com/users/Speedlulu/orgs", "received_events_url": "https://api.github.com/users/Speedlulu/received_events", "repos_url": "https://api.github.com/users/Speedlulu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Speedlulu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Speedlulu/subscriptions", "type": "User", "url": "https://api.github.com/users/Speedlulu", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-01-30T15:49:26Z
2022-04-30T17:02:44Z
2022-01-30T16:02:33Z
NONE
resolved
* `prepared` is dispatched when `Session.prepare` is called, it receives the `PreparedRequest` that was just prepared. * `request` is dispatched when `Session.request` is called, it receives the `Request` that was just created.
{ "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/6054/reactions" }
https://api.github.com/repos/psf/requests/issues/6054/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6054.diff", "html_url": "https://github.com/psf/requests/pull/6054", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6054.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6054" }
true
[ "Requests is not accepting new features or API expansions at this point in time." ]
https://api.github.com/repos/psf/requests/issues/6053
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6053/labels{/name}
https://api.github.com/repos/psf/requests/issues/6053/comments
https://api.github.com/repos/psf/requests/issues/6053/events
https://github.com/psf/requests/issues/6053
1,118,170,402
I_kwDOABTKOs5Cpe0i
6,053
BlackDuck complaining about the use of urllib3 version older than 1.26.5
{ "avatar_url": "https://avatars.githubusercontent.com/u/18576030?v=4", "events_url": "https://api.github.com/users/acharaj/events{/privacy}", "followers_url": "https://api.github.com/users/acharaj/followers", "following_url": "https://api.github.com/users/acharaj/following{/other_user}", "gists_url": "https://api.github.com/users/acharaj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/acharaj", "id": 18576030, "login": "acharaj", "node_id": "MDQ6VXNlcjE4NTc2MDMw", "organizations_url": "https://api.github.com/users/acharaj/orgs", "received_events_url": "https://api.github.com/users/acharaj/received_events", "repos_url": "https://api.github.com/users/acharaj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/acharaj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/acharaj/subscriptions", "type": "User", "url": "https://api.github.com/users/acharaj", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2022-01-29T10:31:22Z
2022-05-01T16:00:23Z
2022-01-29T15:52:41Z
NONE
resolved
We are using Python requests in our project and we run BlackDuck to scan for vulnerabilities from the usage of third-party components. In case of usage of requests library (the latest version 2.27.1), it complains about the usage of old version urllib3, with the following message. Description An issue was discovered in urllib3 before 1.26.5. When provided with a URL containing many @ characters in the authority component, the authority regular expression exhibits catastrophic backtracking, causing a denial of service if a URL were passed as a parameter or redirected to via an HTTP redirect. CVE-2021-33503 ((BDSA-2021-1688)) ## Expected Result Requests lib should not continue using the urllib3 old version with this security risk. ## Actual Result Requests lib is still using an old version of urllib3 with this security risk. ## Reproduction Steps We need to run the BlackDuck (Synopsis) tool. ## System Information Python 3
{ "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/6053/reactions" }
https://api.github.com/repos/psf/requests/issues/6053/timeline
null
completed
null
null
false
[ "Requests doesn't constrain your maximum urllib3 version to patch releases, you can upgrade urllib3 safely without issue.\n\npython -m pip install -U urllib3", "Thanks @sethmlarson . Shouldn't request by default use a version of urllib3 equal to or greater than 1.26.5? That would avoid all the problems from the start imho and is probably the correct way to solve this issue.", "No. That would require more work for operating system packagers who already apply security patches without changing version strings and thus secure software for their users. ", "Perfect. Makes sense. Thanks @sigmavirus24 " ]
https://api.github.com/repos/psf/requests/issues/6052
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6052/labels{/name}
https://api.github.com/repos/psf/requests/issues/6052/comments
https://api.github.com/repos/psf/requests/issues/6052/events
https://github.com/psf/requests/issues/6052
1,116,984,454
I_kwDOABTKOs5Ck9SG
6,052
why requests speed is very slow in same environment!
{ "avatar_url": "https://avatars.githubusercontent.com/u/34080816?v=4", "events_url": "https://api.github.com/users/JmeterChen/events{/privacy}", "followers_url": "https://api.github.com/users/JmeterChen/followers", "following_url": "https://api.github.com/users/JmeterChen/following{/other_user}", "gists_url": "https://api.github.com/users/JmeterChen/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/JmeterChen", "id": 34080816, "login": "JmeterChen", "node_id": "MDQ6VXNlcjM0MDgwODE2", "organizations_url": "https://api.github.com/users/JmeterChen/orgs", "received_events_url": "https://api.github.com/users/JmeterChen/received_events", "repos_url": "https://api.github.com/users/JmeterChen/repos", "site_admin": false, "starred_url": "https://api.github.com/users/JmeterChen/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/JmeterChen/subscriptions", "type": "User", "url": "https://api.github.com/users/JmeterChen", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-01-28T04:17:21Z
2022-04-28T05:17:27Z
2022-01-28T05:02:43Z
NONE
resolved
when i get response by curl ! ![image](https://user-images.githubusercontent.com/34080816/151486453-01cb38d7-f8e0-4077-aaca-d1bbd4b24962.png) when i get response by requests ! ![image](https://user-images.githubusercontent.com/34080816/151486473-a8229d51-bc98-4153-9df7-ffc6e55ff7e1.png)
{ "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/6052/reactions" }
https://api.github.com/repos/psf/requests/issues/6052/timeline
null
completed
null
null
false
[ "Please fill out the template when creating an issue.\n\nYou can't compare two completely different tools in two different ways and expect a result that makes sense. If you need the performance that curl provides then use curl.\n\nAlso noting you're running an ancient version of Python, try upgrading for some free speedups." ]
https://api.github.com/repos/psf/requests/issues/6051
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6051/labels{/name}
https://api.github.com/repos/psf/requests/issues/6051/comments
https://api.github.com/repos/psf/requests/issues/6051/events
https://github.com/psf/requests/issues/6051
1,116,900,986
I_kwDOABTKOs5Cko56
6,051
HTTP/3 / QUIC?
{ "avatar_url": "https://avatars.githubusercontent.com/u/37943746?v=4", "events_url": "https://api.github.com/users/ksaadDE/events{/privacy}", "followers_url": "https://api.github.com/users/ksaadDE/followers", "following_url": "https://api.github.com/users/ksaadDE/following{/other_user}", "gists_url": "https://api.github.com/users/ksaadDE/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ksaadDE", "id": 37943746, "login": "ksaadDE", "node_id": "MDQ6VXNlcjM3OTQzNzQ2", "organizations_url": "https://api.github.com/users/ksaadDE/orgs", "received_events_url": "https://api.github.com/users/ksaadDE/received_events", "repos_url": "https://api.github.com/users/ksaadDE/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ksaadDE/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ksaadDE/subscriptions", "type": "User", "url": "https://api.github.com/users/ksaadDE", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-01-28T01:17:34Z
2022-04-28T05:17:28Z
2022-01-28T04:56:04Z
NONE
resolved
Hi, is it planned to wrap around QUIC in the future?
{ "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/6051/reactions" }
https://api.github.com/repos/psf/requests/issues/6051/timeline
null
completed
null
null
false
[ "Likely not for some time, if ever. We only support HTTP/1.1 currently." ]
https://api.github.com/repos/psf/requests/issues/6050
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6050/labels{/name}
https://api.github.com/repos/psf/requests/issues/6050/comments
https://api.github.com/repos/psf/requests/issues/6050/events
https://github.com/psf/requests/issues/6050
1,115,397,990
I_kwDOABTKOs5Ce59m
6,050
Timeline for v3.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/5131271?v=4", "events_url": "https://api.github.com/users/achapkowski/events{/privacy}", "followers_url": "https://api.github.com/users/achapkowski/followers", "following_url": "https://api.github.com/users/achapkowski/following{/other_user}", "gists_url": "https://api.github.com/users/achapkowski/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/achapkowski", "id": 5131271, "login": "achapkowski", "node_id": "MDQ6VXNlcjUxMzEyNzE=", "organizations_url": "https://api.github.com/users/achapkowski/orgs", "received_events_url": "https://api.github.com/users/achapkowski/received_events", "repos_url": "https://api.github.com/users/achapkowski/repos", "site_admin": false, "starred_url": "https://api.github.com/users/achapkowski/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/achapkowski/subscriptions", "type": "User", "url": "https://api.github.com/users/achapkowski", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-01-26T19:20:39Z
2022-04-26T20:00:29Z
2022-01-26T19:30:10Z
NONE
resolved
Is there a timeline on 3.x? or is it dead?
{ "avatar_url": "https://avatars.githubusercontent.com/u/5131271?v=4", "events_url": "https://api.github.com/users/achapkowski/events{/privacy}", "followers_url": "https://api.github.com/users/achapkowski/followers", "following_url": "https://api.github.com/users/achapkowski/following{/other_user}", "gists_url": "https://api.github.com/users/achapkowski/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/achapkowski", "id": 5131271, "login": "achapkowski", "node_id": "MDQ6VXNlcjUxMzEyNzE=", "organizations_url": "https://api.github.com/users/achapkowski/orgs", "received_events_url": "https://api.github.com/users/achapkowski/received_events", "repos_url": "https://api.github.com/users/achapkowski/repos", "site_admin": false, "starred_url": "https://api.github.com/users/achapkowski/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/achapkowski/subscriptions", "type": "User", "url": "https://api.github.com/users/achapkowski", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6050/reactions" }
https://api.github.com/repos/psf/requests/issues/6050/timeline
null
completed
null
null
false
[ "Hi @achapkowski, we don't have any timelines to share on a new major version.\n\nIn the event one is released, I'd like to temper expectations that it will not resemble what was originally promised by previous maintainers. We don't have the resources currently to deliver on those changes.", "@nateprewitt thank you for the update." ]
https://api.github.com/repos/psf/requests/issues/6049
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6049/labels{/name}
https://api.github.com/repos/psf/requests/issues/6049/comments
https://api.github.com/repos/psf/requests/issues/6049/events
https://github.com/psf/requests/issues/6049
1,114,213,990
I_kwDOABTKOs5CaY5m
6,049
Request JSON body in custom auth contains extra spaces
{ "avatar_url": "https://avatars.githubusercontent.com/u/6687139?v=4", "events_url": "https://api.github.com/users/intentionally-left-nil/events{/privacy}", "followers_url": "https://api.github.com/users/intentionally-left-nil/followers", "following_url": "https://api.github.com/users/intentionally-left-nil/following{/other_user}", "gists_url": "https://api.github.com/users/intentionally-left-nil/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/intentionally-left-nil", "id": 6687139, "login": "intentionally-left-nil", "node_id": "MDQ6VXNlcjY2ODcxMzk=", "organizations_url": "https://api.github.com/users/intentionally-left-nil/orgs", "received_events_url": "https://api.github.com/users/intentionally-left-nil/received_events", "repos_url": "https://api.github.com/users/intentionally-left-nil/repos", "site_admin": false, "starred_url": "https://api.github.com/users/intentionally-left-nil/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/intentionally-left-nil/subscriptions", "type": "User", "url": "https://api.github.com/users/intentionally-left-nil", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-01-25T18:13:25Z
2022-04-25T19:05:50Z
2022-01-25T18:31:33Z
NONE
resolved
<!-- Summary. --> The request.body argument of custom auth is different than the bytes that the server receives when using json. Specifically, when inside the custom auth handler, the request.body includes spaces, e.g. `{"myKey":<SPACE>"myValue"}` where the final request sent does not include this space. This is a problem for custom auth which tries to hash the body and add that as a header, as the hash will not match ## Expected Result See the demo code below. The main issue is that if you pass in json=(someJson) then inside of MyCustomAuth r.body contains a string (well really bytes but...) which include spaces. However, the final request sent does not include spaces. I would expect the payload to match. For the demo code below, x-hash returns x-hash is f667340ebfa34b192bc594772679c8d461eb5455022442cdfcdb21ba30bdf0d5 which is the hash of `{"myKey":<SPACE>"myValue"}` <!-- What you expected. --> ## Actual Result the actual HTTP body has a hash of 090150119e53c870ca0da54fe88605c6ed57139e068d0ccbd2483ae212ea383b which is the hash of `{"myKey":"myValue"}` (no space) <!-- What happened instead. --> ## Reproduction Steps ```python import requests import requests from hashlib import sha256 class MyCustomAuth: def __call__(self, r): r.headers['x-hash']=sha256(r.body).hexdigest() return r requests.post('https://example.com', json={"myKey": "myValue"}, auth=MyCustomAuth()) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.10" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.1" }, "platform": { "release": "5.15.12-1-MANJARO", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010df" }, "urllib3": { "version": "1.26.8" }, "using_charset_normalizer": true, "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/6687139?v=4", "events_url": "https://api.github.com/users/intentionally-left-nil/events{/privacy}", "followers_url": "https://api.github.com/users/intentionally-left-nil/followers", "following_url": "https://api.github.com/users/intentionally-left-nil/following{/other_user}", "gists_url": "https://api.github.com/users/intentionally-left-nil/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/intentionally-left-nil", "id": 6687139, "login": "intentionally-left-nil", "node_id": "MDQ6VXNlcjY2ODcxMzk=", "organizations_url": "https://api.github.com/users/intentionally-left-nil/orgs", "received_events_url": "https://api.github.com/users/intentionally-left-nil/received_events", "repos_url": "https://api.github.com/users/intentionally-left-nil/repos", "site_admin": false, "starred_url": "https://api.github.com/users/intentionally-left-nil/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/intentionally-left-nil/subscriptions", "type": "User", "url": "https://api.github.com/users/intentionally-left-nil", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6049/reactions" }
https://api.github.com/repos/psf/requests/issues/6049/timeline
null
completed
null
null
false
[ "Ah. Actually the client is doing the correct thing, but it's the server middleware that's changing the request body. Sorry for the noise" ]
https://api.github.com/repos/psf/requests/issues/6048
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6048/labels{/name}
https://api.github.com/repos/psf/requests/issues/6048/comments
https://api.github.com/repos/psf/requests/issues/6048/events
https://github.com/psf/requests/pull/6048
1,113,918,664
PR_kwDOABTKOs4xj3Jb
6,048
Fixing unicode surrogates in POST data lead to exception
{ "avatar_url": "https://avatars.githubusercontent.com/u/1322800?v=4", "events_url": "https://api.github.com/users/mftb/events{/privacy}", "followers_url": "https://api.github.com/users/mftb/followers", "following_url": "https://api.github.com/users/mftb/following{/other_user}", "gists_url": "https://api.github.com/users/mftb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mftb", "id": 1322800, "login": "mftb", "node_id": "MDQ6VXNlcjEzMjI4MDA=", "organizations_url": "https://api.github.com/users/mftb/orgs", "received_events_url": "https://api.github.com/users/mftb/received_events", "repos_url": "https://api.github.com/users/mftb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mftb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mftb/subscriptions", "type": "User", "url": "https://api.github.com/users/mftb", "user_view_type": "public" }
[]
open
false
null
[]
null
1
2022-01-25T13:55:14Z
2022-03-09T18:26:01Z
null
NONE
null
Closes #6008 Fixing the unicode surrogates issue
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/6048/reactions" }
https://api.github.com/repos/psf/requests/issues/6048/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6048.diff", "html_url": "https://github.com/psf/requests/pull/6048", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6048.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6048" }
true
[ "@sigmavirus24 @nateprewitt PTAL" ]
https://api.github.com/repos/psf/requests/issues/6047
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6047/labels{/name}
https://api.github.com/repos/psf/requests/issues/6047/comments
https://api.github.com/repos/psf/requests/issues/6047/events
https://github.com/psf/requests/issues/6047
1,112,513,967
I_kwDOABTKOs5CT52v
6,047
Invalid Response Code (409) when "alertId" key is received in response body.
{ "avatar_url": "https://avatars.githubusercontent.com/u/86540006?v=4", "events_url": "https://api.github.com/users/PinchofLogic/events{/privacy}", "followers_url": "https://api.github.com/users/PinchofLogic/followers", "following_url": "https://api.github.com/users/PinchofLogic/following{/other_user}", "gists_url": "https://api.github.com/users/PinchofLogic/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/PinchofLogic", "id": 86540006, "login": "PinchofLogic", "node_id": "MDQ6VXNlcjg2NTQwMDA2", "organizations_url": "https://api.github.com/users/PinchofLogic/orgs", "received_events_url": "https://api.github.com/users/PinchofLogic/received_events", "repos_url": "https://api.github.com/users/PinchofLogic/repos", "site_admin": false, "starred_url": "https://api.github.com/users/PinchofLogic/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/PinchofLogic/subscriptions", "type": "User", "url": "https://api.github.com/users/PinchofLogic", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-01-24T11:20:00Z
2022-01-24T21:28:16Z
2022-01-24T13:34:33Z
NONE
resolved
<!-- Summary. --> When the body of a valid response contains a Key of "alertId", like below: { "Key1": "Value1", "Key2": "Value2", "alertId": "XX-6MH-QZ0-C8G-HC5-YYY" } The value of status_code throws 409 error. response.status_code == 409 ## Expected Result response.status_code == 200 ## Actual Result response.status_code == 409 ## Reproduction Steps try: response = requests.patch( "https://XXXXXX, headers=my_header, params=query, json={ "Key": "Value" } ) response.raise_for_status() ## System Information AWS Lambda Python 3.9 runtime. <!-- This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c). -->
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6047/reactions" }
https://api.github.com/repos/psf/requests/issues/6047/timeline
null
completed
null
null
false
[ "This behavior you're seeing is not something we can control, Requests is only the messenger between your code and the server you're contacting. You'll have to read their documentation to see why you're receiving that status code.", "Hi Seth,\n\nIts an API that generate alert IDs when it receives requests. On postman,\nwe get the whole body with HTTP 200.\nEven via Python 3.9 the \"requests\" library returns the correct data as long\nas we do not use \"response.raise_for_status()\".\n\nI noticed that if the response does not have the custom key of \"alertId\"\neverything works well. In this case, even if the \"alertId\" is a custom\nfield in the body, \"response.raise_for_status()\" treats it as a HTTP\nresponse code.\n\nRegards,\nKuldeep Saxena\n\n\nOn Mon, 24 Jan 2022 at 13:34, Seth Michael Larson ***@***.***>\nwrote:\n\n> This behavior you're seeing is not something we can control, Requests is\n> only the messenger between your code and AWS. You'll have to read their\n> documentation to see why you're receiving that status code.\n>\n> —\n> Reply to this email directly, view it on GitHub\n> <https://github.com/psf/requests/issues/6047#issuecomment-1020107229>, or\n> unsubscribe\n> <https://github.com/notifications/unsubscribe-auth/AUUH5ZUQ43FQ6ZUIW7DXMXTUXVIPHANCNFSM5MVCYFVQ>\n> .\n> Triage notifications on the go with GitHub Mobile for iOS\n> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>\n> or Android\n> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.\n>\n> You are receiving this because you authored the thread.Message ID:\n> ***@***.***>\n>\n", "Hi @PinchofLogic,\r\n\r\n`raise_for_status()` is specifically for raising an exception on non-200 status codes. 409 is the service in question letting you know that there is some conflict with the resource. It may return relevant data in the response, but you'll need to check. If you don't want Requests to throw an exception for non-200 status codes, you'll want to remove that line from your code.\r\n\r\nFor more help with AWS products, I'd recommend reaching out to [AWS Support and Customer Service](https://aws.amazon.com/contact-us/). This isn't an issue with Requests and we won't be able to provide further help." ]
https://api.github.com/repos/psf/requests/issues/6046
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6046/labels{/name}
https://api.github.com/repos/psf/requests/issues/6046/comments
https://api.github.com/repos/psf/requests/issues/6046/events
https://github.com/psf/requests/issues/6046
1,111,740,122
I_kwDOABTKOs5CQ87a
6,046
Why isn't requests_ntlm included in requests library?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1357701?v=4", "events_url": "https://api.github.com/users/CaledoniaProject/events{/privacy}", "followers_url": "https://api.github.com/users/CaledoniaProject/followers", "following_url": "https://api.github.com/users/CaledoniaProject/following{/other_user}", "gists_url": "https://api.github.com/users/CaledoniaProject/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/CaledoniaProject", "id": 1357701, "login": "CaledoniaProject", "node_id": "MDQ6VXNlcjEzNTc3MDE=", "organizations_url": "https://api.github.com/users/CaledoniaProject/orgs", "received_events_url": "https://api.github.com/users/CaledoniaProject/received_events", "repos_url": "https://api.github.com/users/CaledoniaProject/repos", "site_admin": false, "starred_url": "https://api.github.com/users/CaledoniaProject/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/CaledoniaProject/subscriptions", "type": "User", "url": "https://api.github.com/users/CaledoniaProject", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-01-23T01:25:19Z
2022-04-23T02:29:01Z
2022-01-23T01:32:36Z
NONE
resolved
I'm wondering if there's any reason that requests won't include https://pypi.org/project/requests_ntlm/ in the official repo?
{ "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/6046/reactions" }
https://api.github.com/repos/psf/requests/issues/6046/timeline
null
completed
null
null
false
[ "Hi @CaledoniaProject, Requests specifically has opt-in functionality like oauth and ntlm created in separate repos because they're not part of the library's core http functionality. You'll also find other tools in the requests toolbelt.\n\nThe primary reason is to avoid unnecessary bloat and overhead for non-critical functionality.", "Understood, thanks." ]
https://api.github.com/repos/psf/requests/issues/6045
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6045/labels{/name}
https://api.github.com/repos/psf/requests/issues/6045/comments
https://api.github.com/repos/psf/requests/issues/6045/events
https://github.com/psf/requests/issues/6045
1,109,214,802
I_kwDOABTKOs5CHUZS
6,045
I got the following error ImportError: cannot import name 'FastAPI'
{ "avatar_url": "https://avatars.githubusercontent.com/u/51072377?v=4", "events_url": "https://api.github.com/users/themeswordpress/events{/privacy}", "followers_url": "https://api.github.com/users/themeswordpress/followers", "following_url": "https://api.github.com/users/themeswordpress/following{/other_user}", "gists_url": "https://api.github.com/users/themeswordpress/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/themeswordpress", "id": 51072377, "login": "themeswordpress", "node_id": "MDQ6VXNlcjUxMDcyMzc3", "organizations_url": "https://api.github.com/users/themeswordpress/orgs", "received_events_url": "https://api.github.com/users/themeswordpress/received_events", "repos_url": "https://api.github.com/users/themeswordpress/repos", "site_admin": false, "starred_url": "https://api.github.com/users/themeswordpress/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/themeswordpress/subscriptions", "type": "User", "url": "https://api.github.com/users/themeswordpress", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-01-20T11:59:16Z
2022-02-18T13:50:48Z
2022-01-20T12:32:48Z
NONE
null
[cymetricx@ip-172-31-30-0 fast]$ sudo python3 -m pip install fastapi Collecting fastapi Using cached fastapi-0.72.0-py3-none-any.whl (52 kB) Requirement already satisfied: starlette==0.17.1 in /usr/local/lib/python3.6/site-packages (from fastapi) (0.17.1) Collecting pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2 Using cached pydantic-1.9.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB) Requirement already satisfied: anyio<4,>=3.0.0 in /usr/local/lib/python3.6/site-packages (from starlette==0.17.1->fastapi) (3.5.0) Requirement already satisfied: contextlib2>=21.6.0 in /usr/local/lib/python3.6/site-packages (from starlette==0.17.1->fastapi) (21.6.0) Requirement already satisfied: typing-extensions in /usr/local/lib/python3.6/site-packages (from starlette==0.17.1->fastapi) (4.0.1) Requirement already satisfied: dataclasses>=0.6 in /usr/local/lib/python3.6/site-packages (from pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2->fastapi) (0.8) Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.6/site-packages (from anyio<4,>=3.0.0->starlette==0.17.1->fastapi) (3.3) Requirement already satisfied: contextvars in /usr/local/lib/python3.6/site-packages (from anyio<4,>=3.0.0->starlette==0.17.1->fastapi) (2.4) Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.6/site-packages (from anyio<4,>=3.0.0->starlette==0.17.1->fastapi) (1.2.0) Requirement already satisfied: immutables>=0.9 in /usr/local/lib64/python3.6/site-packages (from contextvars->anyio<4,>=3.0.0->starlette==0.17.1->fastapi) (0.16) Installing collected packages: pydantic, fastapi Successfully installed fastapi-0.72.0 pydantic-1.9.0 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv [cymetricx@ip-172-31-30-0 fast]$ python3 fastapi2.py Traceback (most recent call last): File "fastapi2.py", line 2, in <module> from fastapi import FastAPI File "/home/cymetricx/fast/fastapi.py", line 11, in <module> from fastapi import FastAPI ImportError: cannot import name 'FastAPI'
{ "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/6045/reactions" }
https://api.github.com/repos/psf/requests/issues/6045/timeline
null
completed
null
null
false
[ "This has nothing ot do with the library requests.", "I have the same problem! Version 0.74.0." ]
https://api.github.com/repos/psf/requests/issues/6044
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6044/labels{/name}
https://api.github.com/repos/psf/requests/issues/6044/comments
https://api.github.com/repos/psf/requests/issues/6044/events
https://github.com/psf/requests/pull/6044
1,106,154,773
PR_kwDOABTKOs4xKi4Z
6,044
Update quickstart.rst : fixing brotlicffi link
{ "avatar_url": "https://avatars.githubusercontent.com/u/6114398?v=4", "events_url": "https://api.github.com/users/Chavithra/events{/privacy}", "followers_url": "https://api.github.com/users/Chavithra/followers", "following_url": "https://api.github.com/users/Chavithra/following{/other_user}", "gists_url": "https://api.github.com/users/Chavithra/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Chavithra", "id": 6114398, "login": "Chavithra", "node_id": "MDQ6VXNlcjYxMTQzOTg=", "organizations_url": "https://api.github.com/users/Chavithra/orgs", "received_events_url": "https://api.github.com/users/Chavithra/received_events", "repos_url": "https://api.github.com/users/Chavithra/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Chavithra/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Chavithra/subscriptions", "type": "User", "url": "https://api.github.com/users/Chavithra", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-01-17T18:27:03Z
2022-04-17T19:00:19Z
2022-01-17T18:30:24Z
CONTRIBUTOR
resolved
**Reason** Fixing a link inside : - `docs/user/quickstart.rst`
{ "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/6044/reactions" }
https://api.github.com/repos/psf/requests/issues/6044/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6044.diff", "html_url": "https://github.com/psf/requests/pull/6044", "merged_at": "2022-01-17T18:30:24Z", "patch_url": "https://github.com/psf/requests/pull/6044.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6044" }
true
[]
https://api.github.com/repos/psf/requests/issues/6043
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6043/labels{/name}
https://api.github.com/repos/psf/requests/issues/6043/comments
https://api.github.com/repos/psf/requests/issues/6043/events
https://github.com/psf/requests/issues/6043
1,102,326,960
I_kwDOABTKOs5BtCyw
6,043
407 Proxy Authentication Required on 2.27.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/90250746?v=4", "events_url": "https://api.github.com/users/cattieinthere/events{/privacy}", "followers_url": "https://api.github.com/users/cattieinthere/followers", "following_url": "https://api.github.com/users/cattieinthere/following{/other_user}", "gists_url": "https://api.github.com/users/cattieinthere/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/cattieinthere", "id": 90250746, "login": "cattieinthere", "node_id": "MDQ6VXNlcjkwMjUwNzQ2", "organizations_url": "https://api.github.com/users/cattieinthere/orgs", "received_events_url": "https://api.github.com/users/cattieinthere/received_events", "repos_url": "https://api.github.com/users/cattieinthere/repos", "site_admin": false, "starred_url": "https://api.github.com/users/cattieinthere/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cattieinthere/subscriptions", "type": "User", "url": "https://api.github.com/users/cattieinthere", "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" }, { "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
11
2022-01-13T20:32:43Z
2023-06-05T00:03:04Z
2022-01-31T15:56:19Z
NONE
resolved
About a week ago, on a previous requests version, this happened: when I tried to send a request (whichever) with a proxy (with the correct username and password), this error would appear: `ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')`. Then it got fixed in 2.27.1 and all seemed okay. But now, suddenly, this also happens on 2.27.1. I can assure you the proxy dict has the correct data in it, so it's certainly a requests problem. Can you please fix it? Traceback: ``` Traceback (most recent call last): File "/home/user/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 696, in urlopen self._prepare_proxy(conn) File "/home/user/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 964, in _prepare_proxy conn.connect() File "/home/user/.local/lib/python3.9/site-packages/urllib3/connection.py", line 371, in connect self._tunnel() File "/usr/lib/python3.9/http/client.py", line 907, in _tunnel raise OSError(f"Tunnel connection failed: {code} {message.strip()}") OSError: Tunnel connection failed: 407 Proxy Authentication Required During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/user/.local/lib/python3.9/site-packages/requests/adapters.py", line 440, in send resp = conn.urlopen( File "/home/user/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( File "/home/user/.local/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: /justanexample (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/.local/lib/python3.9/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/home/user/.local/lib/python3.9/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/home/user/.local/lib/python3.9/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "/home/user/.local/lib/python3.9/site-packages/requests/sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "/home/user/.local/lib/python3.9/site-packages/requests/adapters.py", line 513, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: /justanexample (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))) ```
{ "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/6043/reactions" }
https://api.github.com/repos/psf/requests/issues/6043/timeline
null
completed
null
null
false
[ "Hi @cattieinthere, if it worked previously on 2.27.1 and now doesn't, it would imply something changed in the environment rather than Requests. Can you please provide the info we originally requested in the ticket template? There's nothing we can do with what's currently been provided.", "just something as simple as:\r\n\r\n```\r\nimport requests\r\n\r\nr = requests.get(url, proxies=proxies)\r\n```\r\n\r\nI tried it now and it works but the exact same code on the same requests version didn't when I wrote this post!", "When you open a ticket, it asks for the output of `python -m requests.help`. Can you please provide the contents of that command?", "Yes, sorry.\r\n\r\n```\r\n{\r\n \"chardet\": {\r\n \"version\": \"4.0.0\"\r\n },\r\n \"charset_normalizer\": {\r\n \"version\": \"2.0.8\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"36.0.0\"\r\n },\r\n \"idna\": {\r\n \"version\": \"3.3\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.9.5\"\r\n },\r\n \"platform\": {\r\n \"release\": \"5.11.0-41-generic\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"101010cf\",\r\n \"version\": \"21.0.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.27.1\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1010106f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.26.7\"\r\n },\r\n \"using_charset_normalizer\": false,\r\n \"using_pyopenssl\": true\r\n}\r\n\r\n```", "So from the debug log, I don't see anything out of the ordinary. Is this the same machine/python runtime that was previously working? Are the proxy credentials sourced directly from your input to proxies?\r\n\r\nThe next steps for things to check would be:\r\n1. Confirm the Requests version at runtime\r\n```python\r\nimport requests\r\n\r\nprint(requests.__version__)\r\n\r\n# Verify this is identical to what you passed in\r\nprint(requests.utils.prepend_scheme_if_needed(proxy_url, 'http'))\r\n\r\nr = requests.get(url, proxies=proxies)\r\n```\r\n2. Confirm the proxies dictionary and URI format. Does it match the below?\r\n```python\r\nproxies = {\r\n 'http': 'http://<username>:<password>@<host>:<port>'\r\n 'https': 'https://<username>:<password>@<host>:<port>'\r\n}\r\n```\r\n3. Does downgrading back to 2.25.1 fix the authentication issue?", "Yes, the same machine! The proxy credentials are directly sourced from my input, yes.\r\n\r\n- As for `1,`, yes, everything is okay.\r\n\r\n```\r\n>>> print(requests.__version__)\r\n2.27.1\r\n>>> print(requests.utils.prepend_scheme_if_needed(proxy_url, 'http'))\r\n'http://<username>:<password>@rotating-residential.myproxy.host:<port>'\r\n```\r\n\r\n- As for `2.`, I use `http://` for the `https` key because if I try with `https`\r\n\r\n```\r\nproxies = {\r\n 'http': 'http://<username>:<password>@rotating-residential.myproxy.host:<port>'\r\n 'https': 'https://<username>:<password>@rotating-residential.myproxy.host:<port>'\r\n}\r\n```\r\n\r\nThis happens:\r\n\r\n`SSLError(SSLCertVerificationError(\"hostname 'rotating-residential.myproxy.host' doesn't match '*.rotating.myproxy.host'\")`\r\n\r\n- As for `3.`, no, `2.25.1` doesn't fix it. It's the same.\r\n\r\nBTW, when I created this post it didn't work, then it worked and now it's again not working. In the same machine and with the same code.\r\n", "If it's intermittent, I'm not sure we can tie the failure to Requests given that you've just validated the pieces involved which are all static. We've also proven it's unrelated to any of the proxy issues in the last two versions, so I don't believe this is a new bug. If the parsed URI from `prepend_scheme_if_needed` isn't missing the `userinfo` portion, that should all get passed along.\r\n\r\nAt this point we'd need more info from the proxy on _why_ it's rejecting the request because I'm not seeing anything suggesting this is actually a problem with the library.", "Hi @cattieinthere, checking in to see if you're still experiencing this issue or have any more info. I think we'll likely resolve this next week if we don't have an update as there aren't further actions we can take.", "Going to resolve since we haven't heard anything further. Feel free to reopen if you find any new information. Thanks!", "> Going to resolve since we haven't heard anything further. Feel free to reopen if you find any new information. Thanks!\r\n\r\nI'd like to just make known that I had the exact problem on 2.27.0, downgrading to 2.26.0 fixed it for me", "I second this. Downgrading to 2.26.0 fixed it for me." ]
https://api.github.com/repos/psf/requests/issues/6042
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6042/labels{/name}
https://api.github.com/repos/psf/requests/issues/6042/comments
https://api.github.com/repos/psf/requests/issues/6042/events
https://github.com/psf/requests/pull/6042
1,099,297,426
PR_kwDOABTKOs4wzjqp
6,042
Disable lock-threads on forks
{ "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
2022-01-11T15:27:18Z
2022-04-11T18:00:32Z
2022-01-11T17:42:01Z
MEMBER
resolved
I noticed the GH actions in my fork are constantly running lock threads which isn't serving a purpose beyond burning compute time. This PR should restrict the action to just the primary repo.
{ "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/6042/reactions" }
https://api.github.com/repos/psf/requests/issues/6042/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6042.diff", "html_url": "https://github.com/psf/requests/pull/6042", "merged_at": "2022-01-11T17:42:01Z", "patch_url": "https://github.com/psf/requests/pull/6042.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6042" }
true
[]
https://api.github.com/repos/psf/requests/issues/6041
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6041/labels{/name}
https://api.github.com/repos/psf/requests/issues/6041/comments
https://api.github.com/repos/psf/requests/issues/6041/events
https://github.com/psf/requests/issues/6041
1,098,436,884
I_kwDOABTKOs5BeNEU
6,041
requests.head returning incomplete information
{ "avatar_url": "https://avatars.githubusercontent.com/u/6734060?v=4", "events_url": "https://api.github.com/users/dvrhax/events{/privacy}", "followers_url": "https://api.github.com/users/dvrhax/followers", "following_url": "https://api.github.com/users/dvrhax/following{/other_user}", "gists_url": "https://api.github.com/users/dvrhax/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dvrhax", "id": 6734060, "login": "dvrhax", "node_id": "MDQ6VXNlcjY3MzQwNjA=", "organizations_url": "https://api.github.com/users/dvrhax/orgs", "received_events_url": "https://api.github.com/users/dvrhax/received_events", "repos_url": "https://api.github.com/users/dvrhax/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dvrhax/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dvrhax/subscriptions", "type": "User", "url": "https://api.github.com/users/dvrhax", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2022-01-10T22:07:44Z
2022-01-11T01:34:10Z
2022-01-10T22:12:07Z
NONE
resolved
<!-- Summary. --> requests.head and request.get returning different headers ## Expected Result <!-- What you expected. --> requests.head().headers == requests.get().headers ## Actual Result <!-- What happened instead. --> requests.head().headers != requests.get().headers ## Reproduction Steps ```python import requests url = 'https://stream.redcircle.com/episodes/5a761d93-a934-4511-84d9-35c2a7dc3b2b/stream.mp3' requests.head(url).headers requests.get(url).headers #The second requests.get includes additional header items, most importantly the filename. ``` ## System Information $ python -m requests.help ```json { { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.7" }, "cryptography": { "version": "3.2.1" }, "idna": { "version": "2.8" }, "implementation": { "name": "CPython", "version": "3.8.10" }, "platform": { "release": "5.4.0-92-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010108f", "version": "19.0.0" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.25.8" }, "using_charset_normalizer": false, "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/6041/reactions" }
https://api.github.com/repos/psf/requests/issues/6041/timeline
null
completed
null
null
false
[ "Hi @dvrhax,\r\n\r\nIt seems there may be some misunderstanding on the fundamentals of HTTP. Given that the GET contains a body there will _always_ be more headers than provided in the HEAD call. There are a lot of great resources out there for learning more or you might consider asking questions on [StackOverflow](https://stackoverflow.com). We won't be able to assist with that on this issue tracker though.", "According to the standard though:\r\nhttps://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html\r\n\r\n9.4 HEAD\r\nThe HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification.\r\n\r\nThis would appear contrary to the way requests is functioning as it should not be the case that the GET contains more headers than provided in the HEAD call. Now I can appreciate that SHOULD is not \"IS\" and that potentially this is a fault with the server side and not requests but it does seem to be an edge case that requests could handle.", "We cannot create data that is not sent to us. If it's not included from the server with the HEAD request, it won't be returned by Requests.\r\n\r\nFor educational purposes for others arriving here later. The above RFC being quoted is wrong. The information that’s relevant is in [RFC 7231 4.3.2](https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.2).", "I'm not implying that it should be \"created\" and like I said this could be a server side issue where they're not adhering to the standard but I opened the issue as it's also seems to be reasonable that something could be getting truncated in requests hence the bug submission. If that's not the case that's fine just putting it out there.", "Nothing gets truncated, we give you everything. Try verifying with a different client, i.e., curl. I see different headers between the two in curl. " ]
https://api.github.com/repos/psf/requests/issues/6040
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6040/labels{/name}
https://api.github.com/repos/psf/requests/issues/6040/comments
https://api.github.com/repos/psf/requests/issues/6040/events
https://github.com/psf/requests/issues/6040
1,097,303,724
I_kwDOABTKOs5BZ4as
6,040
How do i request this full page?
{ "avatar_url": "https://avatars.githubusercontent.com/u/78311283?v=4", "events_url": "https://api.github.com/users/John-ison/events{/privacy}", "followers_url": "https://api.github.com/users/John-ison/followers", "following_url": "https://api.github.com/users/John-ison/following{/other_user}", "gists_url": "https://api.github.com/users/John-ison/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/John-ison", "id": 78311283, "login": "John-ison", "node_id": "MDQ6VXNlcjc4MzExMjgz", "organizations_url": "https://api.github.com/users/John-ison/orgs", "received_events_url": "https://api.github.com/users/John-ison/received_events", "repos_url": "https://api.github.com/users/John-ison/repos", "site_admin": false, "starred_url": "https://api.github.com/users/John-ison/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/John-ison/subscriptions", "type": "User", "url": "https://api.github.com/users/John-ison", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-01-09T21:10:13Z
2022-04-09T22:00:21Z
2022-01-09T21:24:59Z
NONE
resolved
When I request this page `https://dictionary.writtenchinese.com/#sk=yi&svt=pinyin` I only get half of it. Is there a way to get the search results as well?
{ "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/6040/reactions" }
https://api.github.com/repos/psf/requests/issues/6040/timeline
null
completed
null
null
false
[ "Hi @John-ison, Requests isn't a browser and won't execute JavaScript which is likely the issue you're hitting. We can't provide general web troubleshooting support on this issue tracker though. Your best option is to check https://StackOverflow.com for what you're trying to do." ]
https://api.github.com/repos/psf/requests/issues/6039
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6039/labels{/name}
https://api.github.com/repos/psf/requests/issues/6039/comments
https://api.github.com/repos/psf/requests/issues/6039/events
https://github.com/psf/requests/pull/6039
1,097,213,414
PR_kwDOABTKOs4wsypu
6,039
Allow HTTPResponse subclassing
{ "avatar_url": "https://avatars.githubusercontent.com/u/15073640?v=4", "events_url": "https://api.github.com/users/cclecle/events{/privacy}", "followers_url": "https://api.github.com/users/cclecle/followers", "following_url": "https://api.github.com/users/cclecle/following{/other_user}", "gists_url": "https://api.github.com/users/cclecle/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/cclecle", "id": 15073640, "login": "cclecle", "node_id": "MDQ6VXNlcjE1MDczNjQw", "organizations_url": "https://api.github.com/users/cclecle/orgs", "received_events_url": "https://api.github.com/users/cclecle/received_events", "repos_url": "https://api.github.com/users/cclecle/repos", "site_admin": false, "starred_url": "https://api.github.com/users/cclecle/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/cclecle/subscriptions", "type": "User", "url": "https://api.github.com/users/cclecle", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-01-09T14:39:49Z
2022-04-09T22:00:21Z
2022-01-09T16:15:57Z
NONE
resolved
- defining a new static variable in HTTPAdapter : _clsHTTPResponse - using this variable instead of direct HTTPAdapter object creation
{ "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/6039/reactions" }
https://api.github.com/repos/psf/requests/issues/6039/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6039.diff", "html_url": "https://github.com/psf/requests/pull/6039", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6039.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6039" }
true
[ "We're under a feature freeze and this is adding an undocumented, private attribute that users might be expected to override. We will not be accepting this", "Maybe it need to be discussed ... \r\nIf it is only a documentation problem, tell me where to add it.\r\n\r\nReason of this pull-request: \r\nhttps://stackoverflow.com/questions/16903528/how-to-get-response-ssl-certificate-from-requests-in-python/70642124#70642124\r\n\r\n" ]
https://api.github.com/repos/psf/requests/issues/6038
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6038/labels{/name}
https://api.github.com/repos/psf/requests/issues/6038/comments
https://api.github.com/repos/psf/requests/issues/6038/events
https://github.com/psf/requests/issues/6038
1,097,038,374
I_kwDOABTKOs5BY3om
6,038
mohon bantuannya untuk melakukan pemulihan keamanan
{ "avatar_url": "https://avatars.githubusercontent.com/u/97199516?v=4", "events_url": "https://api.github.com/users/Adakahbosq/events{/privacy}", "followers_url": "https://api.github.com/users/Adakahbosq/followers", "following_url": "https://api.github.com/users/Adakahbosq/following{/other_user}", "gists_url": "https://api.github.com/users/Adakahbosq/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Adakahbosq", "id": 97199516, "login": "Adakahbosq", "node_id": "U_kgDOBcslnA", "organizations_url": "https://api.github.com/users/Adakahbosq/orgs", "received_events_url": "https://api.github.com/users/Adakahbosq/received_events", "repos_url": "https://api.github.com/users/Adakahbosq/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Adakahbosq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Adakahbosq/subscriptions", "type": "User", "url": "https://api.github.com/users/Adakahbosq", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-01-08T21:17:31Z
2022-01-08T21:19:46Z
2022-01-08T21:19:46Z
NONE
null
<!-- Summary. --> ## Expected Result <!-- What you expected. --> ## Actual Result <!-- What happened instead. --> ## Reproduction Steps ```python import requests ``` ## System Information $ python -m requests.help ```json { "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/6038/reactions" }
https://api.github.com/repos/psf/requests/issues/6038/timeline
null
completed
null
null
false
[ "mohon bantuannya untuk melakukan pemulihan keamanan" ]
https://api.github.com/repos/psf/requests/issues/6037
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6037/labels{/name}
https://api.github.com/repos/psf/requests/issues/6037/comments
https://api.github.com/repos/psf/requests/issues/6037/events
https://github.com/psf/requests/pull/6037
1,096,519,813
PR_kwDOABTKOs4wq3Bj
6,037
Start testing on 3.11 dev branch
{ "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
2022-01-07T17:29:38Z
2022-04-07T20:00:28Z
2022-01-07T19:07:31Z
MEMBER
resolved
null
{ "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/6037/reactions" }
https://api.github.com/repos/psf/requests/issues/6037/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6037.diff", "html_url": "https://github.com/psf/requests/pull/6037", "merged_at": "2022-01-07T19:07:31Z", "patch_url": "https://github.com/psf/requests/pull/6037.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6037" }
true
[]
https://api.github.com/repos/psf/requests/issues/6036
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6036/labels{/name}
https://api.github.com/repos/psf/requests/issues/6036/comments
https://api.github.com/repos/psf/requests/issues/6036/events
https://github.com/psf/requests/pull/6036
1,095,877,983
PR_kwDOABTKOs4wozwN
6,036
Limit size of payload in JSONDecodeError
{ "avatar_url": "https://avatars.githubusercontent.com/u/52714809?v=4", "events_url": "https://api.github.com/users/chyzzqo2/events{/privacy}", "followers_url": "https://api.github.com/users/chyzzqo2/followers", "following_url": "https://api.github.com/users/chyzzqo2/following{/other_user}", "gists_url": "https://api.github.com/users/chyzzqo2/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chyzzqo2", "id": 52714809, "login": "chyzzqo2", "node_id": "MDQ6VXNlcjUyNzE0ODA5", "organizations_url": "https://api.github.com/users/chyzzqo2/orgs", "received_events_url": "https://api.github.com/users/chyzzqo2/received_events", "repos_url": "https://api.github.com/users/chyzzqo2/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chyzzqo2/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chyzzqo2/subscriptions", "type": "User", "url": "https://api.github.com/users/chyzzqo2", "user_view_type": "public" }
[]
closed
true
null
[]
{ "closed_at": "2022-06-09T17:44:05Z", "closed_issues": 8, "created_at": "2022-04-07T05:17:41Z", "creator": { "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" }, "description": "", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/30", "id": 7852541, "labels_url": "https://api.github.com/repos/psf/requests/milestones/30/labels", "node_id": "MI_kwDOABTKOs4Ad9H9", "number": 30, "open_issues": 0, "state": "closed", "title": "2.28.0", "updated_at": "2022-06-09T17:44:05Z", "url": "https://api.github.com/repos/psf/requests/milestones/30" }
8
2022-01-07T01:02:24Z
2023-06-17T00:03:19Z
2022-01-13T15:42:49Z
CONTRIBUTOR
resolved
2.27 introduced a change in behavior where now the exception raised by parsing invalid data as json contains the full body of the invalid response. This gets included it's string representation. This can cause problems when the response is very large. This PR tries to limit the size of the response that we store this way, to what might be around the reported error position. But we could also just return to first n bytes or remove the response altogether and let users fetch it, if needed from the error.response 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/6036/reactions" }
https://api.github.com/repos/psf/requests/issues/6036/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6036.diff", "html_url": "https://github.com/psf/requests/pull/6036", "merged_at": "2022-01-13T15:42:49Z", "patch_url": "https://github.com/psf/requests/pull/6036.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6036" }
true
[ "Is the problem that it gets included in the string representation or that it's included? If it's the former, I'm far more inclined to just not show it there. ", "Mostly the fact that it is in the string representation. We could just override that in the class. Or we could make the doc a kwarg that we pop like response. The actual args for IOError are `(errno, strerror[, filename[, winerror[, filename2]]])`. I don't think that doc fits very cleanly into any of those.", "Here's an alternative the just reverses the init order so that the message comes from the base json decode error rather than the ioerror", "Thanks @chyzzqo2, let's see how the tests run. I think this is closer to the right approach. `doc` has always been included as a str in Python 3 for `JSONDecodeError` but it looks like we're passing it as the wrong argument in the new exception.", "Alright tests look good and I did some quick spot checking with the script below. This seems to be relatively in-line with previous behavior (2.26.0). We're no longer mis-populating fields.\r\n\r\nWe do have a number of new unpopulated fields from the multi-inheritance but I don't think that's a deal breaker for now. We'll consider this change a bugfix. If there's enough demand, we may choose to write something to appropriately populate all of the exception metadata later based on which `json` module is used. We can do this as an enhancement though.\r\n\r\n```python\r\nimport platform\r\nimport requests\r\n\r\nprint(requests.__version__)\r\nprint(platform.python_version())\r\n\r\nr = requests.get('https://www.python.org/psf/')\r\ntry:\r\n r.json()\r\nexcept Exception as e:\r\n attributes = [i for i in dir(e) if not i.startswith('_')]\r\n print('Attributes: {}'.format(attributes))\r\n if hasattr(e, 'doc'):\r\n err = \"Error Type: {}, Doc type: {}, Doc len: {}\"\r\n print(err.format(type(e), type(e.doc), len(e.doc)))\r\n else:\r\n print(\"No doc attribute present.\")\r\n\r\n print(e)\r\n```\r\n\r\n## Requests 2.26.0\r\n#### Python 3.6 (stdlib)\r\n```\r\n2.26.0\r\n3.6.15\r\nAttributes: ['args', 'colno', 'doc', 'lineno', 'msg', 'pos', 'with_traceback']\r\nError Type: <class 'json.decoder.JSONDecodeError'>, Doc type: <class 'str'>, Doc len: 35177\r\nExpecting value: line 3 column 1 (char 2)\r\n```\r\n\r\n#### Python 3.6 (simplejson)\r\n```\r\n2.26.0\r\n3.6.15\r\nAttributes: ['args', 'colno', 'doc', 'end', 'endcolno', 'endlineno', 'lineno', 'msg', 'pos', 'with_traceback']\r\nError Type: <class 'simplejson.errors.JSONDecodeError'>, Doc type: <class 'str'>, Doc len: 35177\r\nExpecting value: line 3 column 1 (char 2)\r\n```\r\n\r\n#### Python 3.10 (std lib)\r\n```\r\n2.26.0\r\n3.10.1\r\nAttributes: ['args', 'colno', 'doc', 'lineno', 'msg', 'pos', 'with_traceback']\r\nError Type: <class 'json.decoder.JSONDecodeError'>, Doc type: <class 'str'>, Doc len: 35177\r\nExpecting value: line 3 column 1 (char 2)\r\n```\r\n\r\n### Python 3.10 (simplejson)\r\n```\r\n2.26.0\r\n3.10.1\r\nAttributes: ['args', 'colno', 'doc', 'end', 'endcolno', 'endlineno', 'lineno', 'msg', 'pos', 'with_traceback']\r\nError Type: <class 'simplejson.errors.JSONDecodeError'>, Doc type: <class 'str'>, Doc len: 35177\r\nExpecting value: line 3 column 1 (char 2)\r\n```\r\n\r\n## Requests (PR #6036)\r\n#### Python 3.6 (std lib)\r\n```\r\n2.27.1\r\n3.6.15\r\nAttributes: ['args', 'characters_written', 'colno', 'doc', 'errno', 'filename', 'filename2', 'lineno', 'msg', 'pos', 'request', 'response', 'strerror', 'with_traceback']\r\nError Type: <class 'requests.exceptions.JSONDecodeError'>, Doc type: <class 'str'>, Doc len: 35177\r\nExpecting value: line 3 column 1 (char 2)\r\n```\r\n\r\n#### Python 3.6 (simplejson)\r\n```\r\n2.27.1\r\n3.6.15\r\nAttributes: ['args', 'characters_written', 'colno', 'doc', 'end', 'endcolno', 'endlineno', 'errno', 'filename', 'filename2', 'lineno', 'msg', 'pos', 'request', 'response', 'strerror', 'with_traceback']\r\nError Type: <class 'requests.exceptions.JSONDecodeError'>, Doc type: <class 'str'>, Doc len: 35177\r\nExpecting value: line 3 column 1 (char 2)\r\n```\r\n\r\n#### Python 3.10 (std lib)\r\n```\r\n2.27.1\r\n3.10.1\r\nAttributes: ['args', 'characters_written', 'colno', 'doc', 'errno', 'filename', 'filename2', 'lineno', 'msg', 'pos', 'request', 'response', 'strerror', 'with_traceback']\r\nError Type: <class 'requests.exceptions.JSONDecodeError'>, Doc type: <class 'str'>, Doc len: 35177\r\nExpecting value: line 3 column 1 (char 2)\r\n```\r\n\r\n#### Python 3.10 (simplejson)\r\n```\r\n2.27.1\r\n3.10.1\r\nAttributes: ['args', 'characters_written', 'colno', 'doc', 'end', 'endcolno', 'endlineno', 'errno', 'filename', 'filename2', 'lineno', 'msg', 'pos', 'request', 'response', 'strerror', 'with_traceback']\r\nError Type: <class 'requests.exceptions.JSONDecodeError'>, Doc type: <class 'str'>, Doc len: 35177\r\nExpecting value: line 3 column 1 (char 2)\r\n```", "Hello! I'm facing an issue now (after upgrading to `requests==2.28.0`) with this update.\r\n\r\nBasically, I want to test the `try/except requests.JSONDecodeError` paths in my application using `pytest`. At some point in tests I do `mock_request.return_value.json.side_effect = requests.JSONDecodeError()` which is now unable to run because \r\n```\r\nself = JSONDecodeError(), args = (), kwargs = {}\r\n\r\n def __init__(self, *args, **kwargs):\r\n \"\"\"\r\n Construct the JSONDecodeError instance first with all\r\n args. Then use it's args to construct the IOError so that\r\n the json specific args aren't used as IOError specific args\r\n and the error message from JSONDecodeError is preserved.\r\n \"\"\"\r\n> CompatJSONDecodeError.__init__(self, *args)\r\nE TypeError: JSONDecodeError.__init__() missing 3 required positional arguments: 'msg', 'doc', and 'pos'\r\n```\r\n\r\nAnything we should be concerned about at this point, after the PR is released? Or is there something I do wrong?", "Hi @mykolasolodukha,\r\n\r\nBeing able to create an empty JSONDecodeError wasn't originally intended when implementing this error. The function signature was kept ambiguous due to differences between Python2/3 and these exceptions generally aren't intended to be reused externally. We may be able to make the signature more explicit now but in the interim, you can instantiate the error similar to below:\r\n```\r\nrequests.JSONDecodeError('','',0)\r\n```\r\n\r\nThe stdlib JSONDecodeError takes argument types `str, str, int` for msg, doc, pos respectively.", "Thanks a lot @nateprewitt !" ]
https://api.github.com/repos/psf/requests/issues/6035
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6035/labels{/name}
https://api.github.com/repos/psf/requests/issues/6035/comments
https://api.github.com/repos/psf/requests/issues/6035/events
https://github.com/psf/requests/pull/6035
1,095,376,211
PR_kwDOABTKOs4wnJzU
6,035
Adding missing dependancies for testing
{ "avatar_url": "https://avatars.githubusercontent.com/u/2185992?v=4", "events_url": "https://api.github.com/users/notAutomne/events{/privacy}", "followers_url": "https://api.github.com/users/notAutomne/followers", "following_url": "https://api.github.com/users/notAutomne/following{/other_user}", "gists_url": "https://api.github.com/users/notAutomne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/notAutomne", "id": 2185992, "login": "notAutomne", "node_id": "MDQ6VXNlcjIxODU5OTI=", "organizations_url": "https://api.github.com/users/notAutomne/orgs", "received_events_url": "https://api.github.com/users/notAutomne/received_events", "repos_url": "https://api.github.com/users/notAutomne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/notAutomne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/notAutomne/subscriptions", "type": "User", "url": "https://api.github.com/users/notAutomne", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-01-06T14:32:42Z
2022-04-06T18:00:32Z
2022-01-06T17:58:00Z
CONTRIBUTOR
resolved
Pygments is mandatory for the Flask server. If Pygments is missing PyTest will not run : ``` === ERRORS === ___ ERROR collecting docs/_themes/flask_theme_support.py ___ docs\_themes\flask_theme_support.py:2: in <module> from pygments.style import Style E ModuleNotFoundError: No module named 'pygments' === short test summary info === ERROR docs/_themes/flask_theme_support.py - ModuleNotFoundError: No module named 'pygments' ``` PySocks is mandatory for test_lowlevel.py, if PySocks is missing 8 tests could fail: ``` FAILED tests/test_lowlevel.py::test_use_proxy_from_environment[http_proxy-http] - requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. FAILED tests/test_lowlevel.py::test_use_proxy_from_environment[https_proxy-https] - requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. FAILED tests/test_lowlevel.py::test_use_proxy_from_environment[all_proxy-http] - requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. FAILED tests/test_lowlevel.py::test_use_proxy_from_environment[all_proxy-https] - requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. FAILED tests/test_lowlevel.py::test_use_proxy_from_environment[HTTP_PROXY-http] - requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. FAILED tests/test_lowlevel.py::test_use_proxy_from_environment[HTTPS_PROXY-https] - requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. FAILED tests/test_lowlevel.py::test_use_proxy_from_environment[ALL_PROXY-http] - requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. FAILED tests/test_lowlevel.py::test_use_proxy_from_environment[ALL_PROXY-https] - requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. ```
{ "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/6035/reactions" }
https://api.github.com/repos/psf/requests/issues/6035/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6035.diff", "html_url": "https://github.com/psf/requests/pull/6035", "merged_at": "2022-01-06T17:58:00Z", "patch_url": "https://github.com/psf/requests/pull/6035.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6035" }
true
[ "Hi @marwanpro, these dependencies are brought into our test environment from the `socks` extra. Our standard testing workflow is `make` followed by `make ci`. This will install the required dependencies and run the test suite.\r\n\r\nRather than duplicating our dependency requirements, I'd be willing to accept a PR adding `-e .[socks]` to the top of the requirements file. That will allow us to collapse [this statement](https://github.com/psf/requests/blob/main/Makefile#L2-L4) in the Makefile to a single call.\r\n\r\nRegarding pygments, that file should not be being used anywhere in the docs and is mostly there as a legacy artifact. Could you provide more info on what is actually producing the error?", "Hi @nateprewitt \r\n\r\n> Regarding pygments, that file should not be being used anywhere in the docs and is mostly there as a legacy artifact. Could you provide more info on what is actually producing the error?\r\n\r\nIt's my fault, I run the command `pytest` without specifying `tests`\r\n\r\n", "> Hi @marwanpro, these dependencies are brought into our test environment from the socks extra. Our standard testing workflow is make followed by make ci. This will install the required dependencies and run the test suite.\r\n> \r\n> Rather than duplicating our dependency requirements, I'd be willing to accept a PR adding -e .[socks] to the top of the requirements file. That will allow us to collapse this statement in the Makefile to a single call.\r\n\r\nDone in [4b0fa7e](https://github.com/psf/requests/pull/6035/commits/4b0fa7e1ee7a92a32663975f9ca75e28d01672de)" ]
https://api.github.com/repos/psf/requests/issues/6034
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6034/labels{/name}
https://api.github.com/repos/psf/requests/issues/6034/comments
https://api.github.com/repos/psf/requests/issues/6034/events
https://github.com/psf/requests/issues/6034
1,095,326,003
I_kwDOABTKOs5BSVkz
6,034
2.27.1: pytest is failing in `tests/test_utils.py::TestExtractZippedPaths::test_zipped_paths_extracted` unit
{ "avatar_url": "https://avatars.githubusercontent.com/u/31284574?v=4", "events_url": "https://api.github.com/users/kloczek/events{/privacy}", "followers_url": "https://api.github.com/users/kloczek/followers", "following_url": "https://api.github.com/users/kloczek/following{/other_user}", "gists_url": "https://api.github.com/users/kloczek/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kloczek", "id": 31284574, "login": "kloczek", "node_id": "MDQ6VXNlcjMxMjg0NTc0", "organizations_url": "https://api.github.com/users/kloczek/orgs", "received_events_url": "https://api.github.com/users/kloczek/received_events", "repos_url": "https://api.github.com/users/kloczek/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kloczek/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kloczek/subscriptions", "type": "User", "url": "https://api.github.com/users/kloczek", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-01-06T13:33:31Z
2022-01-06T17:09:36Z
2022-01-06T17:09:27Z
NONE
spam
I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account. - `python3 -sBm build -w --no-isolation` - install .whl file in </install/prefix> - run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix> ## Expected Result pytest should should be running without fails or errors. ## Actual Result Looks like pytest is failing in `tests/test_utils.py::TestExtractZippedPaths::test_zipped_paths_extracted unit` Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.27.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.27.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/requests-2.27.1, configfile: pytest.ini plugins: httpbin-1.0.1, mock-3.6.1 collected 559 items tests/test_help.py ... [ 0%] tests/test_hooks.py ... [ 1%] tests/test_lowlevel.py ................... [ 4%] tests/test_packages.py ... [ 5%] tests/test_requests.py ..............................................................................................................pytest-httpbin server hit an exception serving request: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1131) .attempting to ignore so the rest of the tests can run .............................. [ 30%] ...........................................................x..................................................................................... [ 56%] tests/test_structures.py .................... [ 59%] tests/test_testserver.py ......s.... [ 61%] tests/test_utils.py ..s............................................................................F................................................................ [ 87%] .......................................................ssssssssss..... [100%] ================================================================================= FAILURES ================================================================================= ____________________________________________________________ TestExtractZippedPaths.test_zipped_paths_extracted ____________________________________________________________ self = <tests.test_utils.TestExtractZippedPaths object at 0x7fb1f4f46250>, tmpdir = local('/tmp/pytest-of-tkloczko/pytest-632/test_zipped_paths_extracted0') def test_zipped_paths_extracted(self, tmpdir): zipped_py = tmpdir.join('test.zip') with zipfile.ZipFile(zipped_py.strpath, 'w') as f: f.write(__file__) _, name = os.path.splitdrive(__file__) zipped_path = os.path.join(zipped_py.strpath, name.lstrip(r'\/')) extracted_path = extract_zipped_paths(zipped_path) assert extracted_path != zipped_path assert os.path.exists(extracted_path) > assert filecmp.cmp(extracted_path, __file__) E AssertionError: assert False E + where False = <function cmp at 0x7fb1f4ca65e0>('/tmp/test_utils.py', '/home/tkloczko/rpmbuild/BUILD/requests-2.27.1/tests/test_utils.py') E + where <function cmp at 0x7fb1f4ca65e0> = filecmp.cmp tests/test_utils.py:299: AssertionError ========================================================================= short test summary info ========================================================================== SKIPPED [1] tests/test_testserver.py:95: this fails non-deterministically under pytest-xdist SKIPPED [1] tests/test_utils.py:33: condition: cStringIO is None SKIPPED [10] tests/test_utils.py:731: Test only on Windows XFAIL tests/test_requests.py::TestRequests::test_response_iter_lines_reentrant FAILED tests/test_utils.py::TestExtractZippedPaths::test_zipped_paths_extracted - AssertionError: assert False ===================================================== 1 failed, 545 passed, 12 skipped, 1 xfailed in 66.84s (0:01:06) ====================================================== ``` List modules installed in build env: ```consile Package Version ----------------------------- ------------------- alabaster 0.7.12 appdirs 1.4.4 attrs 21.4.0 Babel 2.9.1 blinker 1.4 Brotli 1.0.9 build 0.7.0 cffi 1.15.0 chardet 4.0.0 charset-normalizer 2.0.10 click 8.0.3 cryptography 36.0.1 cycler 0.11.0 dbus-python 1.2.18 decorator 5.1.0 distro 1.6.0 docutils 0.17.1 extras 1.0.0 fixtures 3.0.0 Flask 2.0.2 fonttools 4.28.5 gpg 1.16.0-unknown httpbin 0.7.0 idna 3.3 imagesize 1.3.0 importlib-metadata 4.10.0 iniconfig 1.1.1 itsdangerous 2.0.1 Jinja2 3.0.3 kiwisolver 1.3.2 libcomps 0.1.18 lit 13.0.0 lxml 4.7.1 Mako 1.1.6.dev0 Markdown 3.3.6 MarkupSafe 2.0.1 matplotlib 3.5.1 meson 0.60.3 numpy 1.22.0 olefile 0.46 packaging 21.3 pbr 5.8.0 pep517 0.12.0 Pillow 9.0.0 pip 21.3.1 pluggy 1.0.0 ply 3.11 py 1.11.0 pycparser 2.21 Pygments 2.11.1 PyGObject 3.42.0 pyparsing 3.0.6 PySocks 1.7.1 pytest 6.2.5 pytest-httpbin 1.0.1 pytest-mock 3.6.1 python-dateutil 2.8.2 pytz 2021.1 raven 6.10.0 requests 2.26.0 rpm 4.17.0 scour 0.38.2 setuptools 60.1.0.post20211225 six 1.16.0 smartypants 2.0.1 snowballstemmer 2.2.0 Sphinx 4.3.2.dev20211231 sphinxcontrib-applehelp 1.0.2.dev20211227 sphinxcontrib-devhelp 1.0.2.dev20211228 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1.dev20211227 sphinxcontrib-qthelp 1.0.3.dev20211227 sphinxcontrib-serializinghtml 1.1.5 testtools 2.5.0 toml 0.10.2 tomli 2.0.0 trustme 0.9.0 typogrify 2.0.7 urllib3 1.26.7 Werkzeug 2.0.2 wheel 0.37.1 zipp 3.7.0 ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4", "events_url": "https://api.github.com/users/sethmlarson/events{/privacy}", "followers_url": "https://api.github.com/users/sethmlarson/followers", "following_url": "https://api.github.com/users/sethmlarson/following{/other_user}", "gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sethmlarson", "id": 18519037, "login": "sethmlarson", "node_id": "MDQ6VXNlcjE4NTE5MDM3", "organizations_url": "https://api.github.com/users/sethmlarson/orgs", "received_events_url": "https://api.github.com/users/sethmlarson/received_events", "repos_url": "https://api.github.com/users/sethmlarson/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions", "type": "User", "url": "https://api.github.com/users/sethmlarson", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/6034/reactions" }
https://api.github.com/repos/psf/requests/issues/6034/timeline
null
completed
null
null
false
[ "Looks like [our test suite is passing](https://github.com/psf/requests/actions/workflows/run-tests.yml). We're not going to debug your different testing setup+methodology for you. Please do not open further issues like this, you are wasting maintainer time by doing so." ]
https://api.github.com/repos/psf/requests/issues/6033
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6033/labels{/name}
https://api.github.com/repos/psf/requests/issues/6033/comments
https://api.github.com/repos/psf/requests/issues/6033/events
https://github.com/psf/requests/issues/6033
1,095,291,810
I_kwDOABTKOs5BSNOi
6,033
Can't unset the User-Agent
{ "avatar_url": "https://avatars.githubusercontent.com/u/2185992?v=4", "events_url": "https://api.github.com/users/notAutomne/events{/privacy}", "followers_url": "https://api.github.com/users/notAutomne/followers", "following_url": "https://api.github.com/users/notAutomne/following{/other_user}", "gists_url": "https://api.github.com/users/notAutomne/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/notAutomne", "id": 2185992, "login": "notAutomne", "node_id": "MDQ6VXNlcjIxODU5OTI=", "organizations_url": "https://api.github.com/users/notAutomne/orgs", "received_events_url": "https://api.github.com/users/notAutomne/received_events", "repos_url": "https://api.github.com/users/notAutomne/repos", "site_admin": false, "starred_url": "https://api.github.com/users/notAutomne/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/notAutomne/subscriptions", "type": "User", "url": "https://api.github.com/users/notAutomne", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2022-01-06T12:51:21Z
2022-04-06T18:00:31Z
2022-01-06T17:27:03Z
CONTRIBUTOR
resolved
<!-- Summary. --> Impossible to unset the User-Agent, if I pass `headers = { 'User-Agent': None }`, urllib3 UA will be set as a fallback <!-- What you expected. --> I expect to not have any User-Agent sent to the webserver <!-- What happened instead. --> ![image](https://user-images.githubusercontent.com/2185992/148385822-0a88da4f-9165-4f66-94e1-6769c6607f9b.png) ## Reproduction Steps ```python import requests headers = { 'User-Agent': None } proxies = { 'https': 'http://127.0.0.1:8888' } response = requests.post( 'http://localhost:8888/', data={'name': 'test'}, headers=headers, proxies=proxies, verify=False ) exit() ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.1" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "101010cf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "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/6033/reactions" }
https://api.github.com/repos/psf/requests/issues/6033/timeline
null
completed
null
null
false
[ "I thought this was a duplicate of the other issue you commented, sorry for the misclick", "> I thought this was a duplicate of the other issue you commented, sorry for the misclick\r\n\r\nNo problem, I have the same issue even without session", "Yup. I see that from the other issue too. Thanks for the clear issue", "@sigmavirus24 Your PR #5693 solves the issue, why not merging it ?\r\n\r\nI merged your PR with the latest commit on my local branch, only one test fails : TestRequests.test_header_remove_is_case_insensitive", "Hi @marwanpro, there are still some usability concerns with that patch. For the time being, you are free to do the same thing and pass urllib3's SKIP_HEADER in your request to disable their defaulted values.\n\n```\nheaders = {'user-agent': SKIP_HEADER, ... }\n\nreq = Request('GET', someurl)\nprep = req.prepare()\nprep.headers = headers\n```", "This does appear to be a duplicate of #5671 too. Is there a subtlety I'm missing @sigmavirus24? If not, I'll port the current workaround to that ticket and resolve this one so we can keep tracking centralized." ]
https://api.github.com/repos/psf/requests/issues/6032
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6032/labels{/name}
https://api.github.com/repos/psf/requests/issues/6032/comments
https://api.github.com/repos/psf/requests/issues/6032/events
https://github.com/psf/requests/issues/6032
1,095,047,187
I_kwDOABTKOs5BRRgT
6,032
Unsupported proxy URL pattern: localhost:<port>
{ "avatar_url": "https://avatars.githubusercontent.com/u/83443?v=4", "events_url": "https://api.github.com/users/tomers/events{/privacy}", "followers_url": "https://api.github.com/users/tomers/followers", "following_url": "https://api.github.com/users/tomers/following{/other_user}", "gists_url": "https://api.github.com/users/tomers/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tomers", "id": 83443, "login": "tomers", "node_id": "MDQ6VXNlcjgzNDQz", "organizations_url": "https://api.github.com/users/tomers/orgs", "received_events_url": "https://api.github.com/users/tomers/received_events", "repos_url": "https://api.github.com/users/tomers/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tomers/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tomers/subscriptions", "type": "User", "url": "https://api.github.com/users/tomers", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2022-01-06T07:32:30Z
2022-01-12T16:01:52Z
2022-01-12T16:01:42Z
NONE
resolved
I used to have a working code in which the proxy URL was provided without a scheme: ```python proxy_server = 'localhost:8100' session = requests.Session() session.proxies = dict(http=proxy_server, https=proxy_server) ``` Recently I started getting 'Please check proxy URL. It is malformed and could be missing the host.' which is caused by using proxy URL `localhost:8100`, which when parsed by _urllib3_ does not provide the host field. I suspect this code to cause the regression: https://github.com/psf/requests/commit/9a8a826f226e6973d72914b4a4fc806e0b5036f4 Apparently having such proxy URL is undesired by requests lib, which enforces the host to be preset, with the explanation that proxy URL should conform to [RFC3986](https://datatracker.ietf.org/doc/html/rfc3986), which contains authority section in the URL. Having authority section in the URL indeed guarantees that host is parsed: >>> assert parse_url('localhost:8100').host == None >>> assert parse_url('localhost.com:8100').host == 'localhost.com' >>> assert parse_url('user@localhost:8100').host == 'localhost' I've opened an issue in urllib3: https://github.com/urllib3/urllib3/issues/2523, however, I am rather sure it will be closed, since my expected behavior is probably against the RFC. ## Expected Result I would expect the following proxy URL to be supported: ```python proxy_server = 'localhost:8100' session = requests.Session() session.proxies = dict(http=proxy_server, https=proxy_server) ``` ## Actual Result Error is thrown: > Please check proxy URL. It is malformed and could be missing the host. ## Reproduction Steps ```python import requests assert requests.utils.prepend_scheme_if_needed('localhost:8100', 'http') == 'http://localhost:8100' ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.8" }, "cryptography": { "version": "36.0.1" }, "idna": { "version": "2.10" }, "implementation": { "name": "CPython", "version": "3.8.10" }, "platform": { "release": "5.4.0-92-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "101010df", "version": "19.1.0" }, "requests": { "version": "2.27.1" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.25.11" }, "using_charset_normalizer": false, "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/6032/reactions" }
https://api.github.com/repos/psf/requests/issues/6032/timeline
null
completed
null
null
false
[ "Hi @tomers, thanks for bringing this up. You're right that urllib3 doesn't parse this case as having a host, and you'll find all future versions of Python, starting with 3.9, don't either. We made a recent change in #5917 to move from the standard library's `urlparse` to urllib3's `parse_url` to ensure we're keeping consistent behavior across all python versions which was a notable pain point.\r\n\r\nYou'll find starting in python 3.9, this is the same with our old method as well:\r\n```\r\n>>> from urllib.parse import urlparse\r\n>>> urlparse('localhost:8000')\r\nParseResult(scheme='localhost', netloc='', path='8000', params='', query='', fragment='')\r\n```\r\n\r\nGiven this url format is unsupported in every reasonable implementation we can use, explicitly for security reasons, I'm not sure we're inclined to fix this. Attempting to write our own parser is going to create even more surface area for potential security issues, so I don't believe that's an option either.\r\n\r\nFor now, simply adding `http://` to the start of your proxy will resolve the issue. Otherwise, you can downgrade to a version of Requests which supports this. I'll leave this open for a bit to gauge impact but I think that's probably going to be our stance going forward.", "Going to resolve since we haven’t seen any other activity on this. Thanks again for the report @tomers!" ]
https://api.github.com/repos/psf/requests/issues/6031
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6031/labels{/name}
https://api.github.com/repos/psf/requests/issues/6031/comments
https://api.github.com/repos/psf/requests/issues/6031/events
https://github.com/psf/requests/issues/6031
1,094,989,704
I_kwDOABTKOs5BRDeI
6,031
MacOS cannot use a proxy with HTTP basic authentication to access HTTPS
{ "avatar_url": "https://avatars.githubusercontent.com/u/28469578?v=4", "events_url": "https://api.github.com/users/ETOCheney/events{/privacy}", "followers_url": "https://api.github.com/users/ETOCheney/followers", "following_url": "https://api.github.com/users/ETOCheney/following{/other_user}", "gists_url": "https://api.github.com/users/ETOCheney/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ETOCheney", "id": 28469578, "login": "ETOCheney", "node_id": "MDQ6VXNlcjI4NDY5NTc4", "organizations_url": "https://api.github.com/users/ETOCheney/orgs", "received_events_url": "https://api.github.com/users/ETOCheney/received_events", "repos_url": "https://api.github.com/users/ETOCheney/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ETOCheney/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ETOCheney/subscriptions", "type": "User", "url": "https://api.github.com/users/ETOCheney", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2022-01-06T05:45:41Z
2022-04-07T01:27:06Z
2022-01-06T16:20:10Z
NONE
resolved
<!-- Summary. --> ## Expected Result Displays the proxy IP address <!-- What you expected. --> ## Actual Result Traceback (most recent call last): File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 696, in urlopen self._prepare_proxy(conn) File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 964, in _prepare_proxy conn.connect() File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/urllib3/connection.py", line 371, in connect self._tunnel() File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 902, in _tunnel raise OSError("Tunnel connection failed: %d %s" % (code, OSError: Tunnel connection failed: 407 Proxy Authentication Required During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/requests/adapters.py", line 440, in send resp = conn.urlopen( File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='ifconfig.me', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/cheney/code/python/tools/test.py", line 17, in <module> res = requests.get("https://ifconfig.me", proxies=proxies) File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/requests/sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "/Users/cheney/code/python/tools/venv/lib/python3.8/site-packages/requests/adapters.py", line 513, in send raise ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='ifconfig.me', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required'))) <!-- What happened instead. --> ## Reproduction Steps When using a proxy that requires basic authentication to access an HTTPS (not HTTP) address, the system gives an error. The code is as follows: ```python import requests proxy_string = 'http://{}:{}@{}:{}'.format(username, password, proxyHost, proxyPort) proxies = {"http": proxy_string, "https": proxy_string} res = requests.get("https://ifconfig.me", proxies=proxies) print(res.text) ``` It should be noted that the same code can run normally in Windows system, but there are problems with MacOS ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.10" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.8.2" }, "platform": { "release": "21.1.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.0" }, "system_ssl": { "version": "20000000" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "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/6031/reactions" }
https://api.github.com/repos/psf/requests/issues/6031/timeline
null
completed
null
null
false
[ "Please try 2.27.1, this should have been fixed in that release", "Hi @ETOCheney, this is almost certainly a duplicate of #6027. This should be fixed in the latest release (2.27.1). I'm going to resolve this ticket for now, but please feel free to reopen if you find your issue persists after upgrading. Thanks!", "\r\n\r\n\r\n> Hi @ETOCheney, this is almost certainly a duplicate of #6027. This should be fixed in the latest release (2.27.1). I'm going to resolve this ticket for now, but please feel free to reopen if you find your issue persists after upgrading. Thanks!\r\n\r\nI tried to upgrade to latest release(2.27.1) and found that the problem has been fixed. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/6030
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6030/labels{/name}
https://api.github.com/repos/psf/requests/issues/6030/comments
https://api.github.com/repos/psf/requests/issues/6030/events
https://github.com/psf/requests/issues/6030
1,094,197,120
I_kwDOABTKOs5BOB-A
6,030
parsing of proxy url broken with requests 2.27.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/2273288?v=4", "events_url": "https://api.github.com/users/anneFly/events{/privacy}", "followers_url": "https://api.github.com/users/anneFly/followers", "following_url": "https://api.github.com/users/anneFly/following{/other_user}", "gists_url": "https://api.github.com/users/anneFly/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/anneFly", "id": 2273288, "login": "anneFly", "node_id": "MDQ6VXNlcjIyNzMyODg=", "organizations_url": "https://api.github.com/users/anneFly/orgs", "received_events_url": "https://api.github.com/users/anneFly/received_events", "repos_url": "https://api.github.com/users/anneFly/repos", "site_admin": false, "starred_url": "https://api.github.com/users/anneFly/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/anneFly/subscriptions", "type": "User", "url": "https://api.github.com/users/anneFly", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2022-01-05T10:22:40Z
2022-04-05T14:02:03Z
2022-01-05T13:22:25Z
NONE
resolved
It seems like this change https://github.com/psf/requests/pull/5917 unfortunately broke production for us. We are using a proxy url that follows this scheme: `http://randomstring:[email protected]:9293` (from a service that provides static IPs) ## Expected Result In 2.26.0 this still works: ``` >>> from requests.utils import prepend_scheme_if_needed >>> prepend_scheme_if_needed('http://randomstring:[email protected]:9293', 'http') 'http://randomstring:[email protected]:9293' ``` ## Actual Result In 2.27.0 it's broken: ``` >>> from requests.utils import prepend_scheme_if_needed >>> prepend_scheme_if_needed('http://randomstring:[email protected]:9293', 'http') 'http://eu-west-static-04.example.com:9293' ``` This leads in the end to `ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))` because the url was cut. ## Reproduction Steps ```python >>> from requests.utils import prepend_scheme_if_needed >>> prepend_scheme_if_needed('http://randomstring:[email protected]:9293', 'http') ``` ## System Information ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "36.0.1" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.9" }, "platform": { "release": "5.14.21-2-MANJARO", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "101010df", "version": "21.0.0" }, "requests": { "version": "2.27.0" }, "system_ssl": { "version": "101010df" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "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/6030/reactions" }
https://api.github.com/repos/psf/requests/issues/6030/timeline
null
completed
null
null
false
[ "Hi, @anneFly. Thanks for the report! This is actually a duplicate of #6027 which has been patched in #6028 and will be released sometime today. You can track status in #6029." ]
https://api.github.com/repos/psf/requests/issues/6029
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6029/labels{/name}
https://api.github.com/repos/psf/requests/issues/6029/comments
https://api.github.com/repos/psf/requests/issues/6029/events
https://github.com/psf/requests/pull/6029
1,093,519,041
PR_kwDOABTKOs4whKEq
6,029
v2.27.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" }
[]
closed
true
null
[]
null
1
2022-01-04T16:27:44Z
2022-04-05T16:00:49Z
2022-01-05T15:35:05Z
MEMBER
resolved
2.27.1 (2022-01-05) ------------------- **Bugfixes** - Fixed parsing issue that resulted in the `auth` component being dropped from proxy URLs. (#6028)
{ "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/6029/reactions" }
https://api.github.com/repos/psf/requests/issues/6029/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6029.diff", "html_url": "https://github.com/psf/requests/pull/6029", "merged_at": "2022-01-05T15:35:05Z", "patch_url": "https://github.com/psf/requests/pull/6029.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6029" }
true
[ "Staging for tomorrow, going to wait another 24 hours to ensure we don't have any other subtle bugs." ]
https://api.github.com/repos/psf/requests/issues/6028
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6028/labels{/name}
https://api.github.com/repos/psf/requests/issues/6028/comments
https://api.github.com/repos/psf/requests/issues/6028/events
https://github.com/psf/requests/pull/6028
1,093,470,471
PR_kwDOABTKOs4wg_-Z
6,028
Fix auth parsing for proxies
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2022-01-04T15:32:52Z
2022-04-04T17:04:26Z
2022-01-04T16:04:26Z
MEMBER
resolved
Thanks to @adamp01 and @racam for quickly helping us find this. Moving from `urlparse` to `parse_url` has led to Requests dropping the `auth` portion of proxy URLs. This patch will manually add it if present, returning us to our previous behavior. This closes #6027.
{ "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/6028/reactions" }
https://api.github.com/repos/psf/requests/issues/6028/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6028.diff", "html_url": "https://github.com/psf/requests/pull/6028", "merged_at": "2022-01-04T16:04:25Z", "patch_url": "https://github.com/psf/requests/pull/6028.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6028" }
true
[]
https://api.github.com/repos/psf/requests/issues/6027
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6027/labels{/name}
https://api.github.com/repos/psf/requests/issues/6027/comments
https://api.github.com/repos/psf/requests/issues/6027/events
https://github.com/psf/requests/issues/6027
1,092,855,823
I_kwDOABTKOs5BI6gP
6,027
Proxy authentication bug
{ "avatar_url": "https://avatars.githubusercontent.com/u/8405067?v=4", "events_url": "https://api.github.com/users/flameaway/events{/privacy}", "followers_url": "https://api.github.com/users/flameaway/followers", "following_url": "https://api.github.com/users/flameaway/following{/other_user}", "gists_url": "https://api.github.com/users/flameaway/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/flameaway", "id": 8405067, "login": "flameaway", "node_id": "MDQ6VXNlcjg0MDUwNjc=", "organizations_url": "https://api.github.com/users/flameaway/orgs", "received_events_url": "https://api.github.com/users/flameaway/received_events", "repos_url": "https://api.github.com/users/flameaway/repos", "site_admin": false, "starred_url": "https://api.github.com/users/flameaway/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/flameaway/subscriptions", "type": "User", "url": "https://api.github.com/users/flameaway", "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
12
2022-01-03T22:12:00Z
2022-04-04T17:04:26Z
2022-01-04T16:04:25Z
NONE
resolved
<!-- Summary. --> When using proxies in python 3.8.12, I get an error 407. Using any other version of python works fine. I am assuming it could be to do with this https://docs.python.org/3/whatsnew/3.8.html#notable-changes-in-python-3-8-12. <!-- What you expected. --> I should get a status of 200. <!-- What happened instead. --> I get a status code of 407. ```python import requests r = requests.get('https://example.org/', proxies=proxies) # You will need a proxy to test with, I am using a paid service. print(r.status_code) ``` ## System Information ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.8.12" }, "platform": { "release": "5.13.0-7620-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.27.0" }, "system_ssl": { "version": "101010cf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "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/6027/reactions" }
https://api.github.com/repos/psf/requests/issues/6027/timeline
null
completed
null
null
false
[ "Hi @flameaway, it’s hard to tell what exactly is happening here without more info. Could you verify this issue occurs in both Requests 2.26.0 and urllib3 1.25.11?\r\n\r\nIt could very well be related to the ipaddress change, I’d just like to rule out other potential factors before we start down that path.", "Requests 2.26.0 returns status 200. Either version of urllib (1.25.11, 1.26.7) work with it. Requests 2.27.0 returns the 407 error with either urllib version.", "Thanks for confirming that! It sounds like this may be localized to today's release (2.27.0) We made some minor refactorings to how we handle proxies on redirects in https://github.com/psf/requests/pull/5924. I'm not seeing anything off immediately, so this will need some digging. For the meantime, using 2.26.0 is likely the short term solution.\r\n\r\nI just want to clarify one more comment.\r\n\r\n> When using proxies in python 3.8.12, I get an error 407. Using any other version of python works fine.\r\n\r\nDoes this mean 2.27.0 works on all other Python versions besides 3.8.12, or did you only test 2.27.0 with 3.8.12? I want to confirm we're not dealing with a requests release issue AND a python release issue.", "> Does this mean 2.27.0 works on all other Python versions besides 3.8.12, or did you only test 2.27.0 with 3.8.12? I want to confirm we're not dealing with a requests release issue AND a python release issue.\r\n\r\nIt seems to only be having issues on 2.27.0. I didn't realize, but python 3.9.7 defaulted to installing requests 2.26.0. ", "Confirming that this error also occurs with requests 2.27.0 and Python 3.8.9", "To be clear, there is way too little information in here as it stands to be able to debug this from our end.", "Did a bisect and found: \r\n```\r\nef59aa0227bf463f0ed3d752b26db9b3acc64afb is the first bad commit\r\ncommit ef59aa0227bf463f0ed3d752b26db9b3acc64afb\r\nAuthor: Nate Prewitt <[email protected]>\r\nDate: Thu Aug 26 22:06:48 2021 -0700\r\n\r\n Move from urlparse to parse_url for prepending schemes\r\n\r\n requests/utils.py | 21 +++++++++++++++------\r\n tests/test_utils.py | 1 +\r\n 2 files changed, 16 insertions(+), 6 deletions(-)\r\n```\r\n\r\nI'm using a proxy from QuotaGuard, so it has auth.", "So after doing some digging, in my case the params passed to `urlunparse` in `prepend_scheme_if_needed` went from:\r\nscheme: `http`\r\nnetloc: `user:pwd@host:port`\r\nTo:\r\nscheme: `http`\r\nnetloc: `host:port`\r\nSo the auth is lost from netloc here. The auth is still parsed and stored in the auth var, however.\r\n\r\nAdding this to `prepend_scheme_if_needed` resolves, but unaware of any other issues that might cause:\r\n```\r\nif auth:\r\n netloc = '@'.join([auth, netloc])\r\n```", "Same issue here.\r\nSince 2.27.0 with Python 3.8\r\n\r\nI confirm @adamp01 investigation with mine. `user:pwd` seem to be lost during proxy parsing. I always get a \r\n`Tunnel connection failed: 407 Proxy Authentication Required`", "Thanks for confirming @racam and @adamp01. We switched to using urllib3’s parser for proxies because of some recent changes to the standard lib `urlparse` around schemes. It looks like the two differ on their definition of `netloc`. I’m working on a patch to try to get this resolved.", "Thank you for helping debug this @racam and @adamp01 ", "Thanks again everyone, we have the fix merged into `main`. I'm going to wait until tomorrow to release 2.27.1 to see if any other issues are reported. You can follow status of that in #6029." ]
https://api.github.com/repos/psf/requests/issues/6026
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6026/labels{/name}
https://api.github.com/repos/psf/requests/issues/6026/comments
https://api.github.com/repos/psf/requests/issues/6026/events
https://github.com/psf/requests/issues/6026
1,091,897,772
I_kwDOABTKOs5BFQms
6,026
UnicodeDecodeError after following a chain of redirects
{ "avatar_url": "https://avatars.githubusercontent.com/u/1001553?v=4", "events_url": "https://api.github.com/users/wodim/events{/privacy}", "followers_url": "https://api.github.com/users/wodim/followers", "following_url": "https://api.github.com/users/wodim/following{/other_user}", "gists_url": "https://api.github.com/users/wodim/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/wodim", "id": 1001553, "login": "wodim", "node_id": "MDQ6VXNlcjEwMDE1NTM=", "organizations_url": "https://api.github.com/users/wodim/orgs", "received_events_url": "https://api.github.com/users/wodim/received_events", "repos_url": "https://api.github.com/users/wodim/repos", "site_admin": false, "starred_url": "https://api.github.com/users/wodim/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wodim/subscriptions", "type": "User", "url": "https://api.github.com/users/wodim", "user_view_type": "public" }
[]
open
false
null
[]
null
4
2022-01-01T21:42:39Z
2024-09-20T01:27:26Z
null
NONE
null
#6006 Something confuses requests (or urllib3?) along the way Actual Result UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 92: invalid continuation byte Reproduction Steps import requests requests.get("https://www.lavozdegalicia.es/noticia/deportes/2021/12/13/psg-juve-united-nuevos-rivales-espa%C3%B1oles-champions/00031639396272418389372.htm") System Information $ python -m requests.help { "chardet": { "version": "4.0.0" }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "36.0.0" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.8.10" }, "platform": { "release": "4.4.0-17763-Microsoft", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "101010cf", "version": "21.0.0" }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": false, "using_pyopenssl": true } @sigmavirus24 you have been too harsh on this one. Traceback (most recent call last): File "", line 1, in File "C:\Users\Ahmed\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 76, in get return request('get', url, params=params, **kwargs) File "C:\Users\Ahmed\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "C:\Users\Ahmed\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "C:\Users\Ahmed\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 677, in send history = [resp for resp in gen] File "C:\Users\Ahmed\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 677, in history = [resp for resp in gen] File "C:\Users\Ahmed\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 150, in resolve_redirects url = self.get_redirect_target(resp) File "C:\Users\Ahmed\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 116, in get_redirect_target return to_native_string(location, 'utf8') File "C:\Users\Ahmed\AppData\Local\Programs\Python\Python37\lib\site-packages\requests_internal_utils.py", line 25, in to_native_string out = string.decode(encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 92: invalid continuation byte The guilty part there is return to_native_string(location, 'utf8') Trying to decode the URL to native utf8 when it should rather "URL encode" it. I am not an HTTP expert, but this exception should be handled more gracefully anyway. The location given by the remote for redirection is as follow: b'http://www.lavozdegalicia.es/noticia/deportes/2021/12/13/psg-juve-united-nuevos-rivales-espa\xf1oles-champions/00031639396272418389372.htm' Should the \xf1 be decoded as follow %F1 ? I can see that this behavior is already followed by Chrome.
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6026/reactions" }
https://api.github.com/repos/psf/requests/issues/6026/timeline
null
null
null
null
false
[ "Hi @wodim,\r\n\r\nTo actually address your issue, the URI being returned by this redirect is invalid. All byte sequences that aren't listed as `unreserved` or `sub-delim` MUST be percent encoded in the path ([ref](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3)). The website is doing this correctly for other paths, so it appears this is a defect in this specific resource.\r\n\r\nFor Requests, we _may_ be able to be more tolerant of this behavior. Any solution we implement is purely guessing and trying to support broken behavior though, which we typically avoid. We could potentially try to percent-encode this when the `UnicodeDecodeError` is raised. Given this is the first report of the issue in at least the last 5 years, I'm not sure it's a common enough defect to special case.\r\n\r\n", "I'm encountering this error as well for https://www.liveinternet.ru/tags/%EF%F0%E5%E7%E8%E4%E5%ED%F2%FB%2B%D1%D8%C0/ (and various other pages on that site)\r\n\r\nI think a good fix would be to catch the malformed redirect URL (or any similar invalid header) and raise something that inherits from RequestException, rather than raising a UnicodeDecodeError.\r\n", "This is happening to me as well. One source site is now returning those malformed URLs during redirects, and there is now way to bypass it as far as I understand it.", "I have another instance of this issue, which unfortunately I cannot share as its private to my employer. Firefox and Chrome both handle the URL I've encountered cleanly as per the behavior @wodim describes.\r\n\r\nI see that that [the fork niquests) has a bugfix for this issue](https://github.com/jawah/niquests/pull/20; it could be worth borrowing their change. Alternatively a more meaningful exception than UnicodeDecodeError would be useful." ]
https://api.github.com/repos/psf/requests/issues/6025
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6025/labels{/name}
https://api.github.com/repos/psf/requests/issues/6025/comments
https://api.github.com/repos/psf/requests/issues/6025/events
https://github.com/psf/requests/issues/6025
1,091,484,277
I_kwDOABTKOs5BDrp1
6,025
Support for proxy that requires DigestAuth
{ "avatar_url": "https://avatars.githubusercontent.com/u/54762742?v=4", "events_url": "https://api.github.com/users/raffaem/events{/privacy}", "followers_url": "https://api.github.com/users/raffaem/followers", "following_url": "https://api.github.com/users/raffaem/following{/other_user}", "gists_url": "https://api.github.com/users/raffaem/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/raffaem", "id": 54762742, "login": "raffaem", "node_id": "MDQ6VXNlcjU0NzYyNzQy", "organizations_url": "https://api.github.com/users/raffaem/orgs", "received_events_url": "https://api.github.com/users/raffaem/received_events", "repos_url": "https://api.github.com/users/raffaem/repos", "site_admin": false, "starred_url": "https://api.github.com/users/raffaem/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/raffaem/subscriptions", "type": "User", "url": "https://api.github.com/users/raffaem", "user_view_type": "public" }
[]
open
false
null
[]
null
7
2021-12-31T09:01:04Z
2024-08-30T08:42:02Z
null
NONE
null
Requests seems not to have support for proxies which requires DigestAuth, only BasicAuth. In [this SO post](https://stackoverflow.com/a/60031108/1719931) there is an authorization module that implements support for proxies that require DigestAuth, and also allow to connect to HTTPS websites. [requests-toolbet](https://github.com/requests/toolbelt) (I don't know whether it is an official project of requests) has a [HTTPProxyDigestAuth](https://toolbelt.readthedocs.io/en/latest/authentication.html#httpproxydigestauth) class, but doesn't [allow to connect to HTTPS websites](https://github.com/requests/toolbelt/issues/321).
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/6025/reactions" }
https://api.github.com/repos/psf/requests/issues/6025/timeline
null
null
null
null
false
[ "Hi @raffaem,\r\n\r\nCan you try using the `HTTPProxyDigestAuth` class with Requests 2.25.1? There is currently a bug with Requests 2.26.0 with proxy authorization headers. I'm not certain, but I believe this may be related to what you're seeing. We're intending to release Requests 2.27.0 tomorrow which will address this issue.", "> Hi @raffaem,\r\n> \r\n> Can you try using the `HTTPProxyDigestAuth` class with Requests 2.25.1? There is currently a bug with Requests 2.26.0 with proxy authorization headers. I'm not certain, but I believe this may be related to what you're seeing. We're intending to release Requests 2.27.0 tomorrow which will address this issue.\r\n\r\nNada, it fails even with requests 2.25.1\r\n\r\nHere is the code:\r\n```\r\n#!/usr/bin/env python3\r\n\r\nimport requests\r\nfrom requests_toolbelt.auth.http_proxy_digest import HTTPProxyDigestAuth\r\n\r\nprint(\"Requests version=\"+str(requests.__version__))\r\n\r\nproxies = {\r\n \"http\": \"http://proxy.polimi.it:8080\",\r\n \"https\": \"http://proxy.polimi.it:8080\",\r\n}\r\n\r\nauth = HTTPProxyDigestAuth(\"USERNAME\", \"PASSWORD\")\r\n\r\nurl = \"http://verify.proxy.polimi.it\"\r\ns = requests.get(url, proxies=proxies, auth=auth)\r\nprint(s.status_code)\r\n\r\nurl = \"https://dev.elsevier.com\"\r\ns = requests.get(url, proxies=proxies, auth=auth)\r\nprint(s.status_code)\r\n```\r\n\r\nHere is the output:\r\n```\r\n$ ./toolbelt_test.py \r\nRequests version=2.25.1\r\n200\r\nTraceback (most recent call last):\r\n File \"/usr/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 696, in urlopen\r\n self._prepare_proxy(conn)\r\n File \"/usr/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 964, in _prepare_proxy\r\n conn.connect()\r\n File \"/usr/lib/python3.10/site-packages/urllib3/connection.py\", line 366, in connect\r\n self._tunnel()\r\n File \"/usr/lib64/python3.10/http/client.py\", line 924, in _tunnel\r\n raise OSError(f\"Tunnel connection failed: {code} {message.strip()}\")\r\nOSError: Tunnel connection failed: 407 Proxy Authentication Required\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/home/raffaele/.local/lib/python3.10/site-packages/requests/adapters.py\", line 439, in send\r\n resp = conn.urlopen(\r\n File \"/usr/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 755, in urlopen\r\n retries = retries.increment(\r\n File \"/usr/lib/python3.10/site-packages/urllib3/util/retry.py\", line 574, in increment\r\n raise MaxRetryError(_pool, url, error or ResponseError(cause))\r\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='dev.elsevier.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/run/media/raffaele/55ab61c4-83cf-4d9f-a5cd-7fcfdc14b4fb/data/progetti_miei/pybliometrics_test/./toolbelt_test.py\", line 20, in <module>\r\n s = requests.get(url, proxies=proxies, auth=auth)\r\n File \"/home/raffaele/.local/lib/python3.10/site-packages/requests/api.py\", line 76, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/home/raffaele/.local/lib/python3.10/site-packages/requests/api.py\", line 61, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/home/raffaele/.local/lib/python3.10/site-packages/requests/sessions.py\", line 542, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/home/raffaele/.local/lib/python3.10/site-packages/requests/sessions.py\", line 655, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/home/raffaele/.local/lib/python3.10/site-packages/requests/adapters.py\", line 510, in send\r\n raise ProxyError(e, request=request)\r\nrequests.exceptions.ProxyError: HTTPSConnectionPool(host='dev.elsevier.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))\r\n```\r\nWorks fine with the [implementation of Tey' from StackOverflow](https://stackoverflow.com/a/60031108/1719931)", "Thanks for checking @raffaem. Looking at the StackOverflow post, there's some pretty extensive monkey-patching for both Requests, urllib3 and httplib to make this possible. This isn't something we're likely to ever add directly to Requests and I'm doubtful it would even make it into the Requests toolbelt. Unfortunately, I don't see a clean way for us to do this with what's currently exposed from urllib3/httplib.", "Uhm can we work with `urllib3/httplib` for them to expose what we need?\r\n\r\n`HTTPProxyDigestAuth` is less useful if you can't connect to HTTPS websites, as most websites today are HTTPS\r\n", "You can read all of the patching changes made [here](https://gist.github.com/Tey/ded2486da8a69bb84d2dce94e2e09ff7#file-requests_digest_proxy-py-L124-L153), with several of them overriding behavior from the standard library. That would require changes to CPython itself, meaning the earliest this behavior could be available is in 3.11 or 3.12. We'd need someone to drive those changes to expose APIs for urllib3 to do this, or _potentially_ rework how urllib3 interacts with `tunnel` calls. I'm not sure if the latter is even possible at first glance though.\r\n\r\nThat's all going to be an extremely time intensive change though that likely won't be widely available for at least a couple years. The short term solution may be the proposed patch in the StackOverflow question. It's not something we can support or include directly in Requests though.", "`http.client` in Python3.12 has made some modifications to the `HTTPConnection._tunnel()` as seen [here](https://github.com/python/cpython/blob/3.12/Lib/http/client.py#L968-L979). It still raises OSError but preserves header information which can be accessed via `self.get_proxy_response_headers()`.\r\n\r\nDo these changes make it a little bit easier to extract the challenge and re-use it to send the correct header using requests or requests-toolbelt?\r\n\r\nI understand it would require urllib3 to be updated but the change would be much smaller now that headers are accessible to urllib3 when calling `_tunnel()` and failing.\r\n\r\n", "Related request to httpx: https://github.com/encode/httpx/issues/2033" ]
https://api.github.com/repos/psf/requests/issues/6024
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6024/labels{/name}
https://api.github.com/repos/psf/requests/issues/6024/comments
https://api.github.com/repos/psf/requests/issues/6024/events
https://github.com/psf/requests/issues/6024
1,091,270,499
I_kwDOABTKOs5BC3dj
6,024
Requests doesn't add `boundary` when passing `Content-Type: multipart/form-data` header manually
{ "avatar_url": "https://avatars.githubusercontent.com/u/5687998?v=4", "events_url": "https://api.github.com/users/verhovsky/events{/privacy}", "followers_url": "https://api.github.com/users/verhovsky/followers", "following_url": "https://api.github.com/users/verhovsky/following{/other_user}", "gists_url": "https://api.github.com/users/verhovsky/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/verhovsky", "id": 5687998, "login": "verhovsky", "node_id": "MDQ6VXNlcjU2ODc5OTg=", "organizations_url": "https://api.github.com/users/verhovsky/orgs", "received_events_url": "https://api.github.com/users/verhovsky/received_events", "repos_url": "https://api.github.com/users/verhovsky/repos", "site_admin": false, "starred_url": "https://api.github.com/users/verhovsky/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/verhovsky/subscriptions", "type": "User", "url": "https://api.github.com/users/verhovsky", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2021-12-30T19:26:59Z
2022-03-30T22:00:45Z
2021-12-30T21:41:39Z
CONTRIBUTOR
resolved
Requests with `Content-Type: multipart/form-data` need to also have a `; boundary=someUniqueString` in that header. I think this is actually true for all `multipart/*` MIME types. https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#multipartform-data This is how curl works, if you pass `Content-Type: multipart/form-data` it'll still add a boundary because users shouldn't need to know how all the HTTP headers work, that's the library's job. We are running into this issue when trying to convert curl commands into requests code https://github.com/curlconverter/curlconverter/issues/248 and it would be convenient if Requests did the same thing as curl. I don't see why anyone would ever want to pass `Content-Type: multipart/form-data` without a `boundary`, unless they just don't know about it. If you do actually need to not have a boundary you would have to explicitly add an empty one `; boundary=` to your header. But I can also see how it might surprise users that even if they pass a header manually it gets modified. ## Expected Result Requests still adds a `boundary` to my header if I don't, i.e. when I pass `headers={'Content-Type': 'multipart/form-data'}` and `files=` ## Actual Result Requests uses the header as-is and the request fails. ## Reproduction Steps ```pycon >>> import requests >>> >>> files = { ... 'hello': (None, 'world'), ... } >>> requests.post('http://example.com', files=files).request.headers['Content-Type'] 'multipart/form-data; boundary=498931185311c522b8ca559425b2b965' >>> >>> headers = { ... 'Content-Type': 'multipart/form-data', ... } >>> >>> requests.post('http://example.com', headers=headers, files=files).request.headers['Content-Type'] 'multipart/form-data' ``` Compare with curl: ```sh $ curl -vvv example.com -H "Content-Type: multipart/form-data" -F "hello=world" [...] > Content-Type: multipart/form-data; boundary=------------------------ff92aa2ea98d6cc3 ```
{ "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/6024/reactions" }
https://api.github.com/repos/psf/requests/issues/6024/timeline
null
completed
null
null
false
[ "Hi @verhovsky,\r\n\r\nThanks for reaching out. I believe you may be looking for something like the [MultipartEncoder](https://toolbelt.readthedocs.io/en/latest/user.html) which is part of the [Requests Toolbelt](https://github.com/requests/toolbelt) package. We don't provide this directly through Requests and I'm not sure we have intentions to change that currently. That would be our recommendation for what you're currently trying to accomplish.", "In the future, please search **closed and** open issues before creating new ones that are duplicates." ]
https://api.github.com/repos/psf/requests/issues/6023
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6023/labels{/name}
https://api.github.com/repos/psf/requests/issues/6023/comments
https://api.github.com/repos/psf/requests/issues/6023/events
https://github.com/psf/requests/issues/6023
1,090,752,258
I_kwDOABTKOs5BA48C
6,023
Requests: Python 2.7 Support and Deprecation
{ "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
2021-12-29T21:14:52Z
2023-06-10T00:03:20Z
2022-06-09T16:21:31Z
MEMBER
resolved
# Overview As we enter our third year of Python 2.7 reaching end-of-life, Requests has decided it's time to start deprecating our support. While we have yet to confirm a date, we want to provide early notice that this is coming at some point in 2022. This follows as the majority of our critical downstream consumers have finished their deprecation campaigns. While we understand this may be viewed as an inconvenience for those still using Python 2.7, I'll try to layout the steps we're taking to ensure a smooth transition. In January, we will be releasing Requests 2.27.0. This is intended to be the last minor release with guaranteed support, including all 2.27.x hotfix releases. We've taken steps to ensure this release series includes fixes for some of the longer standing pain points and provide as much long term stability as we're able. Users who intend to continue Python 2.7 use should review the `Mitigation Steps` section of this issue. Going forward, we're still working through what a Python 3-only Requests looks like. We'd like to preface now that it's unlikely to contain many of the more exciting features that may have previously been promised by former maintainers. In future releases, we'll look to add quality-of-life improvements as they make sense while maintaining the primary focus of stability in the library. We'll provide more on that as information is available. # Mitigation Steps For Requests users that intend to remain on Python 2.7 through 2022, we recommend taking the following mitigation steps. 1. For users of `pip` 9.0+, we'll also be releasing an update to the `python_requires` metadata to `>=3.7` in Requests. This will prevent unintended installation on unsupported Python versions. 2. For users who want to codify this requirement across all environments, ensure that you've explicitly pinned Requests in your workspace or project to `requests<2.28`. This will prevent unintended interruptions with future releases. 3. For users of LTS operating systems providing Python 2.7 support through 2023, you'll need to work with their support teams for bug or security issues for any releases after 2.27.
{ "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": 6, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 8, "laugh": 0, "rocket": 0, "total_count": 14, "url": "https://api.github.com/repos/psf/requests/issues/6023/reactions" }
https://api.github.com/repos/psf/requests/issues/6023/timeline
null
completed
null
null
false
[ "It's good to hear that requests decided to drop Python 2.7. I would propose to release version 3 without much refactoring but mainly dropping Python 2.7 compatibility, so that Python 3 users can benefit from less dependency and less code to run. Then we can do refactors or non-breaking changes in minor releases. Also it's possible to have another major release with more breaking changes. Otherwise it'll take much longer to drop Python 2.7 and do refactoring at the same time.", "I wanted to provide a quick update on timelines. We're currently targeting May for the next release barring any unforeseen circumstances. That will be a minor release (2.28.0) with minimal functional changes but will likely be breaking for Python 2.7 users. We'd advise making sure you have appropriate pinning/`pip` versions supporting `python_requires` prior to then.", "Resolving now that we have 2.28.0 out the door." ]
https://api.github.com/repos/psf/requests/issues/6022
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6022/labels{/name}
https://api.github.com/repos/psf/requests/issues/6022/comments
https://api.github.com/repos/psf/requests/issues/6022/events
https://github.com/psf/requests/pull/6022
1,090,698,993
PR_kwDOABTKOs4wYIyg
6,022
General cleanup for 2.27.0
{ "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
2021-12-29T19:02:13Z
2022-03-29T23:00:27Z
2021-12-29T22:29:09Z
MEMBER
resolved
* Cleaning up incorrect example in README * Updating usage info * Updating verbiage for Python 2 support * Adding better trove classifiers for the 2.27.0 release
{ "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/6022/reactions" }
https://api.github.com/repos/psf/requests/issues/6022/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6022.diff", "html_url": "https://github.com/psf/requests/pull/6022", "merged_at": "2021-12-29T22:29:09Z", "patch_url": "https://github.com/psf/requests/pull/6022.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6022" }
true
[]
https://api.github.com/repos/psf/requests/issues/6021
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6021/labels{/name}
https://api.github.com/repos/psf/requests/issues/6021/comments
https://api.github.com/repos/psf/requests/issues/6021/events
https://github.com/psf/requests/issues/6021
1,090,517,580
I_kwDOABTKOs5A__pM
6,021
CVE-2021-33503: bump up urllib3 version
{ "avatar_url": "https://avatars.githubusercontent.com/u/59473525?v=4", "events_url": "https://api.github.com/users/laurentdelosieresmano/events{/privacy}", "followers_url": "https://api.github.com/users/laurentdelosieresmano/followers", "following_url": "https://api.github.com/users/laurentdelosieresmano/following{/other_user}", "gists_url": "https://api.github.com/users/laurentdelosieresmano/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/laurentdelosieresmano", "id": 59473525, "login": "laurentdelosieresmano", "node_id": "MDQ6VXNlcjU5NDczNTI1", "organizations_url": "https://api.github.com/users/laurentdelosieresmano/orgs", "received_events_url": "https://api.github.com/users/laurentdelosieresmano/received_events", "repos_url": "https://api.github.com/users/laurentdelosieresmano/repos", "site_admin": false, "starred_url": "https://api.github.com/users/laurentdelosieresmano/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/laurentdelosieresmano/subscriptions", "type": "User", "url": "https://api.github.com/users/laurentdelosieresmano", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2021-12-29T13:21:44Z
2022-03-29T14:06:03Z
2021-12-29T13:29:40Z
NONE
resolved
| Severity | High | | Identifier | CVE-2021-33503 | | URL | https://nvd.nist.gov/vuln/detail/CVE-2021-33503 | | Scanner | gemnasium | | Message | Uncontrolled Resource Consumption in urllib3 | | Package | urllib3 1.25.11 | | Solution | Upgrade to version 1.26.5 or above. | | Path | requests 2.26.0 > urllib3 1.25.11 | | File | pipdeptree.json
{ "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/6021/reactions" }
https://api.github.com/repos/psf/requests/issues/6021/timeline
null
completed
null
null
false
[ "https://github.com/psf/requests/blob/d09659997cd1e3eca49a07c59ece5557071c0ab9/setup.py#L48 \r\n\r\nThis allows users to upgrade to 1.26.5 if they wish. We aren't restricting users from installing this" ]
https://api.github.com/repos/psf/requests/issues/6020
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6020/labels{/name}
https://api.github.com/repos/psf/requests/issues/6020/comments
https://api.github.com/repos/psf/requests/issues/6020/events
https://github.com/psf/requests/pull/6020
1,090,281,503
PR_kwDOABTKOs4wWxXP
6,020
Update 3.10-dev to 3.10 and add pypy-3.7 in CI
{ "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
2021-12-29T05:36:12Z
2022-03-29T16:01:45Z
2021-12-29T13:32:11Z
MEMBER
resolved
Updating `3.10-dev` to `3.10` in our CI and adding support for `pypy-3.7` since we're likely to be dropping `pypy3` support soon.
{ "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/6020/reactions" }
https://api.github.com/repos/psf/requests/issues/6020/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6020.diff", "html_url": "https://github.com/psf/requests/pull/6020", "merged_at": "2021-12-29T13:32:11Z", "patch_url": "https://github.com/psf/requests/pull/6020.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6020" }
true
[]
https://api.github.com/repos/psf/requests/issues/6019
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6019/labels{/name}
https://api.github.com/repos/psf/requests/issues/6019/comments
https://api.github.com/repos/psf/requests/issues/6019/events
https://github.com/psf/requests/pull/6019
1,090,268,792
PR_kwDOABTKOs4wWuwU
6,019
v2.27.0
{ "avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4", "events_url": "https://api.github.com/users/nateprewitt/events{/privacy}", "followers_url": "https://api.github.com/users/nateprewitt/followers", "following_url": "https://api.github.com/users/nateprewitt/following{/other_user}", "gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/nateprewitt", "id": 5271761, "login": "nateprewitt", "node_id": "MDQ6VXNlcjUyNzE3NjE=", "organizations_url": "https://api.github.com/users/nateprewitt/orgs", "received_events_url": "https://api.github.com/users/nateprewitt/received_events", "repos_url": "https://api.github.com/users/nateprewitt/repos", "site_admin": false, "starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions", "type": "User", "url": "https://api.github.com/users/nateprewitt", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2021-12-29T04:55:15Z
2022-04-03T15:00:31Z
2022-01-03T14:59:11Z
MEMBER
resolved
2.27.0 (2022-01-03) ------------------- **Improvements** - Officially added support for Python 3.10. (#5928) - Added a `requests.exceptions.JSONDecodeError` to unify JSON exceptions between Python 2 and 3. This gets raised in the `response.json()` method, and is backwards compatible as it inherits from previously thrown exceptions. Can be caught from `requests.exceptions.RequestException` as well. (#5856) - Improved error text for misnamed `InvalidSchema` and `MissingSchema` exceptions. This is a temporary fix until exceptions can be renamed (Schema->Scheme). (#6017) - Improved proxy parsing for proxy URLs missing a scheme. This will address recent changes to `urlparse` in Python 3.9+. (#5917) **Bugfixes** - Fixed defect in `extract_zipped_paths` which could result in an infinite loop for some paths. (#5851) - Fixed handling for `AttributeError` when calculating length of files obtained by `Tarfile.extractfile()`. (#5239) - Fixed urllib3 exception leak, wrapping `urllib3.exceptions.InvalidHeader` with `requests.exceptions.InvalidHeader`. (#5914) - Fixed bug where two Host headers were sent for chunked requests. (#5391) - Fixed regression in Requests 2.26.0 where `Proxy-Authorization` was incorrectly stripped from all requests sent with `Session.send`. (#5924) - Fixed performance regression in 2.26.0 for hosts with a large number of proxies available in the environment. (#5924) - Fixed idna exception leak, wrapping `UnicodeError` with `requests.exceptions.InvalidURL` for URLs with a leading dot (.) in the domain. (#5414) **Deprecations** - Requests support for Python 2.7 and 3.6 will be ending in 2022. While we don't have exact dates, Requests 2.27.x is likely to be the last release series providing support.
{ "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/6019/reactions" }
https://api.github.com/repos/psf/requests/issues/6019/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6019.diff", "html_url": "https://github.com/psf/requests/pull/6019", "merged_at": "2022-01-03T14:59:11Z", "patch_url": "https://github.com/psf/requests/pull/6019.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6019" }
true
[ "Currently pending #5894 and #5917.", "Alright, things should be finalized for release notes. I'll move it out of draft for approval but let's wait to merge. I'll do that with the release and tagging process." ]
https://api.github.com/repos/psf/requests/issues/6018
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6018/labels{/name}
https://api.github.com/repos/psf/requests/issues/6018/comments
https://api.github.com/repos/psf/requests/issues/6018/events
https://github.com/psf/requests/pull/6018
1,090,207,168
PR_kwDOABTKOs4wWiia
6,018
Update basic auth example
{ "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
{ "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" }
[ { "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" }, { "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" } ]
null
0
2021-12-29T01:09:40Z
2022-03-29T02:29:07Z
2021-12-29T01:38:35Z
MEMBER
resolved
This PR updates the basic auth examples to use httpbin after issue raised in #6016. Github no longer supports basic auth making the existing examples confusing.
{ "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/6018/reactions" }
https://api.github.com/repos/psf/requests/issues/6018/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6018.diff", "html_url": "https://github.com/psf/requests/pull/6018", "merged_at": "2021-12-29T01:38:35Z", "patch_url": "https://github.com/psf/requests/pull/6018.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6018" }
true
[]
https://api.github.com/repos/psf/requests/issues/6017
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6017/labels{/name}
https://api.github.com/repos/psf/requests/issues/6017/comments
https://api.github.com/repos/psf/requests/issues/6017/events
https://github.com/psf/requests/pull/6017
1,090,199,260
PR_kwDOABTKOs4wWg4Y
6,017
Fix erroneous use of 'schema' instead of 'scheme'
{ "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
2021-12-29T00:46:24Z
2022-03-29T02:29:07Z
2021-12-29T01:39:08Z
MEMBER
resolved
This PR closes #5984 by fixing the error message text for the incorrectly name `*Schema` exceptions. This is a temporary fix to minimize confusion until a time where the exceptions themselves can be renamed. Also removed defunct reference to the old `defaults.py` module in one of the exceptions.
{ "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/6017/reactions" }
https://api.github.com/repos/psf/requests/issues/6017/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6017.diff", "html_url": "https://github.com/psf/requests/pull/6017", "merged_at": "2021-12-29T01:39:08Z", "patch_url": "https://github.com/psf/requests/pull/6017.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6017" }
true
[]
https://api.github.com/repos/psf/requests/issues/6016
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6016/labels{/name}
https://api.github.com/repos/psf/requests/issues/6016/comments
https://api.github.com/repos/psf/requests/issues/6016/events
https://github.com/psf/requests/issues/6016
1,089,603,528
I_kwDOABTKOs5A8gfI
6,016
Auth is rarely working for anything
{ "avatar_url": "https://avatars.githubusercontent.com/u/26269897?v=4", "events_url": "https://api.github.com/users/108806/events{/privacy}", "followers_url": "https://api.github.com/users/108806/followers", "following_url": "https://api.github.com/users/108806/following{/other_user}", "gists_url": "https://api.github.com/users/108806/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/108806", "id": 26269897, "login": "108806", "node_id": "MDQ6VXNlcjI2MjY5ODk3", "organizations_url": "https://api.github.com/users/108806/orgs", "received_events_url": "https://api.github.com/users/108806/received_events", "repos_url": "https://api.github.com/users/108806/repos", "site_admin": false, "starred_url": "https://api.github.com/users/108806/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/108806/subscriptions", "type": "User", "url": "https://api.github.com/users/108806", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2021-12-28T04:28:44Z
2021-12-29T01:10:15Z
2021-12-29T00:58:11Z
NONE
resolved
I find this module pretty much useless as for its auth: ``` # Even the example from the docs is not working: In [36]: requests.get('https://api.github.com/user', auth=('108806', 'my_password')) Out[36]: <Response [401]> In [37]: with requests.Session() as sess: ...: print ( requests.get('https://api.github.com/user', auth=('108806', 'my_password')).status_code ) Out[37]: <Response [401]> ``` Also, a lot of websites are returning 200 on everything, so how can I know if I'm logged or not? Idk, checking cookies? Some sites are working without any, with ie JWT. But even with the simplest scenario this module can't log me in when I pass the correct credentials on 9/10 of websites.
{ "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/6016/reactions" }
https://api.github.com/repos/psf/requests/issues/6016/timeline
null
completed
null
null
false
[ "Hi @108806, thanks for the feedback. It sounds like there may be some misunderstandings about how authentication works in the HTTP protocol. You'll find Github [hasn't supported Basic Auth](https://developer.github.com/changes/2020-02-14-deprecating-password-auth/) for almost 2 years, which is the behavior you're observing.\r\n\r\nWe'd recommend doing some reading on how HTTP auth works and directing further questions to StackOverflow. We won't be able to provide support for that on this issue tracker.", "I've added #6018 to remove the current ambiguity in the documentation." ]
https://api.github.com/repos/psf/requests/issues/6015
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6015/labels{/name}
https://api.github.com/repos/psf/requests/issues/6015/comments
https://api.github.com/repos/psf/requests/issues/6015/events
https://github.com/psf/requests/issues/6015
1,089,176,381
I_kwDOABTKOs5A64M9
6,015
Possible issue with proxies and TLS versions when using a session.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1909717?v=4", "events_url": "https://api.github.com/users/defunes43/events{/privacy}", "followers_url": "https://api.github.com/users/defunes43/followers", "following_url": "https://api.github.com/users/defunes43/following{/other_user}", "gists_url": "https://api.github.com/users/defunes43/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/defunes43", "id": 1909717, "login": "defunes43", "node_id": "MDQ6VXNlcjE5MDk3MTc=", "organizations_url": "https://api.github.com/users/defunes43/orgs", "received_events_url": "https://api.github.com/users/defunes43/received_events", "repos_url": "https://api.github.com/users/defunes43/repos", "site_admin": false, "starred_url": "https://api.github.com/users/defunes43/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/defunes43/subscriptions", "type": "User", "url": "https://api.github.com/users/defunes43", "user_view_type": "public" }
[]
open
false
null
[]
null
3
2021-12-27T11:27:52Z
2024-05-24T21:23:59Z
null
NONE
null
Using a session or a request object with the same parameters should yield the same results. When a proxy is used, and when the target website supports TLS 1.0 and TLS 1.1 (or does not support TLS 1.3, I could not figure it out), a request object works fine, whereas a session throws a SSL Error. ## Expected Result ```python import requests proxies = { 'http': 'http://127.0.0.1:8888', 'https': 'http://127.0.0.1:8888', } requests.get('https://sidep.gouv.fr/', proxies=proxies) session = requests.Session() session.proxies.update(proxies) session.get('https://sidep.gouv.fr/') ``` The two ways to get the data should yield the same result. ## Actual Result The request works, but not with the session: ``` HTTPSConnectionPool(host='sidep.gouv.fr', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)'))) Traceback (most recent call last): File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen self._prepare_proxy(conn) File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy conn.connect() File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connection.py", line 364, in connect conn = self._connect_tls_proxy(hostname, conn) File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connection.py", line 501, in _connect_tls_proxy socket = ssl_wrap_socket( File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls) File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock) File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 512, in wrap_socket return self.sslsocket_class._create( File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1070, in _create self.do_handshake() File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1341, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen retries = retries.increment( File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='sidep.gouv.fr', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)'))) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "c:\Users\Max\.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module> cli.main() File "c:\Users\Max\.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main run() File "c:\Users\Max\.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 285, in run_file runpy.run_path(target_as_str, run_name=compat.force_str("__main__")) File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 269, in run_path return _run_module_code(code, init_globals, run_name, File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "c:\Users\Max\testssl.py", line 16, in <module> raise e File "c:\Users\Max\testssl.py", line 13, in <module> session.get('https://sidep.gouv.fr/') File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 555, in get return self.request('GET', url, **kwargs) File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 514, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='sidep.gouv.fr', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)'))) ``` When using a TLS 1.3 enabled (which seem to mean TLS 1.0 and 1.1 disabled) website, both versions work, for example: ```python import requests proxies = { 'http': 'http://127.0.0.1:8888', 'https': 'http://127.0.0.1:8888', } requests.get('https://example.com/', proxies=proxies) session = requests.Session() session.proxies.update(proxies) session.verify = False session.get('https://example.com/') ``` Without the proxy, it works fine for both websites. I spend a couple hours trying with many websites to figure out the breaking cause, and I believe it is the TLS version. ## System Information ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.1" }, "platform": { "release": "10", "system": "Windows" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "101010cf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "using_pyopenssl": false } ```
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/6015/reactions" }
https://api.github.com/repos/psf/requests/issues/6015/timeline
null
null
null
null
false
[ "Update: by analogy with https://github.com/psf/requests/issues/5943, downgrading to urllib 1.25.11 makes it work in all cases.", "I'm facing this same issue. Despite being used as the [example in the proxies documentation](https://requests.readthedocs.io/en/latest/user/advanced/#proxies), using a URL with `http://` scheme prefix with the `https` key in the proxies dictionary results in a `requests.exceptions.SSLError`, or worse, seems to hang indefinitely in CI.\r\n\r\nSimple example to help repro:\r\n\r\n```python3\r\nimport requests\r\n\r\nproxies = {\r\n \"https\": \"http://myproxy:port\",\r\n \"http\": \"http://myproxy:port\",\r\n}\r\nrequests.get(some_url, proxies=proxies, verify=False)\r\n```\r\n\r\nnever connects to the proxy. There also don't seem to be any test cases for this, which is perhaps why it wasn't caught before now.\r\n\r\nEdit: Seeing this with requests-2.32.2, urllib3-2.2.1. Pinning urllib3 to 1.25.11 does seem to resolve this, will open or update an issue there.", "On investigating a bit closer, it seems that perhaps the thrown exception is expected behavior in more recent versions of `urllib3`: https://github.com/urllib3/urllib3/pull/2613. So at the least, the `requests` documentation should be updated, but it would be great if there were a fix to this regression in terms of what users expect from `requests`." ]
https://api.github.com/repos/psf/requests/issues/6014
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6014/labels{/name}
https://api.github.com/repos/psf/requests/issues/6014/comments
https://api.github.com/repos/psf/requests/issues/6014/events
https://github.com/psf/requests/issues/6014
1,088,442,567
I_kwDOABTKOs5A4FDH
6,014
requests 2.26.0 is forbidding NaN values in JSON
{ "avatar_url": "https://avatars.githubusercontent.com/u/31816591?v=4", "events_url": "https://api.github.com/users/micdestefano/events{/privacy}", "followers_url": "https://api.github.com/users/micdestefano/followers", "following_url": "https://api.github.com/users/micdestefano/following{/other_user}", "gists_url": "https://api.github.com/users/micdestefano/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/micdestefano", "id": 31816591, "login": "micdestefano", "node_id": "MDQ6VXNlcjMxODE2NTkx", "organizations_url": "https://api.github.com/users/micdestefano/orgs", "received_events_url": "https://api.github.com/users/micdestefano/received_events", "repos_url": "https://api.github.com/users/micdestefano/repos", "site_admin": false, "starred_url": "https://api.github.com/users/micdestefano/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/micdestefano/subscriptions", "type": "User", "url": "https://api.github.com/users/micdestefano", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2021-12-24T16:14:46Z
2023-03-15T00:03:08Z
2021-12-25T13:58:44Z
NONE
resolved
It is not possible to send NaNs (and I suppose also Infinity) double values through JSON. The cause is in file https://github.com/psf/requests/blob/main/requests/models.py, where, at line 473, you have `allow_nan=False`. Please restore the previous behavior, because it is now impossible for me to pass NaNs to computational microservices that need NaNs to mark not recorded values. Setting `allow_nan=True` fixes the issue. If this is not possible, at least allow the user to specify this flag from request calls. Thanks. Best regards. ## Expected Result It should be possible to pass NaNs (and +/- Infinity) as numeric floating point values. ## Actual Result An exception is raised every time I have a NaN into a floating point value. ## Reproduction Steps ```python import requests import numpy as np input_dict = { 'value': np.nan } endpoint = 'whatever is your endpoint' requests.post(endpoint,json=input_dict) ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.6" }, "cryptography": { "version": "2.8" }, "idna": { "version": "2.8" }, "implementation": { "name": "CPython", "version": "3.8.10" }, "platform": { "release": "5.11.0-43-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "1010106f", "version": "19.0.0" }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": false, "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": 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/6014/reactions" }
https://api.github.com/repos/psf/requests/issues/6014/timeline
null
completed
null
null
false
[ "99.9% of people don't need or want `NaN` and those that do can serialize the data themselves, e.g.,\r\n\r\n```py\r\nimport json\r\n\r\nimport requests\r\nimport numpy as np\r\n\r\ninput_dict = { 'value': np.nan }\r\nendpoint = 'whatever is your endpoint'\r\n\r\nrequests.post(endpoint,data=json.dumps(input_dict), headers={\"Content-Type\": \"application/json\"})\r\n```\r\n", "@sigmavirus24 it's often times not in our control as to whether a `NaN` or an `inf` can be transformed to something else.\r\n\r\nIn addition, I think this is a regression between 2.25.1 and the newer versions. The `requests` package supported `NaN` and `inf` in 2.25.1 and moving to 2.26.0+ is causing brokenness. So, exposing a knob to help users who were dependent on that behavior is reasonable? Thoughts?\r\n", "I've expressed my thoughts. Further, requests is in feature freeze and the tiniest but if looking into past similar issues shows a consistent attitude - if you don't like how requests encodes your request data in any given format, the are documented ways to do it yourself. Knobs will not be added" ]
https://api.github.com/repos/psf/requests/issues/6013
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6013/labels{/name}
https://api.github.com/repos/psf/requests/issues/6013/comments
https://api.github.com/repos/psf/requests/issues/6013/events
https://github.com/psf/requests/issues/6013
1,086,042,406
I_kwDOABTKOs5Au7Em
6,013
AttributeError: module 'collections' has no attribute 'MutableMapping'
{ "avatar_url": "https://avatars.githubusercontent.com/u/155669?v=4", "events_url": "https://api.github.com/users/unjello/events{/privacy}", "followers_url": "https://api.github.com/users/unjello/followers", "following_url": "https://api.github.com/users/unjello/following{/other_user}", "gists_url": "https://api.github.com/users/unjello/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/unjello", "id": 155669, "login": "unjello", "node_id": "MDQ6VXNlcjE1NTY2OQ==", "organizations_url": "https://api.github.com/users/unjello/orgs", "received_events_url": "https://api.github.com/users/unjello/received_events", "repos_url": "https://api.github.com/users/unjello/repos", "site_admin": false, "starred_url": "https://api.github.com/users/unjello/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/unjello/subscriptions", "type": "User", "url": "https://api.github.com/users/unjello", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2021-12-21T17:08:31Z
2022-03-21T18:00:36Z
2021-12-21T17:13:30Z
NONE
resolved
Requests cannot be installed under Python 3.10. Python 3.10 removed importing abc from collections directly. ## Expected Result Successful `pip install requests` ## Actual Result ``` File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/cookies.py", line 172, in <module> class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping): AttributeError: module 'collections' has no attribute 'MutableMapping' ``` ## Reproduction Steps ```sh pip install requests ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.10.0" }, "platform": { "release": "5.10.60.1-microsoft-standard-WSL2", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "1010106f" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "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/6013/reactions" }
https://api.github.com/repos/psf/requests/issues/6013/timeline
null
completed
null
null
false
[ "Hi @unjello, this is not an issue with Requests. As you can see from the provided stacktrace, this is an old copy of requests vendored in `pipenv`. You'll need to either upgrade your version of `pipenv` to one that supports Python 3.10 or file a ticket in the [pypa/pipenv](https://github.com/pypa/pipenv) repo to get support.", "Hey, sorry for the alarm. You're absolutely right. I have for some reason changed manually installed `pipenv` to `apt` installed one, which happened to be (surprise, surprise) old. I haven't connect the dots so I thought it was requests fault when I tried to install it in a new project :)" ]
https://api.github.com/repos/psf/requests/issues/6012
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6012/labels{/name}
https://api.github.com/repos/psf/requests/issues/6012/comments
https://api.github.com/repos/psf/requests/issues/6012/events
https://github.com/psf/requests/pull/6012
1,084,290,556
PR_kwDOABTKOs4wDd5R
6,012
Update the `ok` property
{ "avatar_url": "https://avatars.githubusercontent.com/u/83519535?v=4", "events_url": "https://api.github.com/users/Chrovo/events{/privacy}", "followers_url": "https://api.github.com/users/Chrovo/followers", "following_url": "https://api.github.com/users/Chrovo/following{/other_user}", "gists_url": "https://api.github.com/users/Chrovo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Chrovo", "id": 83519535, "login": "Chrovo", "node_id": "MDQ6VXNlcjgzNTE5NTM1", "organizations_url": "https://api.github.com/users/Chrovo/orgs", "received_events_url": "https://api.github.com/users/Chrovo/received_events", "repos_url": "https://api.github.com/users/Chrovo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Chrovo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Chrovo/subscriptions", "type": "User", "url": "https://api.github.com/users/Chrovo", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2021-12-20T02:30:12Z
2022-03-20T22:00:27Z
2021-12-20T14:43:41Z
NONE
resolved
Simplifying the code, I'm not sure if there was a specific reason for this design but my implementation should perform the same thing unless I'm misunderstanding.
{ "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/6012/reactions" }
https://api.github.com/repos/psf/requests/issues/6012/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6012.diff", "html_url": "https://github.com/psf/requests/pull/6012", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6012.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6012" }
true
[ "This allows folks to define their own response subclass that defines it's own raise_for_status and get an ok that conforms with that for free" ]
https://api.github.com/repos/psf/requests/issues/6011
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6011/labels{/name}
https://api.github.com/repos/psf/requests/issues/6011/comments
https://api.github.com/repos/psf/requests/issues/6011/events
https://github.com/psf/requests/pull/6011
1,084,224,473
PR_kwDOABTKOs4wDQLe
6,011
Add success attribute for Response objects
{ "avatar_url": "https://avatars.githubusercontent.com/u/83519535?v=4", "events_url": "https://api.github.com/users/Chrovo/events{/privacy}", "followers_url": "https://api.github.com/users/Chrovo/followers", "following_url": "https://api.github.com/users/Chrovo/following{/other_user}", "gists_url": "https://api.github.com/users/Chrovo/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Chrovo", "id": 83519535, "login": "Chrovo", "node_id": "MDQ6VXNlcjgzNTE5NTM1", "organizations_url": "https://api.github.com/users/Chrovo/orgs", "received_events_url": "https://api.github.com/users/Chrovo/received_events", "repos_url": "https://api.github.com/users/Chrovo/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Chrovo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Chrovo/subscriptions", "type": "User", "url": "https://api.github.com/users/Chrovo", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2021-12-19T23:50:36Z
2022-03-20T01:27:13Z
2021-12-20T01:12:30Z
NONE
resolved
Add an attribute that returns True when a status code is a success status code(in between 200 and 299 inclusive).
{ "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/6011/reactions" }
https://api.github.com/repos/psf/requests/issues/6011/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/6011.diff", "html_url": "https://github.com/psf/requests/pull/6011", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/6011.patch", "url": "https://api.github.com/repos/psf/requests/pulls/6011" }
true
[ "Thanks for opening. I think we're going to decline this PR unfortunately. If users want to make decisions based on the status code they should write this logic themselves instead of using a property that requires future readers to learn its implementation. Explicit is better than implicit!" ]
https://api.github.com/repos/psf/requests/issues/6010
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6010/labels{/name}
https://api.github.com/repos/psf/requests/issues/6010/comments
https://api.github.com/repos/psf/requests/issues/6010/events
https://github.com/psf/requests/issues/6010
1,083,859,610
I_kwDOABTKOs5AmmKa
6,010
Unexpected requests.exceptions.ConnectionError
{ "avatar_url": "https://avatars.githubusercontent.com/u/75941562?v=4", "events_url": "https://api.github.com/users/yxzlwz/events{/privacy}", "followers_url": "https://api.github.com/users/yxzlwz/followers", "following_url": "https://api.github.com/users/yxzlwz/following{/other_user}", "gists_url": "https://api.github.com/users/yxzlwz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yxzlwz", "id": 75941562, "login": "yxzlwz", "node_id": "MDQ6VXNlcjc1OTQxNTYy", "organizations_url": "https://api.github.com/users/yxzlwz/orgs", "received_events_url": "https://api.github.com/users/yxzlwz/received_events", "repos_url": "https://api.github.com/users/yxzlwz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yxzlwz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yxzlwz/subscriptions", "type": "User", "url": "https://api.github.com/users/yxzlwz", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2021-12-18T15:52:39Z
2022-03-18T19:00:24Z
2021-12-18T18:47:23Z
NONE
resolved
I was trying to run this code: ```python3 import requests r = requests.get("https://upos-sz-mirrorkodo.bilivideoo1.com/") ``` But a BIG ERROR has raised. ```text Traceback (most recent call last): File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connection.py", line 169, in _new_conn conn = connection.create_connection( File "E:\Programming\Python\VSC\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "C:\Users\王子涵\AppData\Local\Programs\Python\Python38\lib\socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11001] getaddrinfo failed During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn conn.connect() File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connection.py", line 353, in connect conn = self._new_conn() File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connection.py", line 181, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000026E92F17F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Programming\Python\VSC\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen retries = retries.increment( File "E:\Programming\Python\VSC\lib\site-packages\urllib3\util\retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='upos-sz-mirrorkodo.bilivideoo1.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000026E92F17F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "e:\Desktop\1.py", line 48, in <module> r = get( File "E:\Programming\Python\VSC\lib\site-packages\requests\api.py", line 76, in get return request('get', url, params=params, **kwargs) File "E:\Programming\Python\VSC\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "E:\Programming\Python\VSC\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "E:\Programming\Python\VSC\lib\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "E:\Programming\Python\VSC\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='upos-sz-mirrorkodo.bilivideoo1.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000026E92F17F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')) ``` I tried to ping this host but failed, and Google didn't give useful advice, could you please tell me why and how to deal with it? Thanks a lot.
{ "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/6010/reactions" }
https://api.github.com/repos/psf/requests/issues/6010/timeline
null
completed
null
null
false
[ "This host is simply unreachable. It's not `requests` issue", "To be honest, I know it, but why not? Even Windows doesn't recognize it(raise error when I ping it).\r\nAnd it can be visit with browser.", "It cannot be visited via browser, at least on my computer" ]
https://api.github.com/repos/psf/requests/issues/6009
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6009/labels{/name}
https://api.github.com/repos/psf/requests/issues/6009/comments
https://api.github.com/repos/psf/requests/issues/6009/events
https://github.com/psf/requests/issues/6009
1,083,024,009
I_kwDOABTKOs5AjaKJ
6,009
Extraordinarily slow performance on Mac
{ "avatar_url": "https://avatars.githubusercontent.com/u/471296?v=4", "events_url": "https://api.github.com/users/igordertigor/events{/privacy}", "followers_url": "https://api.github.com/users/igordertigor/followers", "following_url": "https://api.github.com/users/igordertigor/following{/other_user}", "gists_url": "https://api.github.com/users/igordertigor/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/igordertigor", "id": 471296, "login": "igordertigor", "node_id": "MDQ6VXNlcjQ3MTI5Ng==", "organizations_url": "https://api.github.com/users/igordertigor/orgs", "received_events_url": "https://api.github.com/users/igordertigor/received_events", "repos_url": "https://api.github.com/users/igordertigor/repos", "site_admin": false, "starred_url": "https://api.github.com/users/igordertigor/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/igordertigor/subscriptions", "type": "User", "url": "https://api.github.com/users/igordertigor", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2021-12-17T08:51:45Z
2022-03-17T16:05:31Z
2021-12-17T13:14:58Z
NONE
resolved
I'm trying to fetch a website using requests. While this is fast (<200ms) on Linux, it takes very long on my Macbook Air (>1min). Importantly, this does not appear to be the general networking capabilities of the two machines, because cURL is roughly equally fast. ## Expected Result I would expect both systems to be equally fast and in both cases to be similarly fast as cURL. ## Actual Result As explained above, requests is much slower on Mac than on Linux and also much slower than the equivalent request using cURL. ## Reproduction Steps ```python import requests import subprocess import time url = 'https://en.wikipedia.org/wiki/Kalman_filter' t0 = time.time() r = requests.get(url) t1 = time.time() subprocess.check_output(['curl', url]) t2 = time.time() print('Requests:', t1-t0) print('cURL:', t2-t1) ``` On Linux, the output is: ``` Requests: 0.1399681568145752 cURL: 0.1920619010925293 ``` On Mac, the output is: ``` Requests: 75.28015923500061 cURL: 0.5037477016448975 ``` ## System Information $ python -m requests.help On Linux (Ubuntu 20.04, running in virtual environment): ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.8.5" }, "platform": { "release": "5.11.0-40-generic", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "101010bf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "using_pyopenssl": false } ``` On Mac (Big Sur, M1 silicon, running in virtual environment): ```json { "chardet": { "version": null }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.9.8" }, "platform": { "release": "20.6.0", "system": "Darwin" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "101010bf" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": true, "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/6009/reactions" }
https://api.github.com/repos/psf/requests/issues/6009/timeline
null
completed
null
null
false
[ "I don't have the same problem on any of the macOS machines I have access to. It works seem something else is up with your specific environment on that computer. " ]
https://api.github.com/repos/psf/requests/issues/6008
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/6008/labels{/name}
https://api.github.com/repos/psf/requests/issues/6008/comments
https://api.github.com/repos/psf/requests/issues/6008/events
https://github.com/psf/requests/issues/6008
1,082,739,182
I_kwDOABTKOs5AiUnu
6,008
Unicode surrogates in POST data lead to exception
{ "avatar_url": "https://avatars.githubusercontent.com/u/1506734?v=4", "events_url": "https://api.github.com/users/pcworld/events{/privacy}", "followers_url": "https://api.github.com/users/pcworld/followers", "following_url": "https://api.github.com/users/pcworld/following{/other_user}", "gists_url": "https://api.github.com/users/pcworld/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/pcworld", "id": 1506734, "login": "pcworld", "node_id": "MDQ6VXNlcjE1MDY3MzQ=", "organizations_url": "https://api.github.com/users/pcworld/orgs", "received_events_url": "https://api.github.com/users/pcworld/received_events", "repos_url": "https://api.github.com/users/pcworld/repos", "site_admin": false, "starred_url": "https://api.github.com/users/pcworld/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pcworld/subscriptions", "type": "User", "url": "https://api.github.com/users/pcworld", "user_view_type": "public" }
[]
open
false
null
[]
null
0
2021-12-16T23:50:15Z
2021-12-17T02:21:58Z
null
NONE
null
<!-- Summary. --> In requests 2.26.0 with Python 3, when passing unicode strings with surrogate characters as POST data (either directly as a `str` or as part of a `dict`), sending the request throws an exception. ## Expected Result The library should not throw an exception, even when fed with unvalidated user input. <!-- What you expected. --> ## Actual Result / Reproduction Steps ``` >>> import requests >>> requests.__version__ '2.26.0' >>> requests.post('https://example.invalid', data={'name': 'test\udced\udcb3\udc83.pdf'}) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/.local/lib/python3.7/site-packages/requests/api.py", line 117, in post return request('post', url, data=data, json=json, **kwargs) File "/home/user/.local/lib/python3.7/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/home/user/.local/lib/python3.7/site-packages/requests/sessions.py", line 528, in request prep = self.prepare_request(req) File "/home/user/.local/lib/python3.7/site-packages/requests/sessions.py", line 466, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/home/user/.local/lib/python3.7/site-packages/requests/models.py", line 319, in prepare self.prepare_body(data, files, json) File "/home/user/.local/lib/python3.7/site-packages/requests/models.py", line 515, in prepare_body body = self._encode_params(data) File "/home/user/.local/lib/python3.7/site-packages/requests/models.py", line 104, in _encode_params v.encode('utf-8') if isinstance(v, str) else v)) UnicodeEncodeError: 'utf-8' codec can't encode characters in position 4-6: surrogates not allowed >>> requests.post('https://example.com/', 'test\udced\udcb3\udc83.pdf') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/user/.local/lib/python3.7/site-packages/requests/api.py", line 117, in post return request('post', url, data=data, json=json, **kwargs) File "/home/user/.local/lib/python3.7/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/home/user/.local/lib/python3.7/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/home/user/.local/lib/python3.7/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/home/user/.local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/home/user/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 706, in urlopen chunked=chunked, File "/home/user/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 394, in _make_request conn.request(method, url, **httplib_request_kw) File "/home/user/.local/lib/python3.7/site-packages/urllib3/connection.py", line 239, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/lib/python3.7/http/client.py", line 1260, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1305, in _send_request body = _encode(body, 'body') File "/usr/lib/python3.7/http/client.py", line 174, in _encode (name.title(), data[err.start:err.end], name)) from None UnicodeEncodeError: 'latin-1' codec can't encode characters in position 4-6: Body ('\udced\udcb3\udc83') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8. ``` ## System Information $ python -m requests.help ```json { "chardet": { "version": "3.0.4" }, "charset_normalizer": { "version": "2.0.9" }, "cryptography": { "version": "" }, "idna": { "version": "3.3" }, "implementation": { "name": "CPython", "version": "3.7.3" }, "platform": { "release": "4.19.0-17-amd64", "system": "Linux" }, "pyOpenSSL": { "openssl_version": "", "version": null }, "requests": { "version": "2.26.0" }, "system_ssl": { "version": "1010104f" }, "urllib3": { "version": "1.26.7" }, "using_charset_normalizer": false, "using_pyopenssl": false } ``` ----- In [requests/models.py](https://github.com/psf/requests/blob/39d0fdd9096f7dceccbc8f82e1eda7dd64717a8e/requests/models.py), there are several calls like `some_string.encode('utf-8')`. I suppose changing them to `some_string.encode('utf-8', 'surrogatepass')` would at least fix the first reproduction case. Not sure about the second, since the exception occurs in http.client there.
null
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/6008/reactions" }
https://api.github.com/repos/psf/requests/issues/6008/timeline
null
null
null
null
false
[]