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... |
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 sear... |
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':test@test.test','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, quot... |
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,
"... | 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 a... |
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... |
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```... |
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 cha... |
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... |
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 ... |
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 \"N... |
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 w... |
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... |
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 @sethm... |
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... |
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 d... |
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 urll... |
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 [tic... |
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 ... |
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 compo... |
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... |
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,... |
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 err... |
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 violatio... |
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/68e581f1b5b4425a0ee950a2433fc3c92e671d... |
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 **clo... |
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 ... |
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 conside... |
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 somethi... |
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 attempt... |
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... |
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 i... |
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 ... |
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 !

when i get response by requests !

| {
"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 ... |
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 y... |
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 pos... |
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-criti... |
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": ... | 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 simpl... |
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://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://stack... |
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 re... |
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 P... |
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. -->

## 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 is... |
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 keepi... |
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!",
... |
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:randomstring@eu-west-static-04.example.com: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:randomstring@eu-west-static-04.example.com:9293', 'http')
'http://randomstring:randomstring@eu-west-static-04.example.com:9293'
```
## Actual Result
In 2.27.0 it's broken:
```
>>> from requests.utils import prepend_scheme_if_needed
>>> prepend_scheme_if_needed('http://randomstring:randomstring@eu-west-static-04.example.com: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:randomstring@eu-west-static-04.example.com: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.",
"Req... |
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 ... |
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 addres... |
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 ... |
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. A... |
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}... | 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 ... |
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:... |
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), h... |
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 g... |
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 | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.