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
sequencelengths 0
30
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://api.github.com/repos/psf/requests/issues/6723 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6723/labels{/name} | https://api.github.com/repos/psf/requests/issues/6723/comments | https://api.github.com/repos/psf/requests/issues/6723/events | https://github.com/psf/requests/issues/6723 | 2,319,817,020 | I_kwDOABTKOs6KRZk8 | 6,723 | Different default values for "allow_redirects" for HEAD http method | {
"avatar_url": "https://avatars.githubusercontent.com/u/75862178?v=4",
"events_url": "https://api.github.com/users/paulusbrand/events{/privacy}",
"followers_url": "https://api.github.com/users/paulusbrand/followers",
"following_url": "https://api.github.com/users/paulusbrand/following{/other_user}",
"gists_url": "https://api.github.com/users/paulusbrand/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/paulusbrand",
"id": 75862178,
"login": "paulusbrand",
"node_id": "MDQ6VXNlcjc1ODYyMTc4",
"organizations_url": "https://api.github.com/users/paulusbrand/orgs",
"received_events_url": "https://api.github.com/users/paulusbrand/received_events",
"repos_url": "https://api.github.com/users/paulusbrand/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/paulusbrand/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/paulusbrand/subscriptions",
"type": "User",
"url": "https://api.github.com/users/paulusbrand",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 4 | 2024-05-27T21:51:37Z | 2024-05-29T06:34:23Z | 2024-05-29T06:34:23Z | NONE | null |
A HEAD request can be performed in two ways. Using the `requests.head` method or the `requests.request` method. But both have different default values for "allow_redirects".
## Expected Result
Both ways of performing HEAD requests have the same default behavior.
## Actual Result
`requests.head(url)` has allow_redirects disabled by default.
`requests.request("HEAD", url)` has allow_redirects enabled by default.
<!-- What happened instead. -->
## Reproduction Steps
```python
import requests
# HEAD request with default allow_redirects False
r = requests.head("http://test_site.com")
# HEAD request with default allow_redirects True
r = requests.request("HEAD", "http://test_site.com")
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.7"
},
"implementation": {
"name": "CPython",
"version": "3.12.2"
},
"platform": {
"release": "6.8.2-gentoo",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "300000d0"
},
"urllib3": {
"version": "2.2.1"
},
"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/75862178?v=4",
"events_url": "https://api.github.com/users/paulusbrand/events{/privacy}",
"followers_url": "https://api.github.com/users/paulusbrand/followers",
"following_url": "https://api.github.com/users/paulusbrand/following{/other_user}",
"gists_url": "https://api.github.com/users/paulusbrand/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/paulusbrand",
"id": 75862178,
"login": "paulusbrand",
"node_id": "MDQ6VXNlcjc1ODYyMTc4",
"organizations_url": "https://api.github.com/users/paulusbrand/orgs",
"received_events_url": "https://api.github.com/users/paulusbrand/received_events",
"repos_url": "https://api.github.com/users/paulusbrand/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/paulusbrand/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/paulusbrand/subscriptions",
"type": "User",
"url": "https://api.github.com/users/paulusbrand",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6723/reactions"
} | https://api.github.com/repos/psf/requests/issues/6723/timeline | null | completed | null | null | false | [
"This is expected. The request method means you want to explicitly do things differently so you don't get the per-method behaviors otherwise defined",
"@sigmavirus24 thanks! The reason i have to use `requests.request` is because there are no methods to perform TRACE and CONNECT http requests. For instance fir a GET request there is `requests.get`. For PUT there is `requests.put`. No such method exists for CONNECT and TRACE. Is this also intentional?",
"Yes. These have all been discussed at I've point it another in various issues that are all closed",
"https://github.com/psf/requests/pull/6209"
] |
https://api.github.com/repos/psf/requests/issues/6722 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6722/labels{/name} | https://api.github.com/repos/psf/requests/issues/6722/comments | https://api.github.com/repos/psf/requests/issues/6722/events | https://github.com/psf/requests/issues/6722 | 2,316,526,442 | I_kwDOABTKOs6KE2Nq | 6,722 | Enhance Error Messaging for Connection Failures | {
"avatar_url": "https://avatars.githubusercontent.com/u/102687650?v=4",
"events_url": "https://api.github.com/users/craetona/events{/privacy}",
"followers_url": "https://api.github.com/users/craetona/followers",
"following_url": "https://api.github.com/users/craetona/following{/other_user}",
"gists_url": "https://api.github.com/users/craetona/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/craetona",
"id": 102687650,
"login": "craetona",
"node_id": "U_kgDOBh7jog",
"organizations_url": "https://api.github.com/users/craetona/orgs",
"received_events_url": "https://api.github.com/users/craetona/received_events",
"repos_url": "https://api.github.com/users/craetona/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/craetona/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/craetona/subscriptions",
"type": "User",
"url": "https://api.github.com/users/craetona",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 1 | 2024-05-25T01:06:34Z | 2024-09-07T21:34:35Z | null | NONE | null | When making an HTTP request using the requests library, I encountered a connection failure. The error message provided was not very clear or actionable, especially for someone new to the library. Enhancing these error messages to provide more detailed and actionable information would significantly improve the developer experience.
## Expected Result
I expected the error message to include more detailed information about the potential causes of the connection failure and suggestions for troubleshooting steps.
## Actual Result
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='osudle.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001A9F6DB93C0>: Failed to establish a new connection: [WinError 10051] A socket operation was related to an unavailable network'))
## Reproduction Steps
```python
import requests
r = requests.get("http://osudle.com', timeout=20)
print(r.status_code)
```
## System Information
$ python -m requests.help
```
python -m requests.help
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "2.0.12"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.4"
},
"implementation": {
"name": "CPython",
"version": "3.10.4"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.32.2"
},
"system_ssl": {
"version": "101010ef"
},
"urllib3": {
"version": "1.26.18"
},
"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": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6722/reactions"
} | https://api.github.com/repos/psf/requests/issues/6722/timeline | null | null | null | null | false | [
"What extra information would you have liked in the error which you think would be actionable? Can you share some examples?"
] |
https://api.github.com/repos/psf/requests/issues/6721 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6721/labels{/name} | https://api.github.com/repos/psf/requests/issues/6721/comments | https://api.github.com/repos/psf/requests/issues/6721/events | https://github.com/psf/requests/pull/6721 | 2,316,313,631 | PR_kwDOABTKOs5wg6bq | 6,721 | v2.32.3 | {
"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 | false | null | [] | null | 2 | 2024-05-24T21:56:47Z | 2024-11-03T03:10:19Z | 2024-05-29T15:36:10Z | MEMBER | null | 2.32.3 (2024-05-29)
-------------------
**Bugfixes**
- Fixed bug breaking the ability to specify custom SSLContexts in sub-classes of
HTTPAdapter. (#6716)
- Fixed issue where Requests started failing to run on Python versions compiled
without the `ssl` module. (#6724) | {
"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": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/6721/reactions"
} | https://api.github.com/repos/psf/requests/issues/6721/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6721.diff",
"html_url": "https://github.com/psf/requests/pull/6721",
"merged_at": "2024-05-29T15:36:10Z",
"patch_url": "https://github.com/psf/requests/pull/6721.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6721"
} | true | [
"@sigmavirus24 @sethmlarson Anything else preventing this release, scheduled for today?",
"Hi @gesslerpd, we have some other changes being worked on. You can monitor this PR being merged for when the next release goes out."
] |
https://api.github.com/repos/psf/requests/issues/6720 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6720/labels{/name} | https://api.github.com/repos/psf/requests/issues/6720/comments | https://api.github.com/repos/psf/requests/issues/6720/events | https://github.com/psf/requests/pull/6720 | 2,313,635,571 | PR_kwDOABTKOs5wXrSG | 6,720 | Start testing on 3.13 beta | {
"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 | false | null | [] | null | 4 | 2024-05-23T19:02:21Z | 2024-09-19T11:19:06Z | 2024-09-19T11:19:05Z | MEMBER | null | It looks like we're currently blocked on wheels for a few testing dependencies so this isn't mergable currently but we'll use this PR to monitor upstream support from other projects. Once those blockers are moved, we can merge this into our CI to prepare for the upcoming release candidates.
Currently it looks like `flsgger` and `greenlet` are having issues from httpbin. I think we have an open proposal/request to make `flsgger` optional which seems fine. `greenlet` currently has a proposed patch from Victor Stinner so I would assume that's resolved sooner than later. | {
"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/6720/reactions"
} | https://api.github.com/repos/psf/requests/issues/6720/timeline | null | null | true | {
"diff_url": "https://github.com/psf/requests/pull/6720.diff",
"html_url": "https://github.com/psf/requests/pull/6720",
"merged_at": "2024-09-19T11:19:05Z",
"patch_url": "https://github.com/psf/requests/pull/6720.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6720"
} | true | [
"Looks like we're still blocked on https://github.com/python-greenlet/greenlet/issues/392. Victor Stinner's patch which appears to fix the issue has been stalled for a couple months. We'll continue to keep an eye on that as we get closer to 3.13 release on October 1st, 2024.",
"@nateprewitt Is greenlet only needed for the gunicorn worker? Could we drop that as well in httpbin in favor of some other worker type? Or some other WSGI implementation?",
"Yeah, we definitely have options in httpbin to resolve the issue. I was going to wait until we're close to 3.13 release before we started pursuing changes there. We honestly don't even need flasgger there, it was a very late add to the project before development stopped. I would bias towards us just moving that to an optional dependency.",
"@nateprewitt greenlet is only needed as a dependency of gevent, it shouldn't be a direct dep https://github.com/psf/httpbin/pull/51\r\n\r\nIt's currently blocking pytest-httpbin 3.13 support: https://github.com/kevin1024/pytest-httpbin/pull/90"
] |
https://api.github.com/repos/psf/requests/issues/6719 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6719/labels{/name} | https://api.github.com/repos/psf/requests/issues/6719/comments | https://api.github.com/repos/psf/requests/issues/6719/events | https://github.com/psf/requests/issues/6719 | 2,312,751,120 | I_kwDOABTKOs6J2cgQ | 6,719 | ERROR - Cannot set verify_mode to CERT_NONE when check_hostname is enabled | {
"avatar_url": "https://avatars.githubusercontent.com/u/7067187?v=4",
"events_url": "https://api.github.com/users/Barsovski/events{/privacy}",
"followers_url": "https://api.github.com/users/Barsovski/followers",
"following_url": "https://api.github.com/users/Barsovski/following{/other_user}",
"gists_url": "https://api.github.com/users/Barsovski/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Barsovski",
"id": 7067187,
"login": "Barsovski",
"node_id": "MDQ6VXNlcjcwNjcxODc=",
"organizations_url": "https://api.github.com/users/Barsovski/orgs",
"received_events_url": "https://api.github.com/users/Barsovski/received_events",
"repos_url": "https://api.github.com/users/Barsovski/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Barsovski/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Barsovski/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Barsovski",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-05-23T12:06:59Z | 2024-05-23T12:54:17Z | 2024-05-23T12:54:17Z | NONE | null | <!-- Summary. -->
I'm working with the exchangelib (v5.4) library.
A couple of days ago I noticed that in the Docker container exchangelib started complaining with an error `ValueError: Cannot set verify_mode to CERT_NONE when check_hostname is enabled`.
Exchangelib tries to connect to a local server with a low security level via a custom adapter with this lines
```python
from requests.adapters import HTTPAdapter
class CustomHttpAdapter(HTTPAdapter):
"""Transport adapter that allows us to use custom ssl_context."""
def __init__(self, ssl_context=None, **kwargs):
self.ssl_context = ssl_context
super().__init__(**kwargs)
def init_poolmanager(self, connections, maxsize, block=False, **kwargs):
self.ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
self.ssl_context.set_ciphers('DEFAULT:@SECLEVEL=0')
self.ssl_context.check_hostname = False
self.poolmanager = urllib3.poolmanager.PoolManager(
num_pools=connections, maxsize=maxsize,
block=block, ssl_context=self.ssl_context, ssl_version=ssl.PROTOCOL_TLSv1)
```
With this exchangelib shows an error:
```
File "/usr/local/lib/python3.11/site-packages/cached_property.py", line 70, in __get__
2024-05-23T11:53:23.558367392Z return obj_dict[name]
2024-05-23T11:53:23.558368832Z ~~~~~~~~^^^^^^
2024-05-23T11:53:23.558370213Z KeyError: \'calendar\'
```
But if I change the version of requests package from 2.32.0 to 2.31.0, connection and information exchange occurs normally.
## System Information
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.7"
},
"implementation": {
"name": "CPython",
"version": "3.11.9"
},
"platform": {
"release": "6.5.0-35-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.32.0"
},
"system_ssl": {
"version": "300000b0"
},
"urllib3": {
"version": "2.2.1"
},
"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/6719/reactions"
} | https://api.github.com/repos/psf/requests/issues/6719/timeline | null | not_planned | 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/6718 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6718/labels{/name} | https://api.github.com/repos/psf/requests/issues/6718/comments | https://api.github.com/repos/psf/requests/issues/6718/events | https://github.com/psf/requests/pull/6718 | 2,312,650,768 | PR_kwDOABTKOs5wUSDJ | 6,718 | grammar fixes | {
"avatar_url": "https://avatars.githubusercontent.com/u/39739545?v=4",
"events_url": "https://api.github.com/users/domx4q/events{/privacy}",
"followers_url": "https://api.github.com/users/domx4q/followers",
"following_url": "https://api.github.com/users/domx4q/following{/other_user}",
"gists_url": "https://api.github.com/users/domx4q/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/domx4q",
"id": 39739545,
"login": "domx4q",
"node_id": "MDQ6VXNlcjM5NzM5NTQ1",
"organizations_url": "https://api.github.com/users/domx4q/orgs",
"received_events_url": "https://api.github.com/users/domx4q/received_events",
"repos_url": "https://api.github.com/users/domx4q/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/domx4q/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/domx4q/subscriptions",
"type": "User",
"url": "https://api.github.com/users/domx4q",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 0 | 2024-05-23T11:19:51Z | 2024-05-23T11:19:51Z | null | NONE | null | This pull request contains a few grammatical corrections. The changes aim to improve the clarity and readability of the documentation and comments within the code. | 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/6718/reactions"
} | https://api.github.com/repos/psf/requests/issues/6718/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6718.diff",
"html_url": "https://github.com/psf/requests/pull/6718",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6718.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6718"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6717 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6717/labels{/name} | https://api.github.com/repos/psf/requests/issues/6717/comments | https://api.github.com/repos/psf/requests/issues/6717/events | https://github.com/psf/requests/issues/6717 | 2,310,706,421 | I_kwDOABTKOs6JupT1 | 6,717 | SSLCertVerificationError - unable to get local issuer certificate | {
"avatar_url": "https://avatars.githubusercontent.com/u/17234256?v=4",
"events_url": "https://api.github.com/users/DanSIntel/events{/privacy}",
"followers_url": "https://api.github.com/users/DanSIntel/followers",
"following_url": "https://api.github.com/users/DanSIntel/following{/other_user}",
"gists_url": "https://api.github.com/users/DanSIntel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/DanSIntel",
"id": 17234256,
"login": "DanSIntel",
"node_id": "MDQ6VXNlcjE3MjM0MjU2",
"organizations_url": "https://api.github.com/users/DanSIntel/orgs",
"received_events_url": "https://api.github.com/users/DanSIntel/received_events",
"repos_url": "https://api.github.com/users/DanSIntel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/DanSIntel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/DanSIntel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/DanSIntel",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 5 | 2024-05-22T14:29:33Z | 2024-05-22T15:46:38Z | 2024-05-22T14:59:00Z | NONE | null | Version **2.32.0** introduced changes and improvements with **SSLContext** as specified in the release history:
Improvements - verify=True now reuses a global SSLContext which should improve request time variance between first and subsequent requests. It should also minimize certificate load time on Windows systems when using a Python version built with OpenSSL 3.x. (#6667)
We are facing issue making http requests to webservers which are signed by a local root ca.
The certificate chain is installed correctly on the Windows station and **version 2.31.1 is working as expected**.
Versions **2.32.x** are throwing an error: SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)')))
This is a code example that works in 2.31.1 and does not in 2.32.x
```
from requests.adapters import HTTPAdapter
import requests
from requests.packages.urllib3.util.ssl_ import create_urllib3_context
class SSLContextAdapter(HTTPAdapter):
def init_poolmanager(self, *args, **kwargs):
context = create_urllib3_context()
context.load_default_certs() # this loads the system's CA certificates
kwargs['ssl_context'] = context
return super().init_poolmanager(*args, **kwargs)
SESSION = requests.Session()
SESSION.mount('https://', SSLContextAdapter())
SESSION.get(MY_URL_SIGNED_BY_LOCAL_ROOT_CA, headers = headers, verify = True)
```
After looking at the lastest changes, if we modifiy our code its working but i dont think that calling the private global **_preloaded_ssl_context** is the right way:
```
from requests.adapters import HTTPAdapter, _preloaded_ssl_context
import requests
class SSLContextAdapter(HTTPAdapter):
def init_poolmanager(self, *args, **kwargs):
_preloaded_ssl_context.load_default_certs() # this loads the system's CA certificates
return super().init_poolmanager(*args, **kwargs)
SESSION = requests.Session()
SESSION.mount('https://', SSLContextAdapter())
SESSION.get(MY_URL_SIGNED_BY_LOCAL_ROOT_CA, headers = headers, verify = True)
```
What is the recommended way for using load_default_certs() with version 2.32.x if the usage has changed or alternatively can you confirm if this is a bug?
| {
"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/6717/reactions"
} | https://api.github.com/repos/psf/requests/issues/6717/timeline | null | completed | null | null | false | [
"Hi @DanSIntel, this looks like the same root issue described in #6715. Can you take a look at the proposed patch in #6716 and let us know if the new API proposal meets your use case. From the code you provided, I would think you should be able to do this through `pool_kwargs`.\r\n\r\nI'd propose we close this as a duplicate of #6715 if the above is agreeable and we'll track progress in the PR.",
"Duplicate of #6715",
"@nateprewitt can you provide an example how using the changes in #6716 can work with my custom sslcontext adapter?",
"Do the same thing you're doing now but in your adapters `__init__`. Then you can patch the return value the same way we're using _preloaded_ssl_context now ([ref](https://github.com/psf/requests/blob/88dce9d854797c05d0ff296b70e0430535ef8aaf/src/requests/adapters.py#L95-L96)).\r\n\r\nSomething like this:\r\n```python\r\nclass SSLContextAdapter(HTTPAdapter):\r\n def __init__(\r\n self,\r\n pool_connections=DEFAULT_POOLSIZE,\r\n pool_maxsize=DEFAULT_POOLSIZE,\r\n max_retries=DEFAULT_RETRIES,\r\n pool_block=DEFAULT_POOLBLOCK,\r\n ):\r\n super().__init__()\r\n self.custom_context = create_urllib3_context()\r\n # Any cert modifications can be done here (if you need this per request,\r\n # do it in the build_connection_pool_key_attributes below.)\r\n self.custom_context.load_default_certs()\r\n \r\n [...]\r\n \r\n def build_connection_pool_key_attributes(self, request, verify, cert=None):\r\n host_params, pool_kwargs = super().build_connection_pool_key_attributes(request, verify, cert)\r\n pool_kwargs['ssl_context'] = self.custom_context # you can put this behind a verify is True conditional too\r\n return host_params, pool_kwargs\r\n```",
"thanks, i verified that it is working so v2.32.3 should do the job"
] |
https://api.github.com/repos/psf/requests/issues/6716 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6716/labels{/name} | https://api.github.com/repos/psf/requests/issues/6716/comments | https://api.github.com/repos/psf/requests/issues/6716/events | https://github.com/psf/requests/pull/6716 | 2,310,338,826 | PR_kwDOABTKOs5wMWbh | 6,716 | Allow for overriding of specific pool key params | {
"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"
} | [] | closed | 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"
} | [
{
"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"
},
{
"avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4",
"events_url": "https://api.github.com/users/sethmlarson/events{/privacy}",
"followers_url": "https://api.github.com/users/sethmlarson/followers",
"following_url": "https://api.github.com/users/sethmlarson/following{/other_user}",
"gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sethmlarson",
"id": 18519037,
"login": "sethmlarson",
"node_id": "MDQ6VXNlcjE4NTE5MDM3",
"organizations_url": "https://api.github.com/users/sethmlarson/orgs",
"received_events_url": "https://api.github.com/users/sethmlarson/received_events",
"repos_url": "https://api.github.com/users/sethmlarson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sethmlarson",
"user_view_type": "public"
}
] | null | 13 | 2024-05-22T11:53:49Z | 2024-10-02T10:28:12Z | 2024-05-24T21:37:06Z | CONTRIBUTOR | null | This re-enables the use case of providing a custom SSLContext via a Transport Adapter as broken in #6655 and reported in #6715
Closes #6715 | {
"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": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 1,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/6716/reactions"
} | https://api.github.com/repos/psf/requests/issues/6716/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6716.diff",
"html_url": "https://github.com/psf/requests/pull/6716",
"merged_at": "2024-05-24T21:37:06Z",
"patch_url": "https://github.com/psf/requests/pull/6716.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6716"
} | true | [
"Sorry for the late response, this is my work account. I tested the changes in this branch. I was able to successfully modify our code and send requests.",
"Sorry, I missed the ping @nateprewitt. I'm going to give this a try locally",
"While this provides a new API to change the kwargs, the previous API (currently used by the Python Elasticsearch client) no longer works. The Requests docs contains [an example](https://requests.readthedocs.io/en/latest/user/advanced/#example-specific-ssl-version) where setting the `ssl_version` in `init_poolmanager` is enough. The snippet below is a modified version of that example to require TLS 1.3 or above and then trying to request a TLS 1.2 endpoint:\r\n\r\n```python3\r\nimport ssl\r\n\r\nfrom requests import Request\r\nfrom requests.adapters import HTTPAdapter\r\nfrom urllib3.poolmanager import PoolManager\r\n\r\n\r\nclass TLS13HttpAdapter(HTTPAdapter):\r\n def init_poolmanager(self, connections, maxsize, block=False):\r\n ctx = ssl.create_default_context()\r\n ctx.minimum_version = ssl.TLSVersion.TLSv1_3\r\n self.poolmanager = PoolManager(ssl_context=ctx)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n adapter = TLS13HttpAdapter()\r\n req = Request(\"GET\", \"https://tls-v1-2.badssl.com:1012/\")\r\n resp = adapter.send(req.prepare())\r\n print(resp)\r\n```\r\n\r\nIt fails correctly with requests 2.31.0, but unexpectedly works with requests 2.32.2 and with the changes in this pull request.\r\n\r\nI also want to make it clear that this regression has nothing to do with the `get_connection` changes (which this pull request seems to assume?). It was caused by https://github.com/psf/requests/pull/6667. If I revert #6667 on top of main, the code above behaves as expected by failing the request.",
"It's a combination of the two effectively. Using the default module is done in the function used to replace get connection. That means that there's no good way to interact with specifying a context via initializing the pool manager. If instead we had created a different API here, it wouldn't be a problem and realistically, if we changed that instead of introducing this, it would be a better change but it's still a different API for folks to adapt to",
"@sigmavirus24 this doesn't fix the recursion issue we see in issue #6715 ",
"@achapkowski I believe we already root caused the recursion issue for you some time ago in https://github.com/Esri/arcgis-python-api/issues/1698 and provided guidance on what you need to fix in arcgis. Please fix the issue in your library and open a new issue if the problem persists.",
"@sigmavirus24 I'm not sure I'm following the details, but I can certainly use `build_connection_pool_key_attributes` going forward (while keeping the old way for older versions of requests).\r\n\r\nThat does mean a lot of adapter users will silently break in 2.32, especially if the examples in docs don't change.",
"@pquentin we're talking through options now to minimize friction/the amount of breakage. For everyone else in the thread, I'm waiting to release 2.32.3 until we spend some more time working through improving the `init_poolmanager` use case. This new API may either end up modified or removed depending on what we come up with. For the moment, leaving Requests at <2.32 is probably the best option so we're not rushing something half-baked out.\r\n\r\nI'll update the thread at the end of today with status if we don't release before then.",
"@nateprewitt when I create an adapter using truststore per the guidance of that issue. This workaround is now broken. \r\nUsing the code above, it works, but it's odd. \r\n\r\n\r\n\r\n```\r\nclass TruststoreAdapter(HTTPAdapter):\r\n def init_poolmanager(self, connections, maxsize, block=False):\r\n ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\r\n return super().init_poolmanager(connections, maxsize, block, ssl_context=ctx)\r\n```\r\n\r\nif I modify the adapter from the example above:\r\n\r\n```\r\ndef init_poolmanager(self, connections, maxsize, block=False):\r\n ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\r\n\r\n self.poolmanager = PoolManager(ssl_context=ctx)\r\n```\r\n\r\nIt will works (it doesn't recursively die), but I need to verify that it's actually using the truststore SSLContext and not ssl.SSLContext. ",
"Yep, that's the case we're working on fixing here. The solution you have works as expected in Requsts<2.32.",
"To provide that quick update, we're currently looking at disabling the SSLContext optimization in the event we have a PoolManager with any custom configuration kwargs. That should leave the default Requests implementation better off without requiring lifting from users with custom `init_poolmanager` implementations in their adapters.\r\n\r\nWhether we introduce this new API for further customization is still TBD, but we'll update this PR once we have a decision.",
"Alright, waiting for tests to pass and I think this should be good to go. If I can get another pair of eyes from another maintainer, I'll merge and cut a new release.",
"@nateprewitt looks good to me"
] |
https://api.github.com/repos/psf/requests/issues/6715 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6715/labels{/name} | https://api.github.com/repos/psf/requests/issues/6715/comments | https://api.github.com/repos/psf/requests/issues/6715/events | https://github.com/psf/requests/issues/6715 | 2,310,134,697 | I_kwDOABTKOs6Jsdup | 6,715 | SSLV3_ALERT_HANDSHAKE_FAILURE after upgrade from 2.31.0 to 2.32.2 | {
"avatar_url": "https://avatars.githubusercontent.com/u/106979676?v=4",
"events_url": "https://api.github.com/users/luisvicenteatprima/events{/privacy}",
"followers_url": "https://api.github.com/users/luisvicenteatprima/followers",
"following_url": "https://api.github.com/users/luisvicenteatprima/following{/other_user}",
"gists_url": "https://api.github.com/users/luisvicenteatprima/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/luisvicenteatprima",
"id": 106979676,
"login": "luisvicenteatprima",
"node_id": "U_kgDOBmBhXA",
"organizations_url": "https://api.github.com/users/luisvicenteatprima/orgs",
"received_events_url": "https://api.github.com/users/luisvicenteatprima/received_events",
"repos_url": "https://api.github.com/users/luisvicenteatprima/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/luisvicenteatprima/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/luisvicenteatprima/subscriptions",
"type": "User",
"url": "https://api.github.com/users/luisvicenteatprima",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 20 | 2024-05-22T10:12:14Z | 2024-05-30T09:10:37Z | 2024-05-24T21:37:07Z | NONE | null | After upgrading to requests 2.32.* our custom SSL adapter doesn't seem to working anymore. This is how it looks like
```
class CustomSSLAdapter(HTTPAdapter):
def __init__(self):
self.context = ssl.create_default_context()
certfile = ...
keyfile = ...
password = ...
self.context.load_cert_chain(certfile=certfile, keyfile=keyfile, password=password)
super().__init__()
def init_poolmanager(self, *args, **kwargs):
kwargs['ssl_context'] = self.context
return super().init_poolmanager(*args, **kwargs)
```
We have tried to mount this only for the target url but also for "http://". The code was working find with version 2.31.0.
## Expected Result
The adapter should still work.
## Actual Result
We got the following error:
```
SSLError: HTTPSConnectionPool(host=..., port=543): Max retries exceeded with url: ... (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)')))
```
| {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | {
"+1": 3,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 3,
"url": "https://api.github.com/repos/psf/requests/issues/6715/reactions"
} | https://api.github.com/repos/psf/requests/issues/6715/timeline | null | completed | null | null | false | [
"This is running on databricks using python 3.10.12. ",
"@nateprewitt this is a different side-effect of #6655. I think to enable this particular use case we need to expose a way for sub-classes to muck with the pool kwargs, something like\r\n\r\n\r\n```py\r\nclass HTTPAdapter(BaseAdapter):\r\n def build_pool_kwargs(self, request, verify, cert=None):\r\n return _urllib3_request_context(request, verify, cert)\r\n```\r\n\r\nThat way a subclass like this could do something like:\r\n\r\n\r\n```py\r\nclass CustomSSLAdapter(HTTPAdapter):\r\n def build_pool_kwargs(self, request, verify, cert=None):\r\n params, kwargs = super().build_pool_kwargs(request, verify, cert)\r\n params[\"ssl_context\"] = self.context\r\n```\r\n\r\nThoughts? I'm not particularly fond of this but it seems like the least intrusive way to preserve the fix for the CVE while giving people the ability to use custom SSLContexts the way they already were",
"We have a different error, but probably the same issue. We inject a `ssl_context` with a custom cipher selection. If there is a more \"correct\" way to do this I can also update our code, but a fix in the library would be appreciated.\r\n\r\nAnyway, thanks for the quick response.",
"You will need to fix your code but right now it's not easily doable",
"when do you expect releasing v2.32.3 which is suggested at #6716?",
"@DanSIntel See the conversation in the MR: https://github.com/psf/requests/pull/6716#pullrequestreview-2072332359",
"On requests 2.32.x with truststore we are seeing a maximum recursion error with verify=True on windows Jupyter labs and jupyter notebook environments.\r\n\r\n\r\n\r\n```\r\nimport requests\r\nwith requests.Session() as session:\r\n \r\n print(session.get(\"https://www.arcgis.com/sharing/rest/portals/self?f=json\").text)\r\n```",
"@achapkowski I don't see trust store being used there or any kind of traceback ",
"I also can't reproduce your claim @achapkowski but I don't have windows available:\r\n\r\n```py\r\n>>> import truststore; truststore.inject_into_ssl()\r\n>>> import requests\r\n>>> requests.get('https://google.com')\r\n<Response [200]>\r\n>>> requests.get('https://www.arcgis.com/sharing/rest/portals/self?f=json')\r\n<Response [200]>\r\n```",
"\r\n\r\n\r\nIt recursively occurs here. \r\n\r\nfull stack attached:\r\n\r\n[full-stack-error.txt](https://github.com/psf/requests/files/15416590/full-stack-error.txt)\r\n",
"Dug in a bit more:\r\n\r\n```\r\nimport requests\r\nprint(requests.get(\"https://www.arcgis.com/sharing/rest/portals/self?f=json\").text)\r\nwith requests.Session() as session:\r\n print(session.get(\"https://www.arcgis.com/sharing/rest/portals/self?f=json\").text)\r\n```\r\nThe above works on windows\r\n\r\nBelow will fails on windows. Works on Mac/Linux\r\n```\r\nimport truststore\r\ntruststore.inject_into_ssl()\r\nwith requests.Session() as session:\r\n print(session.get(\"https://www.arcgis.com/sharing/rest/portals/self?f=json\").text)\r\n```\r\n\r\n",
"I posted a response to the recursion issue in https://github.com/psf/requests/pull/6716#issuecomment-2127152349. This is already known behavior that was reported to be broken in arcgis previously due to misuse of truststore (https://github.com/Esri/arcgis-python-api/issues/1698). It will need to be fixed there. That's unrelated to the topic of this issue.\r\n\r\nFor the minimal repro, you're producing this because your repro is also misusing truststore in the same way as `arcgis`. `truststore` MUST be imported before any networking code for either urllib3 or Requests. `inject_into_ssl()` is not an intended entry point for any library or package code. You'll find a [large warning](https://github.com/sethmlarson/truststore/?tab=readme-ov-file#user-guide) at the top of the user guide directing users to avoid this.\r\n\r\nYou can swap the order of your imports and the above repro works fine on Windows:\r\n```\r\n# Must be done first\r\nimport truststore\r\ntruststore.inject_into_ssl()\r\n\r\nimport requests\r\nwith requests.Session() as session:\r\n print(session.get(\"https://www.arcgis.com/sharing/rest/portals/self?f=json\").text)\r\n```",
"I had a similar issue. Try setting the `REQUESTS_CA_BUNDLE=` environment variable if possible to point to your CA bundle",
"We used pip-system-certs to trust the os bundle which has custom CAs in. I dont fully understand why but since 2.32.0 we get what I think is the same issue. Someone has raised an issue over at gitab https://gitlab.com/alelec/pip-system-certs/-/issues/27",
"https://github.com/psf/requests/pull/6721 is staged for release on Tuesday. We're going to hold releasing over the weekend to avoid any unnecessary pain for ops teams and will release after the holiday in the US on Monday. You can follow along for the merge of that PR to track the release time.",
"@nateprewitt \r\n\r\nFor the adapter issue with 2.32.x do developers need to modify their logic? Is that documented anywhere if so?\r\n\r\nAlso thank you for the quick fix! ",
"@achapkowski If you're using the `init_poolmanager` setup now like what's linked in the example, you shouldn't need to make any additional changes. 2.32.3 should work the same as 2.31.0 and earlier. If you want to do anything more than what's described in the first post of this issue, the new `build_connection_pool_key_attributes` will be the escape hatch to do any additional customization.",
"Alright, 2.32.3 is out. Thanks everyone for your patience, please let us know if you're still hitting this failure case after upgrading.",
"> Alright, 2.32.3 is out. Thanks everyone for your patience, please let us know if you're still hitting this failure case after upgrading.\r\n\r\nWith 2.32.0-2.32.2 I've been seeing the same issue when using requests_pkcs12; now with 2.32.3, the issue did unfortunately not disappear but rather move to `HTTPSConnectionPool(host='some.system', port=443): Max retries exceeded with url: /foo/bar (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')))`.\r\n\r\nI've opened an issue with requests_pkcs12, but since you specifically asked to point out problems where things do not behave like in 2.31.0...",
"We also use requests_pkcs12 and I can confirm that 2.32.3 doesn't work with it. Stack trace I saw:\r\n\r\n`\r\nTraceback (most recent call last):\r\n File \"/workspace/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py\", line 715, in urlopen\r\n httplib_response = self._make_request(\r\n ^^^^^^^^^^^^^^^^^^^\r\n File \"/workspace/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py\", line 404, in _make_request\r\n self._validate_conn(conn)\r\n File \"/workspace/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py\", line 1058, in _validate_conn\r\n conn.connect()\r\n File \"/workspace/.venv/lib/python3.11/site-packages/urllib3/connection.py\", line 419, in connect\r\n self.sock = ssl_wrap_socket(\r\n ^^^^^^^^^^^^^^^^\r\n File \"/workspace/.venv/lib/python3.11/site-packages/urllib3/util/ssl_.py\", line 449, in ssl_wrap_socket\r\n ssl_sock = _ssl_wrap_socket_impl(\r\n ^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/workspace/.venv/lib/python3.11/site-packages/urllib3/util/ssl_.py\", line 493, in _ssl_wrap_socket_impl\r\n return ssl_context.wrap_socket(sock, server_hostname=server_hostname)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/usr/lib/python3.11/ssl.py\", line 517, in wrap_socket\r\n return self.sslsocket_class._create(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/usr/lib/python3.11/ssl.py\", line 1108, in _create\r\n self.do_handshake()\r\n File \"/usr/lib/python3.11/ssl.py\", line 1379, in do_handshake\r\n self._sslobj.do_handshake()\r\nssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)\r\n`"
] |
https://api.github.com/repos/psf/requests/issues/6714 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6714/labels{/name} | https://api.github.com/repos/psf/requests/issues/6714/comments | https://api.github.com/repos/psf/requests/issues/6714/events | https://github.com/psf/requests/pull/6714 | 2,309,827,520 | PR_kwDOABTKOs5wKlYt | 6,714 | Prefer charset_normalizer for char detection | {
"avatar_url": "https://avatars.githubusercontent.com/u/212189?v=4",
"events_url": "https://api.github.com/users/nijel/events{/privacy}",
"followers_url": "https://api.github.com/users/nijel/followers",
"following_url": "https://api.github.com/users/nijel/following{/other_user}",
"gists_url": "https://api.github.com/users/nijel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nijel",
"id": 212189,
"login": "nijel",
"node_id": "MDQ6VXNlcjIxMjE4OQ==",
"organizations_url": "https://api.github.com/users/nijel/orgs",
"received_events_url": "https://api.github.com/users/nijel/received_events",
"repos_url": "https://api.github.com/users/nijel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nijel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nijel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nijel",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 2 | 2024-05-22T07:49:36Z | 2024-05-22T10:38:59Z | 2024-05-22T10:22:50Z | NONE | null | `charset_normalizer` is a dependency for requests, while `chardet` is not, so it is more likely to be found.
For vendored requests this would still load whatever is available.
The reason I noticed this memory profiling in case both libraries are present and `charset_normalizer` has way lower memory footprint than `chardet`. | {
"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/6714/reactions"
} | https://api.github.com/repos/psf/requests/issues/6714/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6714.diff",
"html_url": "https://github.com/psf/requests/pull/6714",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6714.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6714"
} | true | [
"Just don't install chardet",
"I'd love to, but it's a dependency for a third-party library (https://github.com/otsaloma/gaupol/issues/222).\r\n\r\nWhat is actually the reason for trying `chardet` first when it's not dependency for requests? It's just an extra import that is very likely to fail."
] |
https://api.github.com/repos/psf/requests/issues/6713 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6713/labels{/name} | https://api.github.com/repos/psf/requests/issues/6713/comments | https://api.github.com/repos/psf/requests/issues/6713/events | https://github.com/psf/requests/issues/6713 | 2,309,022,046 | I_kwDOABTKOs6JoOFe | 6,713 | Not supported URL scheme http+docker KOLLA ANSIBLE | {
"avatar_url": "https://avatars.githubusercontent.com/u/100887291?v=4",
"events_url": "https://api.github.com/users/takatoejji/events{/privacy}",
"followers_url": "https://api.github.com/users/takatoejji/followers",
"following_url": "https://api.github.com/users/takatoejji/following{/other_user}",
"gists_url": "https://api.github.com/users/takatoejji/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/takatoejji",
"id": 100887291,
"login": "takatoejji",
"node_id": "U_kgDOBgNq-w",
"organizations_url": "https://api.github.com/users/takatoejji/orgs",
"received_events_url": "https://api.github.com/users/takatoejji/received_events",
"repos_url": "https://api.github.com/users/takatoejji/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/takatoejji/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/takatoejji/subscriptions",
"type": "User",
"url": "https://api.github.com/users/takatoejji",
"user_view_type": "public"
} | [
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156042717,
"name": "actions/autoclose-qa",
"node_id": "LA_kwDOABTKOs8AAAABbu3B3Q",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-qa"
}
] | closed | true | null | [] | null | 1 | 2024-05-21T20:02:52Z | 2024-05-21T20:03:04Z | 2024-05-21T20:03:03Z | NONE | off-topic | hello
Im trying to deploy an openstack cloud using kolla ansible it was working fine until yesterday
in the prechecks step an error occurs Not supported URL scheme http+docker
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: docker.errors.DockerException: Error while fetching server API version: Not supported URL scheme http+docker
here is the log
fatal: [controller]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.10/dist-packages/requests/adapters.py\", line 555, in send\n conn = self.get_connection_with_tls_context(\n File \"/usr/local/lib/python3.10/dist-packages/requests/adapters.py\", line 411, in get_connection_with_tls_context\n conn = self.poolmanager.connection_from_host(\n File \"/usr/lib/python3/dist-packages/urllib3/poolmanager.py\", line 245, in connection_from_host\n return self.connection_from_context(request_context)\n File \"/usr/lib/python3/dist-packages/urllib3/poolmanager.py\", line 257, in connection_from_context\n raise URLSchemeUnknown(scheme)\nurllib3.exceptions.URLSchemeUnknown: Not supported URL scheme http+docker\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/client.py\", line 214, in _retrieve_server_version\n return self.version(api_version=False)[\"ApiVersion\"]\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/daemon.py\", line 181, in version\n return self._result(self._get(url), json=True)\n File \"/usr/local/lib/python3.10/dist-packages/docker/utils/decorators.py\", line 46, in inner\n return f(self, *args, **kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/client.py\", line 237, in _get\n return self.get(url, **self._set_request_timeout(kwargs))\n File \"/usr/local/lib/python3.10/dist-packages/requests/sessions.py\", line 602, in get\n return self.request(\"GET\", url, **kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/requests/sessions.py\", line 589, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/requests/sessions.py\", line 703, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/requests/adapters.py\", line 559, in send\n raise InvalidURL(e, request=request)\nrequests.exceptions.InvalidURL: Not supported URL scheme http+docker\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/home/deploy-user/.ansible/tmp/ansible-tmp-1716321231.812923-13434-26055658970347/AnsiballZ_kolla_container_facts.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/deploy-user/.ansible/tmp/ansible-tmp-1716321231.812923-13434-26055658970347/AnsiballZ_kolla_container_facts.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/deploy-user/.ansible/tmp/ansible-tmp-1716321231.812923-13434-26055658970347/AnsiballZ_kolla_container_facts.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible.modules.kolla_container_facts', init_globals=dict(_module_fqn='ansible.modules.kolla_container_facts', _modlib_path=modlib_path),\n File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_kolla_container_facts_payload_upu5x80v/ansible_kolla_container_facts_payload.zip/ansible/modules/kolla_container_facts.py\", line 132, in <module>\n File \"/tmp/ansible_kolla_container_facts_payload_upu5x80v/ansible_kolla_container_facts_payload.zip/ansible/modules/kolla_container_facts.py\", line 126, in main\n File \"/tmp/ansible_kolla_container_facts_payload_upu5x80v/ansible_kolla_container_facts_payload.zip/ansible/modules/kolla_container_facts.py\", line 74, in use_docker\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/client.py\", line 197, in __init__\n self._version = self._retrieve_server_version()\n File \"/usr/local/lib/python3.10/dist-packages/docker/api/client.py\", line 221, in _retrieve_server_version\n raise DockerException(\ndocker.errors.DockerException: Error while fetching server API version: Not supported URL scheme http+docker\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
| {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6713/reactions"
} | https://api.github.com/repos/psf/requests/issues/6713/timeline | null | completed | null | null | false | [
"As described in the template, we won't be able to answer questions on this issue tracker. Please use [Stack Overflow](https://stackoverflow.com/)"
] |
https://api.github.com/repos/psf/requests/issues/6712 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6712/labels{/name} | https://api.github.com/repos/psf/requests/issues/6712/comments | https://api.github.com/repos/psf/requests/issues/6712/events | https://github.com/psf/requests/pull/6712 | 2,308,691,158 | PR_kwDOABTKOs5wGsuW | 6,712 | v2.32.2 | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 0 | 2024-05-21T16:36:41Z | 2024-05-21T18:49:23Z | 2024-05-21T18:49:22Z | MEMBER | null | 2.32.2 (2024-05-21)
-------------------
**Deprecations**
- To provide a more stable migration for custom HTTPAdapters impacted
by the CVE changes in 2.32.0, we've renamed `_get_connection` to
a new public API, `get_connection_with_tls_context`. Existing custom
HTTPAdapters will need to migrate their code to use this new API with
Requests>2.32.0.
A minimal (2-line) example has been provided in the linked PR to ease
migration, but we strongly urge users to evaluate if their custom adapter
is subject to the same issue described in CVE-2024-35195. (#6710) | {
"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/6712/reactions"
} | https://api.github.com/repos/psf/requests/issues/6712/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6712.diff",
"html_url": "https://github.com/psf/requests/pull/6712",
"merged_at": "2024-05-21T18:49:22Z",
"patch_url": "https://github.com/psf/requests/pull/6712.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6712"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6711 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6711/labels{/name} | https://api.github.com/repos/psf/requests/issues/6711/comments | https://api.github.com/repos/psf/requests/issues/6711/events | https://github.com/psf/requests/issues/6711 | 2,308,638,504 | I_kwDOABTKOs6Jmwco | 6,711 | breaking aws s3 usage with requests 2.32.0 | {
"avatar_url": "https://avatars.githubusercontent.com/u/34159454?v=4",
"events_url": "https://api.github.com/users/kristianelliott80/events{/privacy}",
"followers_url": "https://api.github.com/users/kristianelliott80/followers",
"following_url": "https://api.github.com/users/kristianelliott80/following{/other_user}",
"gists_url": "https://api.github.com/users/kristianelliott80/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kristianelliott80",
"id": 34159454,
"login": "kristianelliott80",
"node_id": "MDQ6VXNlcjM0MTU5NDU0",
"organizations_url": "https://api.github.com/users/kristianelliott80/orgs",
"received_events_url": "https://api.github.com/users/kristianelliott80/received_events",
"repos_url": "https://api.github.com/users/kristianelliott80/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kristianelliott80/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kristianelliott80/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kristianelliott80",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 13 | 2024-05-21T16:04:59Z | 2024-07-03T10:36:54Z | null | NONE | null | requests 2.32.0 introduced a change https://github.com/psf/requests/pull/6644 that strips double /.
This has introduced an issue where generated presigned urls for s3 keys that start with a / can no longer be used. requests now strips that second / meaning that the key is modified and the signature does not match resulting in 403 errors. We can adjust to remove the leading / in our keys but this may be affecting other users or use cases
## Expected Result
To be able to use presigned_urls for s3 keys with leading "/"
## Actual Result
URL that was passed was modified resulting in a 403 error response from aws
## Reproduction Steps
```python
import requests
import boto3
s3 = boto3.client('s3')
bucket = "bucket"
key = "/key_with_leading_slash.txt"
presigned_url = s3.generate_presigned_url("get_object", Params={'Bucket': bucket, 'Key': key})
requests.get(presigned_url)
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": "5.1.0"
},
"charset_normalizer": {
"version": "3.1.0"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.4"
},
"implementation": {
"name": "CPython",
"version": "3.9.6"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.32.1"
},
"system_ssl": {
"version": "101010bf"
},
"urllib3": {
"version": "1.26.15"
},
"using_charset_normalizer": false,
"using_pyopenssl": false
}
```
| null | {
"+1": 7,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 7,
"url": "https://api.github.com/repos/psf/requests/issues/6711/reactions"
} | https://api.github.com/repos/psf/requests/issues/6711/timeline | null | null | null | null | false | [
"I can second this. It's not only AWS. We just hit this problem with a completely unrelated web service that also behaves differently if the double leading slash is normalized to one.",
"I believe the s3 use case is being addressed by AWS in their SDK. \n\nAs for a service that expects a URI whose path is not normalized and returns different behavior, that's not compliant with any RFC or security best practices. I'm not losing sleep over that not working ",
"Thanks for your response! Why do you think double slash is not compliant with any RFC? I agree it's unusual but that service is not under our control.\r\n\r\nReading [RFC3986, section 3.3](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3), it seems to me the case of double leading slash is legal. It doesn't contradict anything in the text and it conforms to the ABNF below: using `path-abempty` (because `authority` is present, also used in ABNF at the beginning of Sec. 3). The first `segment` would be zero-length which is allowed in `path-abempty` as opposed to `path-absolute`.",
"Another case in point - `curl` handles leading double slash just fine. Source: my testing with mitmproxy.",
"It is absolutely a valid URI. It's also semantically equivalent to the normalized version and must be treated that way. `GET //example` is equivalent to `GET /example`",
"What defines the normalization? In that RFC, I can find only about \"dot-segment removal\". This is a genuine question - I'm but a user. I have never had to implement URL parsing, so there may be another RFC I don't know about that defines this normalization.\r\n\r\nThe path `//example` is equivalent to `/example` in a filesystem. But is it necessarily true for an URI/URL?",
"> I believe the s3 use case is being addressed by AWS in their SDK.\r\n\r\n@sigmavirus24 where have you seen this? Is there an issue or something you can point us towards?",
"I don't follow the issues there but I had a conversation with one of the python SDK maintainers. I won't tag them here though so that they don't get harangued as this community is wont to do",
"I couldn't find an issue for it, so I created one: https://github.com/boto/boto3/issues/4181\r\n\r\n@sigmavirus24 if you have another conversation with your maintainer friend, you could point him at this issue, and those of us that don't care whether the requests behaviour is technically right or not and only want it to work with S3, can watch to see when that issue gets resolved.",
"For what it's worth, I don't care that much about RFC legalese. The problem is I also see a web service (completely unrelated to S3, not even a storage) that doesn't work correctly when queried from `requests`.\r\n\r\nIf we can agree the previous behaviour was a bug WRT the colon handling in the first path segment but the current fix introduced another bug, I can try to contribute a patch to `urllib3` to fix the colon issue there, so that #6644 can be reverted.",
"I don't agree that stripping the redundant and superfluous slash is a bug. I also think that urllib3 can be improved in general around this but doing so in a backwards compatible fashion that doesn't recreate this bug but in a lower part of the stack isn't going to improve things ",
"I tried a few other clients - Python stdlib, Curl, Go stdlib, Elixir Req, Groovy stdlib (probably same as Java) - and I couldn't find another one that strips the slashes. Also, I've tested a few servers (Python http.server, Nginx and Apache) and neither of them \"normalizes\" the slashes.\r\n\r\nhttps://gist.github.com/crabhi/080d746e3eb4fc53380bc8291cdd0f7d\r\n\r\n@sigmavirus24 what leads you to believe the slash is \"redundant and superfluous\"? I see this is not an issue that would affect many people, so I'm willing to contribute a fix that would work in line with other clients. Other options I have are no joy - staying on 2.31, or maintaining a fork, or using Python stdlib for this particular request.",
"For what it's worth, the issue I raised against boto got rejected, so it appears the python SDK developers are _not_ planning to address this in the SDK.\r\n\r\nInstead, the suggestion is for when using requests, to use a prepared request and escape the first slash. I have not tested this myself."
] |
https://api.github.com/repos/psf/requests/issues/6710 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6710/labels{/name} | https://api.github.com/repos/psf/requests/issues/6710/comments | https://api.github.com/repos/psf/requests/issues/6710/events | https://github.com/psf/requests/pull/6710 | 2,308,627,178 | PR_kwDOABTKOs5wGer7 | 6,710 | Move _get_connection to get_connection_with_tls_context | {
"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 | false | null | [] | null | 9 | 2024-05-21T15:58:50Z | 2024-05-29T17:29:58Z | 2024-05-21T16:41:18Z | MEMBER | null | This PR is meant to provide a new publicly supported api `get_connection_with_tls_context` to better facilitate custom adapters with our recent fix for CVE-2024-35195.
As described [here](https://github.com/psf/requests/issues/6707#issuecomment-2122490651), we will be deprecating the existing `get_connection` API, and custom adapters will need to migrate their existing `get_connection` implementations to use `get_connection_with_tls_context`. Below is a very simple implementation that will get projects relying on a custom `get_connection` implementation unblocked.
However, we _strongly_ recommend maintainers evaluate if their custom `get_connection` is subject to the same issues as the CVE above and make appropriate changes as needed.
**Minimum new code to work as a pass-through**
This will be backwards compatible between versions of Requests.
```python
def get_connection_with_tls_context(self, request, verify, proxies=None, cert=None):
return self.get_connection(request.url, proxies)
``` | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6710/reactions"
} | https://api.github.com/repos/psf/requests/issues/6710/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6710.diff",
"html_url": "https://github.com/psf/requests/pull/6710",
"merged_at": "2024-05-21T16:41:18Z",
"patch_url": "https://github.com/psf/requests/pull/6710.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6710"
} | true | [
"cc @felixfontein",
"A small update about the minimum pass-through code for someone who will stumble upon this - don’t forget to `return` the value, as you will face a different exception if you do 🙂\r\n\r\n```python\r\ndef get_connection_with_tls_context(self, request, verify, proxies=None, cert=None):\r\n return self.get_connection(request.url, proxies)\r\n```",
"Thank you @kdymov! I've fixed the initial example as well.",
"I'm having some issues upgrading to requests 2.32 which I think are related to this change, but I can't quite figure out how I'd need to upgrade my code.\r\n\r\n[My HTTPAdapter subclass basically overrides the TLS context to allow weak DH ciphers](https://github.com/WhyNotHugo/django-afip/blob/3aa3c6e37cc17d5e97b697ee9f91610d15ac1643/django_afip/clients.py#L56-L67):\r\n\r\n```py\r\nclass AFIPAdapter(HTTPAdapter):\r\n \"\"\"An adapter with reduced security so it'll work with AFIP.\"\"\"\r\n\r\n def init_poolmanager(self, *args, **kwargs) -> PoolManager:\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs[\"ssl_context\"] = context\r\n return super().init_poolmanager(*args, **kwargs)\r\n\r\n def proxy_manager_for(self, *args, **kwargs) -> ProxyManager:\r\n context = create_urllib3_context(ciphers=CIPHERS)\r\n kwargs[\"ssl_context\"] = context\r\n return super().proxy_manager_for(*args, **kwargs)\r\n```\r\n\r\nWith `requests==2.31.0` this works, but with `requests==2.32.0` it doesn't. I keep re-reading the changes in this patchset and can't fully grasp how they're affecting me.\r\n\r\nDo you have any guidance?\r\n",
"I'm also a bit confused by `get_connection_with_tls_context`, because it reads `Returns a urllib3 connection for the given request and TLS settings`, but no TLS settings are given.",
"@WhyNotHugo You may be hitting a separate issue with `init_poolmanager`. We just released 2.32.3 to address that problem with custom adapters, you may want to give that a try.",
"2.32.3 raises an entirely different exception:\r\n\r\n```\r\nrequests.exceptions.SSLError: HTTPSConnectionPool(host='wswhomo.afip.gov.ar', port=443): Max retries exceeded with url: /wsfev1/service.asmx (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))\r\n```",
"Looks like I need to add `context.load_default_certs()` and it works fine. It wasn't required before tho.",
"We may not be loading the cert bundle the same as we were previously. Would you mind opening a new issue with a minimal reproduction (the adapter you have above is likely fine). If you can also include the info we request from help, and if you're working behind a proxy when this happens. That'd be helpful, thanks!"
] |
https://api.github.com/repos/psf/requests/issues/6709 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6709/labels{/name} | https://api.github.com/repos/psf/requests/issues/6709/comments | https://api.github.com/repos/psf/requests/issues/6709/events | https://github.com/psf/requests/pull/6709 | 2,308,104,459 | PR_kwDOABTKOs5wErz- | 6,709 | Add default timeout | {
"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"
} | [] | open | false | null | [] | {
"closed_at": null,
"closed_issues": 0,
"created_at": "2024-05-20T14:16:54Z",
"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/35",
"id": 11076316,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/35/labels",
"node_id": "MI_kwDOABTKOs4AqQLc",
"number": 35,
"open_issues": 3,
"state": "open",
"title": "2.33.0",
"updated_at": "2024-05-21T12:26:27Z",
"url": "https://api.github.com/repos/psf/requests/milestones/35"
} | 3 | 2024-05-21T11:46:58Z | 2024-10-24T10:19:28Z | null | CONTRIBUTOR | null | This adds a default connect and read timeout value for all usage of Requests. This is to solve a long-standing issue where some systems do not have a sufficiently low default value.
Personally, I'd want these values to be much lower, but a 10 second connection timeout and a 30 second read timeout seem like they should be enough to avoid problems for the edge cases of users while also not being so large that they're basically ineffective.
Closes #3070 | null | {
"+1": 4,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 4,
"url": "https://api.github.com/repos/psf/requests/issues/6709/reactions"
} | https://api.github.com/repos/psf/requests/issues/6709/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6709.diff",
"html_url": "https://github.com/psf/requests/pull/6709",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6709.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6709"
} | true | [
"If you add a default timeout it may break existing code bases.\r\n\r\nFor example, if I am using a GET request to download a 1 GB file then I would have to adjust timeout to make my code compatible with this proposed change.",
"> If you add a default timeout it may break existing code bases.\n> \n> For example, if I am using a GET request to download a 1 GB file then I would have to adjust timeout to make my code compatible with this proposed change.\n\nYou don't understand timeouts in Python. Please go read any number of past issues and blog posts about this issue before spreading FUD. ",
"Consider also adding -1 as timeout value such that it retains wait till infinity as requests currently behaves. That behaviour is desirable\r\n`\r\nValueError: Attempted to set connect timeout to -1, but the timeout cannot be set to a value less than or equal to 0.\r\n`\r\n```\r\nif timeout is None:\r\n timeout = _DEFAULT_TIMEOUT\r\nif timeout == -1:\r\n timeout = None\r\n# causes default timeout if not passed, if -1 is passed it becomes None, else if any other number is passed it becomes timeout after that much seconds\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/6708 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6708/labels{/name} | https://api.github.com/repos/psf/requests/issues/6708/comments | https://api.github.com/repos/psf/requests/issues/6708/events | https://github.com/psf/requests/pull/6708 | 2,306,722,422 | PR_kwDOABTKOs5v_7Xp | 6,708 | v2.32.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 | false | null | [] | null | 0 | 2024-05-20T20:18:56Z | 2024-05-25T13:57:11Z | 2024-05-20T22:02:30Z | MEMBER | null | 2.32.1 (2024-05-20)
-------------------
**Bugfixes**
- Add missing test certs to the sdist distributed on PyPI.
| {
"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/6708/reactions"
} | https://api.github.com/repos/psf/requests/issues/6708/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6708.diff",
"html_url": "https://github.com/psf/requests/pull/6708",
"merged_at": "2024-05-20T22:02:30Z",
"patch_url": "https://github.com/psf/requests/pull/6708.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6708"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6707 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6707/labels{/name} | https://api.github.com/repos/psf/requests/issues/6707/comments | https://api.github.com/repos/psf/requests/issues/6707/events | https://github.com/psf/requests/issues/6707 | 2,306,643,660 | I_kwDOABTKOs6JfJbM | 6,707 | Requests 2.32.0 Not supported URL scheme http+docker | {
"avatar_url": "https://avatars.githubusercontent.com/u/36175703?v=4",
"events_url": "https://api.github.com/users/joshzcold/events{/privacy}",
"followers_url": "https://api.github.com/users/joshzcold/followers",
"following_url": "https://api.github.com/users/joshzcold/following{/other_user}",
"gists_url": "https://api.github.com/users/joshzcold/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/joshzcold",
"id": 36175703,
"login": "joshzcold",
"node_id": "MDQ6VXNlcjM2MTc1NzAz",
"organizations_url": "https://api.github.com/users/joshzcold/orgs",
"received_events_url": "https://api.github.com/users/joshzcold/received_events",
"repos_url": "https://api.github.com/users/joshzcold/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/joshzcold/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joshzcold/subscriptions",
"type": "User",
"url": "https://api.github.com/users/joshzcold",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 16 | 2024-05-20T19:36:07Z | 2024-06-04T16:21:25Z | 2024-05-24T19:16:08Z | NONE | null | <!-- Summary. -->
Newest version of requests 2.32.0 has an incompatibility with python lib `docker`
```
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/requests/adapters.py", line 532, in send
INTERNALERROR> conn = self._get_connection(request, verify, proxies=proxies, cert=cert)
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/requests/adapters.py", line 400, in _get_connection
INTERNALERROR> conn = self.poolmanager.connection_from_host(
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/urllib3/poolmanager.py", line 304, in connection_from_host
INTERNALERROR> return self.connection_from_context(request_context)
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/urllib3/poolmanager.py", line 326, in connection_from_context
INTERNALERROR> raise URLSchemeUnknown(scheme)
INTERNALERROR> urllib3.exceptions.URLSchemeUnknown: Not supported URL scheme http+docker
INTERNALERROR>
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/docker/api/client.py", line 213, in _retrieve_server_version
INTERNALERROR> return self.version(api_version=False)["ApiVersion"]
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/docker/api/daemon.py", line 181, in version
INTERNALERROR> return self._result(self._get(url), json=True)
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/docker/utils/decorators.py", line 44, in inner
INTERNALERROR> return f(self, *args, **kwargs)
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/docker/api/client.py", line 236, in _get
INTERNALERROR> return self.get(url, **self._set_request_timeout(kwargs))
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/requests/sessions.py", line 602, in get
INTERNALERROR> return self.request("GET", url, **kwargs)
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
INTERNALERROR> resp = self.send(prep, **send_kwargs)
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
INTERNALERROR> r = adapter.send(request, **kwargs)
INTERNALERROR> File "/var/lib/jenkins/workspace/Development_sm_master/gravity/.nox/lib/python3.10/site-packages/requests/adapters.py", line 534, in send
INTERNALERROR> raise InvalidURL(e, request=request)
INTERNALERROR> requests.exceptions.InvalidURL: Not supported URL scheme http+docker
```
## Expected Result
Normal initalization of docker client
## Actual Result
<!-- What happened instead. -->
Stack trace posted above
## Reproduction Steps
```sh
mkvirtualenv debug_issue
pip install docker
pip install 'requests>=2.32.0'
python
```
```python
import docker
docker.from_env()
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.7"
},
"implementation": {
"name": "CPython",
"version": "3.10.12"
},
"platform": {
"release": "6.5.0-28-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "30000020"
},
"urllib3": {
"version": "2.2.1"
},
"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": 40,
"-1": 0,
"confused": 0,
"eyes": 5,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 45,
"url": "https://api.github.com/repos/psf/requests/issues/6707/reactions"
} | https://api.github.com/repos/psf/requests/issues/6707/timeline | null | completed | null | null | false | [
"I believe this was introduce with this line change which started enforcing the URL scheme:\r\nhttps://github.com/psf/requests/commit/c0813a2d910ea6b4f8438b91d315b8d181302356#diff-a4598bf8444e0feca489e60704c809c0dbfc47b90c4364216c931b497b3312d7R512\r\n\r\nThe issue is also being tracked over in `docker-py` repo:\r\nhttps://github.com/docker/docker-py/issues/3256",
"Hi @joshzcold, could you clarify more about the expected functionality with a `http+docker` scheme vs calling the URI with just `http`. Is docker-py using a custom Requests adapter or was this just being passed as generated to Requests?\r\n\r\nThis appears to be a byproduct of fixing CVE-2024-35195. urllib3 is expecting the scheme to be either `http` or `https` [here](https://github.com/urllib3/urllib3/blob/b8589ec9f8c4da91511e601b632ac06af7e7c10e/src/urllib3/poolmanager.py#L323-L325) in the context construction.",
"It looks like there's a proposed patch for docker [here](https://github.com/docker/docker-py/pull/3257). Their sub-adapter seems to reasonably have been relying on implementing `get_connection`. We'll use this issue to track the change in #6655 regarding `get_connection` and use the docker issue linked about the docker adapter.",
"@nateprewitt do you think the fix in https://github.com/docker/docker-py/pull/3257 is good enough for now, or do you have a suggestion for a better way to work around this problem, at least for now? I guess it would be great if Docker SDK for Python wouldn't need to depend on internal behavior of requests, but changing that in a proper way likely needs a larger rewrite / rearchitecturing of that part of Docker SDK for Python...",
"Since it looks like docker-py needs apply the fix on their end I believe we can close this PR.",
"We wrote the #6655 fix trying to avoid breaking users that were relying on the existing behavior of `get_connection` in their custom Adapters but missed the other side where they implemented a custom `get_connection` but were still using the default `send`.\r\n\r\nI don't think what `docker-py` was doing is unreasonable, but unfortunately I don't see a clear way to mitigate this in Requests while maintaining the security fix. https://github.com/docker/docker-py/pull/3257 seems like the least invasive option at the moment.\r\n\r\nI have a hunch `docker-py` may not be the only package that hits this issue so I'd like to track these _kinds_ of problems to evaluate if we need to take further action on our side. I'll leave this open for now to gather any other cases.",
"`requests-unixsocket`, which implements the `http+unix` scheme, is also broken by this change.",
"I would guess requests-file or whichever fork of that is still maintained would be affected if anyone uses it",
"> `requests-unixsocket`, which implements the `http+unix` scheme, is also broken by this change.\r\n\r\nIt implements it very similarly to Docker SDK for Python, i.e. it also overwrites `get_connection()`. Adding a `_get_connection()` similar to the one in https://github.com/docker/docker-py/pull/3257 should fix it as well.",
"> I would guess requests-file or whichever fork of that is still maintained would be affected if anyone uses it\r\n\r\nI don't know requests-file, but the code in https://github.com/dashea/requests-file overwrites `send()` itself (and doesn't use `HTTPAdapter`, but `BaseAdapter`), so it should not be affected. Or at least not by the same change, maybe it's affected by something else ;-)\r\n",
"@felixfontein and everyone else following along, we've iterated through a few alternatives but each has similar impact on a different user group so a \"fix\" would only be shifting the problem.\n\nWe've decided to move `_get_connection` to a new public API on HTTPAdapter called `get_connection_with_tls_context`. Going forward this will be the expanded API signature that enables us and other libraries to properly handle TLS settings when fetching connections. The existing `get_connection` will be marked as deprecated and users will be pointed to the new API.\n\nThis will avoid the clunkiness of needing to override a private method and gives a clear path forward for the API. It's likely other custom adapters implementing `get_connection` may also suffer from something similar to CVE-2024-35195 and will need this behavior. While we didn't intend to suddenly force this shift, we appreciate everyone's patience while we get things stabilized.\n\nI anticipate we'll have a patch staged at some point today and intend to push that out in 2.32.2 asap.",
"> @felixfontein and everyone else following along, we've iterated through a few alternatives but each has similar impact on a different user group so a \"fix\" would only be shifting the problem.\r\n> \r\n> We've decided to move `_get_connection` to a new public API on HTTPAdapter called `get_connection_with_tls_context`. Going forward this will be the expanded API signature that enables us and other libraries to properly handle TLS settings when fetching connections. The existing `get_connection` will be marked as deprecated and users will be pointed to the new API.\r\n> \r\n> This will avoid the clunkiness of needing to override a private method and gives a clear path forward for the API. It's likely other custom adapters implementing `get_connection` may also suffer from something similar to [CVE-2024-35195](https://github.com/advisories/GHSA-9wx4-h78v-vm56) and will need this behavior. While we didn't intend to suddenly force this shift, we appreciate everyone's patience while we get things stabilized.\r\n> \r\n> I anticipate we'll have a patch staged at some point today and intend to push that out in 2.32.2 asap.\r\n\r\nI am still facing the problem with version 2.32.2. Was the patch to fix the issue included in that release?",
"@sergiosmcr the patch needs to be done in docker-py which is already staged in https://github.com/docker/docker-py/pull/3257. Requests 2.23.2 was just to make the integration point for docker-py easier. As I noted at the top, we cannot fix this in Requests. Any changes will just move the current problem on to another package using Requests.",
"This should be resolved with docker-py 7.1.0, no longer requiring pinning Requests<2.32. I'll leave this open for a few more hours for comment and then plan to resolve this as completed by the end of today.",
"I am facing same issue with Docker-compose\r\n\r\nCan someone help me what are the exact commands I should follow to fix the issue? \r\n\r\nSome of the answers from the net says \"pinning requests version to 2.31.0\" I am a newbie, wondering what is pinning? how to do? \r\n\r\nI am using WSL2 , Ubuntu 22 LTS.\r\ndocker-compose version 1.29.2, build unknown\r\ndocker 7.1.0\r\ndocker-py 1.10.6\r\ndocker-pycreds 0.4.0\r\n\r\nError Message I am receiving is below -->\r\n\r\n File \"/home/rkk/.local/lib/python3.10/site-packages/requests/adapters.py\", line 532, in send\r\n conn = self._get_connection(request, verify, proxies=proxies, cert=cert)\r\n File \"/home/rkk/.local/lib/python3.10/site-packages/requests/adapters.py\", line 400, in _get_connection\r\n conn = self.poolmanager.connection_from_host(\r\n File \"/home/rkk/.local/lib/python3.10/site-packages/urllib3/poolmanager.py\", line 304, in connection_from_host\r\n return self.connection_from_context(request_context)\r\n File \"/home/rkk/.local/lib/python3.10/site-packages/urllib3/poolmanager.py\", line 326, in connection_from_context\r\n raise URLSchemeUnknown(scheme)\r\nurllib3.exceptions.URLSchemeUnknown: Not supported URL scheme http+docker\r\n",
"@rkkilari the old docker-compose Python package (which is End of Life for two years now!) does not work with Docker SDK for Python 7.1.0, which is the first version that works with Requests 2.32.x. You have to stick to `docker < 7.0.0` and `requests < 2.32.0`.\r\n\r\nAlso please note that you installed both `docker-py` and `docker`; these are incompatible and destroy each other. Uninstall both first, and then reinstall only one of them. If you install `docker`, make sure to install `docker < 7.0.0`, since Docker SDK for Python 7 is no longer compatible with docker-compose. `docker-py` shouldn't be used anymore anyway, except if you need Python 2.6 compatibility.\r\n\r\nAnd to your actual question: pinning means that you make sure a fixed version is installed for a package. In this case, make sure that `requests` is installed with version 2.31.0 (or more generally < 2.32.0). How to do that depends on how you install the Python packages. If you are using a `requirements.txt` file, simply replace the line with `requests` by `requests < 2.32.0` (if there is no such line, simply add such a line)."
] |
https://api.github.com/repos/psf/requests/issues/6706 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6706/labels{/name} | https://api.github.com/repos/psf/requests/issues/6706/comments | https://api.github.com/repos/psf/requests/issues/6706/events | https://github.com/psf/requests/issues/6706 | 2,306,640,505 | I_kwDOABTKOs6JfIp5 | 6,706 | 2.32.0 sdist is missing `tests/certs` | {
"avatar_url": "https://avatars.githubusercontent.com/u/110765?v=4",
"events_url": "https://api.github.com/users/mgorny/events{/privacy}",
"followers_url": "https://api.github.com/users/mgorny/followers",
"following_url": "https://api.github.com/users/mgorny/following{/other_user}",
"gists_url": "https://api.github.com/users/mgorny/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mgorny",
"id": 110765,
"login": "mgorny",
"node_id": "MDQ6VXNlcjExMDc2NQ==",
"organizations_url": "https://api.github.com/users/mgorny/orgs",
"received_events_url": "https://api.github.com/users/mgorny/received_events",
"repos_url": "https://api.github.com/users/mgorny/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mgorny/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mgorny/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mgorny",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 4 | 2024-05-20T19:34:05Z | 2024-05-21T03:58:00Z | 2024-05-20T22:13:48Z | CONTRIBUTOR | null | The requests 2.32.0 sdist tarball is missing files from `tests/certs` that are required for tests to pass.
## Expected Result
Passing tests.
## Actual Result
```pytb
$ python -m pytest --showlocals
========================================================= test session starts =========================================================
platform linux -- Python 3.11.9, pytest-8.2.1, pluggy-1.5.0
rootdir: /tmp/requests-2.32.0
configfile: pyproject.toml
testpaths: tests
plugins: cov-5.0.0, httpbin-2.0.0
collected 606 items
tests/test_adapters.py . [ 0%]
tests/test_help.py ... [ 0%]
tests/test_hooks.py ... [ 1%]
tests/test_lowlevel.py .................... [ 4%]
tests/test_packages.py ... [ 4%]
tests/test_requests.py ..............................127.0.0.1 - - [20/May/2024 21:31:33] "GET /get HTTP/1.1" 200 170
..........................127.0.0.1 - - [20/May/2024 21:31:33] "GET /cookies HTTP/1.1" 200 26
.............................127.0.0.1 - - [20/May/2024 21:31:37] "GET /basic-auth/user/pass HTTP/1.1" 401 0
....127.0.0.1 - - [20/May/2024 21:31:37] "GET /digest-auth/auth/user/pass/SHA-512 HTTP/1.1" 200 37
.127.0.0.1 - - [20/May/2024 21:31:37] "GET /digest-auth/auth/user/pass/SHA-512 HTTP/1.1" 401 0
.............. [ 22%]
...............s.............127.0.0.1 - - [20/May/2024 21:31:38] "POST /post HTTP/1.1" 200 222089
.........................................................................127.0.0.1 - - [20/May/2024 21:31:38] "GET /get HTTP/1.1" 200 222
......................... [ 43%]
.x........................................................................................127.0.0.1 - - [20/May/2024 21:32:08] "GET /bytes/20 HTTP/1.1" 500 59
...FFFF. [ 59%]
tests/test_structures.py .................... [ 62%]
tests/test_testserver.py ......s.... [ 64%]
tests/test_utils.py ..s........................................................................................................ [ 82%]
............................................................................................sssssssssss.....s [100%]
============================================================== FAILURES ===============================================================
____________________________ TestPreparingURLs.test_different_connection_pool_for_tls_settings_verify_True ____________________________
self = <tests.test_requests.TestPreparingURLs object at 0x7f5f4dbf7410>
def test_different_connection_pool_for_tls_settings_verify_True(self):
def response_handler(sock):
consume_socket_content(sock, timeout=0.5)
sock.send(
b"HTTP/1.1 200 OK\r\n"
b"Content-Length: 18\r\n\r\n"
b'\xff\xfe{\x00"\x00K0"\x00=\x00"\x00\xab0"\x00\r\n'
)
s = requests.Session()
close_server = threading.Event()
> server = TLSServer(
handler=response_handler,
wait_to_close_event=close_server,
requests_to_handle=3,
cert_chain="tests/certs/expired/server/server.pem",
keyfile="tests/certs/expired/server/server.key",
)
close_server = <threading.Event at 0x7f5f4d87f450: unset>
response_handler = <function TestPreparingURLs.test_different_connection_pool_for_tls_settings_verify_True.<locals>.response_handler at 0x7f5f4da47ba0>
s = <requests.sessions.Session object at 0x7f5f4d8867d0>
self = <tests.test_requests.TestPreparingURLs object at 0x7f5f4dbf7410>
tests/test_requests.py:2844:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TLSServer(Thread-21, initial)>
def __init__(
self,
*,
handler=None,
host="localhost",
port=0,
requests_to_handle=1,
wait_to_close_event=None,
cert_chain=None,
keyfile=None,
mutual_tls=False,
cacert=None,
):
super().__init__(
handler=handler,
host=host,
port=port,
requests_to_handle=requests_to_handle,
wait_to_close_event=wait_to_close_event,
)
self.cert_chain = cert_chain
self.keyfile = keyfile
self.ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
> self.ssl_context.load_cert_chain(self.cert_chain, keyfile=self.keyfile)
E FileNotFoundError: [Errno 2] No such file or directory
__class__ = <class 'tests.testserver.server.TLSServer'>
cacert = None
cert_chain = 'tests/certs/expired/server/server.pem'
handler = <function TestPreparingURLs.test_different_connection_pool_for_tls_settings_verify_True.<locals>.response_handler at 0x7f5f4da47ba0>
host = 'localhost'
keyfile = 'tests/certs/expired/server/server.key'
mutual_tls = False
port = 0
requests_to_handle = 3
self = <TLSServer(Thread-21, initial)>
wait_to_close_event = <threading.Event at 0x7f5f4d87f450: unset>
tests/testserver/server.py:162: FileNotFoundError
____________________ TestPreparingURLs.test_different_connection_pool_for_tls_settings_verify_bundle_expired_cert _____________________
self = <tests.test_requests.TestPreparingURLs object at 0x7f5f4dbf6fd0>
def test_different_connection_pool_for_tls_settings_verify_bundle_expired_cert(
self,
):
def response_handler(sock):
consume_socket_content(sock, timeout=0.5)
sock.send(
b"HTTP/1.1 200 OK\r\n"
b"Content-Length: 18\r\n\r\n"
b'\xff\xfe{\x00"\x00K0"\x00=\x00"\x00\xab0"\x00\r\n'
)
s = requests.Session()
close_server = threading.Event()
> server = TLSServer(
handler=response_handler,
wait_to_close_event=close_server,
requests_to_handle=3,
cert_chain="tests/certs/expired/server/server.pem",
keyfile="tests/certs/expired/server/server.key",
)
close_server = <threading.Event at 0x7f5f4e8c5d90: unset>
response_handler = <function TestPreparingURLs.test_different_connection_pool_for_tls_settings_verify_bundle_expired_cert.<locals>.response_handler at 0x7f5f4d859d00>
s = <requests.sessions.Session object at 0x7f5f4e8c4750>
self = <tests.test_requests.TestPreparingURLs object at 0x7f5f4dbf6fd0>
tests/test_requests.py:2877:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TLSServer(Thread-22, initial)>
def __init__(
self,
*,
handler=None,
host="localhost",
port=0,
requests_to_handle=1,
wait_to_close_event=None,
cert_chain=None,
keyfile=None,
mutual_tls=False,
cacert=None,
):
super().__init__(
handler=handler,
host=host,
port=port,
requests_to_handle=requests_to_handle,
wait_to_close_event=wait_to_close_event,
)
self.cert_chain = cert_chain
self.keyfile = keyfile
self.ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
> self.ssl_context.load_cert_chain(self.cert_chain, keyfile=self.keyfile)
E FileNotFoundError: [Errno 2] No such file or directory
__class__ = <class 'tests.testserver.server.TLSServer'>
cacert = None
cert_chain = 'tests/certs/expired/server/server.pem'
handler = <function TestPreparingURLs.test_different_connection_pool_for_tls_settings_verify_bundle_expired_cert.<locals>.response_handler at 0x7f5f4d859d00>
host = 'localhost'
keyfile = 'tests/certs/expired/server/server.key'
mutual_tls = False
port = 0
requests_to_handle = 3
self = <TLSServer(Thread-22, initial)>
wait_to_close_event = <threading.Event at 0x7f5f4e8c5d90: unset>
tests/testserver/server.py:162: FileNotFoundError
___________________ TestPreparingURLs.test_different_connection_pool_for_tls_settings_verify_bundle_unexpired_cert ____________________
self = <tests.test_requests.TestPreparingURLs object at 0x7f5f4dbf42d0>
def test_different_connection_pool_for_tls_settings_verify_bundle_unexpired_cert(
self,
):
def response_handler(sock):
consume_socket_content(sock, timeout=0.5)
sock.send(
b"HTTP/1.1 200 OK\r\n"
b"Content-Length: 18\r\n\r\n"
b'\xff\xfe{\x00"\x00K0"\x00=\x00"\x00\xab0"\x00\r\n'
)
s = requests.Session()
close_server = threading.Event()
> server = TLSServer(
handler=response_handler,
wait_to_close_event=close_server,
requests_to_handle=3,
cert_chain="tests/certs/valid/server/server.pem",
keyfile="tests/certs/valid/server/server.key",
)
close_server = <threading.Event at 0x7f5f4e9244d0: unset>
response_handler = <function TestPreparingURLs.test_different_connection_pool_for_tls_settings_verify_bundle_unexpired_cert.<locals>.response_handler at 0x7f5f4e7d0fe0>
s = <requests.sessions.Session object at 0x7f5f4eaeffd0>
self = <tests.test_requests.TestPreparingURLs object at 0x7f5f4dbf42d0>
tests/test_requests.py:2910:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TLSServer(Thread-23, initial)>
def __init__(
self,
*,
handler=None,
host="localhost",
port=0,
requests_to_handle=1,
wait_to_close_event=None,
cert_chain=None,
keyfile=None,
mutual_tls=False,
cacert=None,
):
super().__init__(
handler=handler,
host=host,
port=port,
requests_to_handle=requests_to_handle,
wait_to_close_event=wait_to_close_event,
)
self.cert_chain = cert_chain
self.keyfile = keyfile
self.ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
> self.ssl_context.load_cert_chain(self.cert_chain, keyfile=self.keyfile)
E FileNotFoundError: [Errno 2] No such file or directory
__class__ = <class 'tests.testserver.server.TLSServer'>
cacert = None
cert_chain = 'tests/certs/valid/server/server.pem'
handler = <function TestPreparingURLs.test_different_connection_pool_for_tls_settings_verify_bundle_unexpired_cert.<locals>.response_handler at 0x7f5f4e7d0fe0>
host = 'localhost'
keyfile = 'tests/certs/valid/server/server.key'
mutual_tls = False
port = 0
requests_to_handle = 3
self = <TLSServer(Thread-23, initial)>
wait_to_close_event = <threading.Event at 0x7f5f4e9244d0: unset>
tests/testserver/server.py:162: FileNotFoundError
_________________________________ TestPreparingURLs.test_different_connection_pool_for_mtls_settings __________________________________
self = <tests.test_requests.TestPreparingURLs object at 0x7f5f4dbf4b90>
def test_different_connection_pool_for_mtls_settings(self):
client_cert = None
def response_handler(sock):
nonlocal client_cert
client_cert = sock.getpeercert()
consume_socket_content(sock, timeout=0.5)
sock.send(
b"HTTP/1.1 200 OK\r\n"
b"Content-Length: 18\r\n\r\n"
b'\xff\xfe{\x00"\x00K0"\x00=\x00"\x00\xab0"\x00\r\n'
)
s = requests.Session()
close_server = threading.Event()
> server = TLSServer(
handler=response_handler,
wait_to_close_event=close_server,
requests_to_handle=2,
cert_chain="tests/certs/expired/server/server.pem",
keyfile="tests/certs/expired/server/server.key",
mutual_tls=True,
cacert="tests/certs/expired/ca/ca.crt",
)
client_cert = None
close_server = <threading.Event at 0x7f5f4e81d410: unset>
response_handler = <function TestPreparingURLs.test_different_connection_pool_for_mtls_settings.<locals>.response_handler at 0x7f5f4da47600>
s = <requests.sessions.Session object at 0x7f5f4e81fc50>
self = <tests.test_requests.TestPreparingURLs object at 0x7f5f4dbf4b90>
tests/test_requests.py:2944:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TLSServer(Thread-24, initial)>
def __init__(
self,
*,
handler=None,
host="localhost",
port=0,
requests_to_handle=1,
wait_to_close_event=None,
cert_chain=None,
keyfile=None,
mutual_tls=False,
cacert=None,
):
super().__init__(
handler=handler,
host=host,
port=port,
requests_to_handle=requests_to_handle,
wait_to_close_event=wait_to_close_event,
)
self.cert_chain = cert_chain
self.keyfile = keyfile
self.ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
> self.ssl_context.load_cert_chain(self.cert_chain, keyfile=self.keyfile)
E FileNotFoundError: [Errno 2] No such file or directory
__class__ = <class 'tests.testserver.server.TLSServer'>
cacert = 'tests/certs/expired/ca/ca.crt'
cert_chain = 'tests/certs/expired/server/server.pem'
handler = <function TestPreparingURLs.test_different_connection_pool_for_mtls_settings.<locals>.response_handler at 0x7f5f4da47600>
host = 'localhost'
keyfile = 'tests/certs/expired/server/server.key'
mutual_tls = True
port = 0
requests_to_handle = 2
self = <TLSServer(Thread-24, initial)>
wait_to_close_event = <threading.Event at 0x7f5f4e81d410: unset>
tests/testserver/server.py:162: FileNotFoundError
========================================================== warnings summary ===========================================================
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
/tmp/requests-2.32.0/src/requests/auth.py:36: DeprecationWarning: Non-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (42) to a string or bytes object in the near future to avoid problems.
warnings.warn(
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
/tmp/requests-2.32.0/src/requests/auth.py:46: DeprecationWarning: Non-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (<class 'int'>) to a string or bytes object in the near future to avoid problems.
warnings.warn(
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
/tmp/requests-2.32.0/src/requests/auth.py:36: DeprecationWarning: Non-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (None) to a string or bytes object in the near future to avoid problems.
warnings.warn(
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
/tmp/requests-2.32.0/src/requests/auth.py:46: DeprecationWarning: Non-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (<class 'NoneType'>) to a string or bytes object in the near future to avoid problems.
warnings.warn(
tests/test_utils.py::TestContentEncodingDetection::test_none
tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta charset="UTF-8">]
tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta http-equiv="Content-type" content="text/html;charset=UTF-8">]
tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />]
tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<?xml version="1.0" encoding="UTF-8"?>]
tests/test_utils.py::TestContentEncodingDetection::test_precedence
/tmp/requests-2.32.0/src/requests/utils.py:494: DeprecationWarning: In requests 3.0, get_encodings_from_content will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================= short test summary info =======================================================
FAILED tests/test_requests.py::TestPreparingURLs::test_different_connection_pool_for_tls_settings_verify_True - FileNotFoundError: [Errno 2] No such file or directory
FAILED tests/test_requests.py::TestPreparingURLs::test_different_connection_pool_for_tls_settings_verify_bundle_expired_cert - FileNotFoundError: [Errno 2] No such file or directory
FAILED tests/test_requests.py::TestPreparingURLs::test_different_connection_pool_for_tls_settings_verify_bundle_unexpired_cert - FileNotFoundError: [Errno 2] No such file or directory
FAILED tests/test_requests.py::TestPreparingURLs::test_different_connection_pool_for_mtls_settings - FileNotFoundError: [Errno 2] No such file or directory
============================ 4 failed, 586 passed, 15 skipped, 1 xfailed, 14 warnings in 75.39s (0:01:15) =============================
```
## Reproduction Steps
```sh
tar -xf requests-2.32.0.tar.gz
cd requests-2.32.0
pip install -e . -r requirements-dev.txt
python -m pytest --showlocals
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.7"
},
"implementation": {
"name": "CPython",
"version": "3.11.9"
},
"platform": {
"release": "6.8.10-gentoo-dist",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.32.0"
},
"system_ssl": {
"version": "30200010"
},
"urllib3": {
"version": "2.2.1"
},
"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/6706/reactions"
} | https://api.github.com/repos/psf/requests/issues/6706/timeline | null | completed | null | null | false | [
"Thanks for the report @mgorny. It looks like the test files from #6662 didn't end up in the MANIFEST.in. I'll take a look at getting that fixed asap.",
"Fix is staged in #6708. You can track that for resolution. Thanks again!",
"This should be resolved now with the release of 2.32.1.",
"Thanks!"
] |
https://api.github.com/repos/psf/requests/issues/6705 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6705/labels{/name} | https://api.github.com/repos/psf/requests/issues/6705/comments | https://api.github.com/repos/psf/requests/issues/6705/events | https://github.com/psf/requests/pull/6705 | 2,306,246,529 | PR_kwDOABTKOs5v-Sof | 6,705 | v2.32.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 | false | null | [] | null | 0 | 2024-05-20T15:30:48Z | 2024-05-20T15:46:50Z | 2024-05-20T15:46:49Z | MEMBER | null | 2.32.0 (2024-05-20)
-------------------
**Security**
- Fixed an issue where setting `verify=False` on the first request from a
Session will cause subsequent requests to the _same origin_ to also ignore
cert verification, regardless of the value of `verify`.
(https://github.com/psf/requests/security/advisories/GHSA-9wx4-h78v-vm56)
**Improvements**
- `verify=True` now reuses a global SSLContext which should improve
request time variance between first and subsequent requests. It should
also minimize certificate load time on Windows systems when using a Python
version built with OpenSSL 3.x. (#6667)
- Requests now supports optional use of character detection
(`chardet` or `charset_normalizer`) when repackaged or vendored.
This enables `pip` and other projects to minimize their vendoring
surface area. The `Response.text()` and `apparent_encoding` APIs
will default to `utf-8` if neither library is present. (#6702)
**Bugfixes**
- Fixed bug in length detection where emoji length was incorrectly
calculated in the request content-length. (#6589)
- Fixed deserialization bug in JSONDecodeError. (#6629)
- Fixed bug where an extra leading `/` (path separator) could lead
urllib3 to unnecessarily reparse the request URI. (#6644)
**Deprecations**
- Requests has officially added support for CPython 3.12 (#6503)
- Requests has officially added support for PyPy 3.9 and 3.10 (#6641)
- Requests has officially dropped support for CPython 3.7 (#6642)
- Requests has officially dropped support for PyPy 3.7 and 3.8 (#6641)
**Documentation**
- Various typo fixes and doc improvements.
**Packaging**
- Requests has started adopting some modern packaging practices.
The source files for the projects (formerly `requests`) is now located
in `src/requests` in the Requests sdist. (#6506)
- Starting in Requests 2.33.0, Requests will migrate to a PEP 517 build system
using `hatchling`. This should not impact the average user, but extremely old
versions of packaging utilities may have issues with the new packaging format. | {
"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/6705/reactions"
} | https://api.github.com/repos/psf/requests/issues/6705/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6705.diff",
"html_url": "https://github.com/psf/requests/pull/6705",
"merged_at": "2024-05-20T15:46:49Z",
"patch_url": "https://github.com/psf/requests/pull/6705.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6705"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6704 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6704/labels{/name} | https://api.github.com/repos/psf/requests/issues/6704/comments | https://api.github.com/repos/psf/requests/issues/6704/events | https://github.com/psf/requests/issues/6704 | 2,304,575,073 | I_kwDOABTKOs6JXQZh | 6,704 | Requests roadmap | {
"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 | false | null | [] | null | 5 | 2024-05-19T11:56:46Z | 2024-05-21T00:07:17Z | 2024-05-19T18:39:01Z | NONE | null | Since the PSF took over management of 'requests' I am wondering what the road map is for this library? Is it posted anywhere? Is v3 totally dead? Is the package just in maintenance mode?
I know a few years ago things were very chaotic, but being removed from those bad times, where is the package going?
| {
"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/6704/reactions"
} | https://api.github.com/repos/psf/requests/issues/6704/timeline | null | not_planned | null | null | false | [
"It's still just Nate and me. There isn't really any more time we can commit to the project than we already do. V3 as described to raise lots of money that didn't actually end up benefitting the project is still something desirable but will never be called V3 as none of those goals are recoverable from that website. So if we ever do have enough time to spend in a larger overhaul it will likely be named something else entirely. ",
"The project hasn't had any notable form of roadmap since the early releases of Requests 2.x. Almost all work on Requests 3.x stopped in 2017, so that's not a recent development. I think urllib3 2.0 has laid a path for a more gradual shift on improvements/minor breakages that we may be able to follow but there aren't any immediate plans as Ian noted. Requests is considered largely feature complete for its original purpose.\r\n\r\nWe'll continue to release bugfixes and general maintenance changes as we have, and if there is a point we have something that makes sense to add, we may consider it. Adding features for the sake of features though has never been a goal for Requests, so that's unlikely to change.",
"Is the PSF funding the project in anyway? Or just hosting it? ",
"Neither Nate nor I can accept any funding due to our employers ",
"Thank you, I appreciate both your work. "
] |
https://api.github.com/repos/psf/requests/issues/6703 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6703/labels{/name} | https://api.github.com/repos/psf/requests/issues/6703/comments | https://api.github.com/repos/psf/requests/issues/6703/events | https://github.com/psf/requests/issues/6703 | 2,304,398,480 | I_kwDOABTKOs6JWlSQ | 6,703 | Request not throwing requests.exceptions.InvalidSchema on custom HTTPAdapter | {
"avatar_url": "https://avatars.githubusercontent.com/u/5265345?v=4",
"events_url": "https://api.github.com/users/defkev/events{/privacy}",
"followers_url": "https://api.github.com/users/defkev/followers",
"following_url": "https://api.github.com/users/defkev/following{/other_user}",
"gists_url": "https://api.github.com/users/defkev/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/defkev",
"id": 5265345,
"login": "defkev",
"node_id": "MDQ6VXNlcjUyNjUzNDU=",
"organizations_url": "https://api.github.com/users/defkev/orgs",
"received_events_url": "https://api.github.com/users/defkev/received_events",
"repos_url": "https://api.github.com/users/defkev/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/defkev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/defkev/subscriptions",
"type": "User",
"url": "https://api.github.com/users/defkev",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 3 | 2024-05-19T02:49:46Z | 2024-05-19T16:45:43Z | 2024-05-19T13:52:20Z | NONE | null | Mounting a custom HTTPAdapter (e.g. for retry) using an unsupported protocol (e.g. typo) doesn't throw requests.exceptions.InvalidSchema like the default adapter?!
## Expected Result
Should throw requests.exceptions.InvalidSchema
## Actual Result
```
Traceback (most recent call last):
File "python\lib\site-packages\requests\adapters.py", line 456, in send
conn = self.get_connection(request.url, proxies)
File "python\lib\site-packages\requests\adapters.py", line 358, in get_connection
conn = self.poolmanager.connection_from_url(url)
File "python\lib\site-packages\urllib3\poolmanager.py", line 299, in connection_from_url
return self.connection_from_host(
File "python\lib\site-packages\urllib3\poolmanager.py", line 246, in connection_from_host
return self.connection_from_context(request_context)
File "python\lib\site-packages\urllib3\poolmanager.py", line 258, in connection_from_context
raise URLSchemeUnknown(scheme)
urllib3.exceptions.URLSchemeUnknown: Not supported URL scheme htxp
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 21, in <module>
with session.get(url.geturl()) as r:
File "python\lib\site-packages\requests\sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "python\lib\site-packages\requests\sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "python\lib\site-packages\requests\sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "python\lib\site-packages\requests\adapters.py", line 458, in send
raise InvalidURL(e, request=request)
requests.exceptions.InvalidURL: Not supported URL scheme htxp
```
## Reproduction Steps
```python
from urllib.parse import urlparse
import requests
import urllib3
url = urlparse('htxp://example.com/test')
retries = requests.packages.urllib3.util.retry.Retry(
status_forcelist = tuple(range(500, 600))
)
adapter = requests.adapters.HTTPAdapter(max_retries = retries)
session = requests.Session()
session.mount('%s://' % (url.scheme), adapter)
try:
with session.get(url.geturl()) as r: # Should throw requests.exceptions.InvalidSchema
print(r.status_code)
except requests.exceptions.InvalidSchema as e: # Not thrown!
print(e)
except urllib3.exceptions.URLSchemeUnknown as e: # Instead this does but can't catch it?
print(e)
except requests.exceptions.InvalidURL as e: # Thrown by above exception
print(e)
```
## System Information
$ python -m requests.help
```json
{
"requests": {
"version": "2.28.1"
},
"urllib3": {
"version": "1.26.13"
}
}
``` | {
"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/6703/reactions"
} | https://api.github.com/repos/psf/requests/issues/6703/timeline | null | not_planned | null | null | false | [
"This is one hundred percent your own fault. InvalidSchema is documented as a problem when we cannot find a suitable adapter to use for a request and adapters are found by looking at the longest prefix. You registered one with `htxp` so you then told Requests you were registering an adapter to handle that scheme. After that, we were unable to use the adapter you configured to complete the request. Finally you're concerned with an exception we catch and then raise a new exception from, there you're being tripped up by the way exceptions are printed in python 3. You're also handling the correct exception when we can't manage that request for you",
"The typo (htxp) was just an example, i am seeing the exact same behavior with valid schemes (e.g. rtmp://) unsupported by urllib3 also throwing `requests.exceptions.InvalidURL`\r\n\r\nThe million dollar question is:\r\nHow do i catch `urllib3.exceptions.URLSchemeUnknown` in the stack if the URL is in fact NOT invalid (htxp:// vs rtmp://) if requests throws `requests.exceptions.InvalidURL` for both without adding my own protocol validator?",
"If you're writing your own totally custom adapters for those protocols then why do you care about catching an exception from urllib3? \n\nIf you're just using the HTTPAdapter from us for unsupported protocols why do you want to handle an exception from urllib3? \n\nNone of this makes any sense as a use case and it seems you're not reading the documentation and expecting me to give you solutions to [problems](https://xyproblem.info/) that aren't problematic. This is now a request for help that belongs on StackOverflow. "
] |
https://api.github.com/repos/psf/requests/issues/6702 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6702/labels{/name} | https://api.github.com/repos/psf/requests/issues/6702/comments | https://api.github.com/repos/psf/requests/issues/6702/events | https://github.com/psf/requests/pull/6702 | 2,296,511,330 | PR_kwDOABTKOs5vdTeS | 6,702 | Allow optional char detection dependencies in post-packaging | {
"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 | false | null | [] | {
"closed_at": null,
"closed_issues": 13,
"created_at": "2023-08-13T17:04:53Z",
"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/33",
"id": 9786066,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/33/labels",
"node_id": "MI_kwDOABTKOs4AlVLS",
"number": 33,
"open_issues": 0,
"state": "open",
"title": "2.32.0",
"updated_at": "2024-05-20T14:17:03Z",
"url": "https://api.github.com/repos/psf/requests/milestones/33"
} | 0 | 2024-05-14T22:25:35Z | 2024-05-22T08:08:55Z | 2024-05-15T00:15:19Z | MEMBER | null | This PR is a proposal to relax our requirement to have a character detection library present with all installations of Requests. While we cannot remove our reliance on `charset_normalizer` or `chardet`, there are use cases where Requests is repackaged in applications or other tools that do not need our character detection behavior. These changes will enable them to remove those dependencies from their installation.
The current use case for this shift is to allow `pip` to remove these dependencies entirely. That should slim the package ~2MB in 24.1.0 and avoid the overhead of importing the unneeded dependency. | {
"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": 5,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 1,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 6,
"url": "https://api.github.com/repos/psf/requests/issues/6702/reactions"
} | https://api.github.com/repos/psf/requests/issues/6702/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6702.diff",
"html_url": "https://github.com/psf/requests/pull/6702",
"merged_at": "2024-05-15T00:15:19Z",
"patch_url": "https://github.com/psf/requests/pull/6702.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6702"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6701 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6701/labels{/name} | https://api.github.com/repos/psf/requests/issues/6701/comments | https://api.github.com/repos/psf/requests/issues/6701/events | https://github.com/psf/requests/issues/6701 | 2,294,852,916 | I_kwDOABTKOs6IyK00 | 6,701 | Connection problems | {
"avatar_url": "https://avatars.githubusercontent.com/u/169767657?v=4",
"events_url": "https://api.github.com/users/maciek324/events{/privacy}",
"followers_url": "https://api.github.com/users/maciek324/followers",
"following_url": "https://api.github.com/users/maciek324/following{/other_user}",
"gists_url": "https://api.github.com/users/maciek324/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/maciek324",
"id": 169767657,
"login": "maciek324",
"node_id": "U_kgDOCh5y6Q",
"organizations_url": "https://api.github.com/users/maciek324/orgs",
"received_events_url": "https://api.github.com/users/maciek324/received_events",
"repos_url": "https://api.github.com/users/maciek324/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/maciek324/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/maciek324/subscriptions",
"type": "User",
"url": "https://api.github.com/users/maciek324",
"user_view_type": "public"
} | [
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156042717,
"name": "actions/autoclose-qa",
"node_id": "LA_kwDOABTKOs8AAAABbu3B3Q",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-qa"
}
] | closed | true | null | [] | null | 1 | 2024-05-14T08:55:49Z | 2024-05-14T08:56:00Z | 2024-05-14T08:55:59Z | NONE | off-topic | Hello,
i´m pretty new in Python programming.
I have python3 and i installed requests via pip.
I cant connect to any site with .get...
my code:
import requests
r = requests.get('http://google.com', timeout=20)
print(r.status_code)
Output: see file Output.txt
[Output.txt](https://github.com/psf/requests/files/15305796/Output.txt)
If i try to catch exeptions:
Code:
import requests
try:
response = requests.get('https://google.com',timeout=20)
if response.status_code == 200:
print (response.json())
else:
print(f"Fehler beim Abrufen der Daten. Statuscode: {response.status_code}")
except Exception as e:
print(f"Fehler: {str(e)}")
Output:
Fehler: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000215B98DE900>: Failed to establish a new connection: [WinError 10051] A socket operation was related to an unavailable network'))
Is it a firewall or some connection problems ? I´m clueless | {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6701/reactions"
} | https://api.github.com/repos/psf/requests/issues/6701/timeline | null | completed | null | null | false | [
"As described in the template, we won't be able to answer questions on this issue tracker. Please use [Stack Overflow](https://stackoverflow.com/)"
] |
https://api.github.com/repos/psf/requests/issues/6700 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6700/labels{/name} | https://api.github.com/repos/psf/requests/issues/6700/comments | https://api.github.com/repos/psf/requests/issues/6700/events | https://github.com/psf/requests/pull/6700 | 2,291,484,046 | PR_kwDOABTKOs5vMBPc | 6,700 | Use an invalid URI that will not cause httpbin to throw 500 | {
"avatar_url": "https://avatars.githubusercontent.com/u/36968154?v=4",
"events_url": "https://api.github.com/users/franekmagiera/events{/privacy}",
"followers_url": "https://api.github.com/users/franekmagiera/followers",
"following_url": "https://api.github.com/users/franekmagiera/following{/other_user}",
"gists_url": "https://api.github.com/users/franekmagiera/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/franekmagiera",
"id": 36968154,
"login": "franekmagiera",
"node_id": "MDQ6VXNlcjM2OTY4MTU0",
"organizations_url": "https://api.github.com/users/franekmagiera/orgs",
"received_events_url": "https://api.github.com/users/franekmagiera/received_events",
"repos_url": "https://api.github.com/users/franekmagiera/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/franekmagiera/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/franekmagiera/subscriptions",
"type": "User",
"url": "https://api.github.com/users/franekmagiera",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 0 | 2024-05-12T20:11:03Z | 2024-05-12T21:33:47Z | 2024-05-12T21:33:47Z | CONTRIBUTOR | null | Context in https://github.com/urllib3/urllib3/issues/3392
Urllib3's CI started failing due to the requests `test_redirecting_to_bad_url` failing. The test started failing, beacuse httpbin started returning 500 on initial request, instead of a 302. I think this would break requests CI as well if it were run now.
Modified the redirect to URI to something that will not cause httpbin to throw a 500, but is still an invalid URI. | {
"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/6700/reactions"
} | https://api.github.com/repos/psf/requests/issues/6700/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6700.diff",
"html_url": "https://github.com/psf/requests/pull/6700",
"merged_at": "2024-05-12T21:33:47Z",
"patch_url": "https://github.com/psf/requests/pull/6700.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6700"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6699 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6699/labels{/name} | https://api.github.com/repos/psf/requests/issues/6699/comments | https://api.github.com/repos/psf/requests/issues/6699/events | https://github.com/psf/requests/issues/6699 | 2,288,693,498 | I_kwDOABTKOs6IarD6 | 6,699 | AttributeError: 'NoneType' object has no attribute 'setdefault' on environment proxies | {
"avatar_url": "https://avatars.githubusercontent.com/u/107975?v=4",
"events_url": "https://api.github.com/users/tarmath/events{/privacy}",
"followers_url": "https://api.github.com/users/tarmath/followers",
"following_url": "https://api.github.com/users/tarmath/following{/other_user}",
"gists_url": "https://api.github.com/users/tarmath/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tarmath",
"id": 107975,
"login": "tarmath",
"node_id": "MDQ6VXNlcjEwNzk3NQ==",
"organizations_url": "https://api.github.com/users/tarmath/orgs",
"received_events_url": "https://api.github.com/users/tarmath/received_events",
"repos_url": "https://api.github.com/users/tarmath/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tarmath/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tarmath/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tarmath",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 6 | 2024-05-10T00:52:17Z | 2024-09-09T22:05:42Z | 2024-05-11T20:18:22Z | NONE | null | AttributeError: 'NoneType' object has no attribute 'setdefault' on environment proxies
It appears there is a small bug in `Session.merge_environment_settings` where the proxies variable can be `None` but setdefault is called on it anyway when env_proxies are present, causing an AttributeError to be thrown:
https://github.com/psf/requests/blob/main/src/requests/sessions.py#L759-L762
| {
"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/6699/reactions"
} | https://api.github.com/repos/psf/requests/issues/6699/timeline | null | not_planned | null | null | false | [
"How are you encountering this? On which versions? Why did you skip the issue template? ",
"Hello! Apologies for not using the template above. I have included it below.\r\n\r\nAdditionally, I have unearthed more context while working on reproduction steps.\r\n\r\nIt appears that although the type hint signature in typeshed defines the proxies parameter as optional:\r\n\r\nhttps://github.com/python/typeshed/blob/main/stubs/requests/requests/sessions.pyi#L307\r\n\r\nIn practice requests fallbacks to an empty dictionary which prevents hitting the issue:\r\n\r\nhttps://github.com/psf/requests/blob/main/src/requests/sessions.py#L577\r\n\r\n## Expected Result\r\n\r\nNo Exception to be thrown.\r\n\r\n## Actual Result\r\n\r\nAttributeError: 'NoneType' object has no attribute 'setdefault'\r\n\r\n## Reproduction Steps\r\n\r\nInvoke this code with an environment that has a variable that ends with _PROXY, example:\r\n\r\n```shell\r\nHELLO_PROXY=abc python script.py\r\n```\r\n\r\n```python\r\nfrom requests import Request, Session\r\n\r\nrequest = Request(method=\"GET\", url=\"<https://disney.com\")>\r\n\r\nsession = Session()\r\nprepared_request = session.prepare_request(request)\r\nsettings = session.merge_environment_settings(prepared_request.url, None, None, None, None)\r\nresponse = session.send(prepared_request, **settings)\r\n```\r\n\r\n## System Information\r\n\r\n```\r\n{\r\n \"chardet\": {\r\n \"version\": null\r\n },\r\n \"charset_normalizer\": {\r\n \"version\": \"3.3.2\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"3.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.9.6\"\r\n },\r\n \"platform\": {\r\n \"release\": \"23.2.0\",\r\n \"system\": \"Darwin\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.31.0\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"20000000\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.26.18\"\r\n },\r\n \"using_charset_normalizer\": true,\r\n \"using_pyopenssl\": false\r\n}\r\n```",
"I'd looked at this when the ticket first opened and the typing is due to ambiguity created by our top-level API defaults and the code inside [merge_environment_settings](https://github.com/psf/requests/blob/main/src/requests/sessions.py#L759).\r\n\r\nWe imply `proxies` can be None and even have some code written around that assumption. I'd personally rather be explicit that we require a Mapping and only a Mapping for this API since it doesn't really work without that. The only downside is a minor performance hit in the case we were previously skipping the merge in [`merge_settings`](https://github.com/psf/requests/blob/d6dded3f00afcf56a7e866cb0732799045301eb0/src/requests/sessions.py#L70-L71). A sufficiently large proxies dictionary _may_ see some performance impact, but I'm not sure that's going to be a noticeable case.",
"@nateprewitt Should this issue be reopened then?",
"@nateprewitt @sigmavirus24 please confirm whether issue should be reopened or not. many thanks!",
"I don't think it's worth re-opening this. We can't really fix this without introducing other issues into the API and the issue lies outside of the intended usage. While it's an odd type mismatch, these exist throughout requests because the code base was written at a time that pre-dates typing. Many of these issues we cannot fix without introducing breakages, so they've been left to meet their existing behavior.\r\n\r\nWe ensure that proxies will never be `None` before invoking this method and the public signature should probably be `Mapping` despite us handling `None` within the code. That's how we document it and is the only way this reasonably works right now.\r\n\r\nIs there an open issue in Typeshed for this? That's probably where this should be remedied."
] |
https://api.github.com/repos/psf/requests/issues/6698 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6698/labels{/name} | https://api.github.com/repos/psf/requests/issues/6698/comments | https://api.github.com/repos/psf/requests/issues/6698/events | https://github.com/psf/requests/pull/6698 | 2,288,436,755 | PR_kwDOABTKOs5vB8OY | 6,698 | Update README.md | {
"avatar_url": "https://avatars.githubusercontent.com/u/54004431?v=4",
"events_url": "https://api.github.com/users/nikhil-swamix/events{/privacy}",
"followers_url": "https://api.github.com/users/nikhil-swamix/followers",
"following_url": "https://api.github.com/users/nikhil-swamix/following{/other_user}",
"gists_url": "https://api.github.com/users/nikhil-swamix/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nikhil-swamix",
"id": 54004431,
"login": "nikhil-swamix",
"node_id": "MDQ6VXNlcjU0MDA0NDMx",
"organizations_url": "https://api.github.com/users/nikhil-swamix/orgs",
"received_events_url": "https://api.github.com/users/nikhil-swamix/received_events",
"repos_url": "https://api.github.com/users/nikhil-swamix/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nikhil-swamix/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nikhil-swamix/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nikhil-swamix",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-05-09T20:45:37Z | 2024-05-10T10:11:57Z | 2024-05-10T10:11:27Z | NONE | null | update latest figures. higher numbers means more trust.
downloads verified on pepy
dependents verified from github dependency graph. | {
"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/6698/reactions"
} | https://api.github.com/repos/psf/requests/issues/6698/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6698.diff",
"html_url": "https://github.com/psf/requests/pull/6698",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6698.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6698"
} | true | [
"We don't really update these numbers very often because it's not that important"
] |
https://api.github.com/repos/psf/requests/issues/6697 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6697/labels{/name} | https://api.github.com/repos/psf/requests/issues/6697/comments | https://api.github.com/repos/psf/requests/issues/6697/events | https://github.com/psf/requests/issues/6697 | 2,287,453,253 | I_kwDOABTKOs6IV8RF | 6,697 | Can't access trailers with the Request library | {
"avatar_url": "https://avatars.githubusercontent.com/u/164914051?v=4",
"events_url": "https://api.github.com/users/fmurray-r7/events{/privacy}",
"followers_url": "https://api.github.com/users/fmurray-r7/followers",
"following_url": "https://api.github.com/users/fmurray-r7/following{/other_user}",
"gists_url": "https://api.github.com/users/fmurray-r7/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/fmurray-r7",
"id": 164914051,
"login": "fmurray-r7",
"node_id": "U_kgDOCdRjgw",
"organizations_url": "https://api.github.com/users/fmurray-r7/orgs",
"received_events_url": "https://api.github.com/users/fmurray-r7/received_events",
"repos_url": "https://api.github.com/users/fmurray-r7/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/fmurray-r7/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/fmurray-r7/subscriptions",
"type": "User",
"url": "https://api.github.com/users/fmurray-r7",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-05-09T11:05:19Z | 2024-05-09T12:35:09Z | 2024-05-09T12:35:09Z | NONE | null | <!-- Summary. -->
Requests doesn't seem to support processing [Trailer](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer) response headers. While I know that Trailer support has been [discussed](https://github.com/psf/requests/issues/3613) [previously](https://github.com/psf/requests/issues/2281), some time has passed since then and I hope the issue can be reconsidered.
The desired use case is to add Trailer header to API responses but we cannot read them using the Request library.
Other frameworks in other languages ([Vert.x](https://vertx.io/docs/vertx-core/java/#_chunked_http_responses_and_trailers) for example) support Trailers, but not Python Requests.
## Expected Result
A Trailer response header has been added to a response, which is then read using Requests, the Trailer should be accessible.
<!-- What you expected. -->
## Actual Result
There is no way to access the Trailer in the response using Requests.
<!-- What happened instead. -->
| {
"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/6697/reactions"
} | https://api.github.com/repos/psf/requests/issues/6697/timeline | null | not_planned | null | null | false | [
"Nothing has changed since that thread. We still rely on httplib and httplib (or now http.client) does not support trailers for HTTP/1.1. i suspect some other http clients may be able to support this as they are built on h11 but whether they do or don't I couldn't tell you"
] |
https://api.github.com/repos/psf/requests/issues/6696 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6696/labels{/name} | https://api.github.com/repos/psf/requests/issues/6696/comments | https://api.github.com/repos/psf/requests/issues/6696/events | https://github.com/psf/requests/pull/6696 | 2,285,865,468 | PR_kwDOABTKOs5u5SRG | 6,696 | Docs update: warn that Session.verify is ignored if REQUESTS_CA_BUNDLE is set | {
"avatar_url": "https://avatars.githubusercontent.com/u/1242316?v=4",
"events_url": "https://api.github.com/users/StefanKopieczek/events{/privacy}",
"followers_url": "https://api.github.com/users/StefanKopieczek/followers",
"following_url": "https://api.github.com/users/StefanKopieczek/following{/other_user}",
"gists_url": "https://api.github.com/users/StefanKopieczek/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/StefanKopieczek",
"id": 1242316,
"login": "StefanKopieczek",
"node_id": "MDQ6VXNlcjEyNDIzMTY=",
"organizations_url": "https://api.github.com/users/StefanKopieczek/orgs",
"received_events_url": "https://api.github.com/users/StefanKopieczek/received_events",
"repos_url": "https://api.github.com/users/StefanKopieczek/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/StefanKopieczek/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/StefanKopieczek/subscriptions",
"type": "User",
"url": "https://api.github.com/users/StefanKopieczek",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 0 | 2024-05-08T15:21:43Z | 2024-05-08T16:28:36Z | null | NONE | null | Issue #3829 tracks that Session.verify is ignored whenever `REQUESTS_CA_BUNDLES` or `CURL_CA_BUNDLES` is set. The underlying behavior will apparently be changed in 3.x, but in the meantime it would be helpful to call out the behavior in the docs to avoid catching people out (the issue has been locked due to a large number of comments).
I'm happy to rework this PR as needed, but it'd be great to get something in the docs about this in one form or another to help prevent people hitting this.
Thanks in advance for your thoughts!
---
## Change Details
* Added a `warning::` callout to the relevant section of the docs.
## Alternate Approaches Considered
I initially wrote out a longer section detailing the semantics for how the various options interact — but all the other interactions are very intuitive, so this felt like overkill. Let me know if you'd prefer that approach.
This section of the docs is also a bit callout heavy, so I'm happy to inline the text rather than put it in a callout, if you prefer. | 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/6696/reactions"
} | https://api.github.com/repos/psf/requests/issues/6696/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6696.diff",
"html_url": "https://github.com/psf/requests/pull/6696",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6696.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6696"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6695 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6695/labels{/name} | https://api.github.com/repos/psf/requests/issues/6695/comments | https://api.github.com/repos/psf/requests/issues/6695/events | https://github.com/psf/requests/issues/6695 | 2,285,264,314 | I_kwDOABTKOs6INl26 | 6,695 | Session.verify ignored if REQUEST_CA_BUNDLES is set; behaviour not documented. | {
"avatar_url": "https://avatars.githubusercontent.com/u/1242316?v=4",
"events_url": "https://api.github.com/users/StefanKopieczek/events{/privacy}",
"followers_url": "https://api.github.com/users/StefanKopieczek/followers",
"following_url": "https://api.github.com/users/StefanKopieczek/following{/other_user}",
"gists_url": "https://api.github.com/users/StefanKopieczek/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/StefanKopieczek",
"id": 1242316,
"login": "StefanKopieczek",
"node_id": "MDQ6VXNlcjEyNDIzMTY=",
"organizations_url": "https://api.github.com/users/StefanKopieczek/orgs",
"received_events_url": "https://api.github.com/users/StefanKopieczek/received_events",
"repos_url": "https://api.github.com/users/StefanKopieczek/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/StefanKopieczek/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/StefanKopieczek/subscriptions",
"type": "User",
"url": "https://api.github.com/users/StefanKopieczek",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 4 | 2024-05-08T10:34:33Z | 2024-05-08T13:23:58Z | 2024-05-08T12:53:34Z | NONE | null | ## Summary
Session-level CA overrides are ignored if either `REQUEST_CA_BUNDLES` or `CURL_CA_BUNDLES` is set.
This is unintuitive as you'd expect a per-session override to take precedence over global state. It's also not mentioned in [the documentation](https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification).
### Repro
The following script normally outputs '200', but instead fails with SSL verification errors if either of the above environment variables are set (because `session.verify = False` gets ignored).
import requests
session = requests.Session()
session.verify = False
r = session.get('https://self-signed.badssl.com')
print(r.status_code)
## Expected Result
I'd intuitively expect the repro above to return 200 regardless of the state of the environment variables.
## Actual Result
If `REQUESTS_CA_BUNDLE` or `CURL_CA_BUNDLE` is set, the script above fails with verification errors, even though `session.verify = False`.
## Reproduction Steps
1. Create a file `test.py` containing the script from the **Summary** section above.
2. Run `export REQUESTS_CA_BUNDLE=$(python3 -c "import certifi; print(certifi.where())")`
* This sets `REQUESTS_CA_BUNDLE` to the system default truststore.
* Any other valid value for `REQUESTS_CA_BUNDLE` would work here too.
3. Run `python3 test.py` and observe SSL validation errors.
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": "4.0.0"
},
"cryptography": {
"version": "3.4.8"
},
"idna": {
"version": "3.3"
},
"implementation": {
"name": "CPython",
"version": "3.10.12"
},
"platform": {
"release": "5.15.0-102-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "30000020",
"version": "21.0.0"
},
"requests": {
"version": "2.25.1"
},
"system_ssl": {
"version": "30000020"
},
"urllib3": {
"version": "1.26.5"
},
"using_pyopenssl": true
}
```
I have also reproduced this on requests 2.31.0.
## Other Impact
This behaviour also impacts other uses of `session.verify`, such as `session.verify = 'my_custom_ca_bundle.pem'` – if the environment variables are present, the custom CA bundle will not be used.
## Proposed Fix
I'm happy to submit a docs PR to clarify this behaviour. In an ideal world I think `session.verify` would just take precedence over the environment variables, but making that change might break consumers that are inadvertently relying on the current semantics – so I think a docs change is the best we can do.
If you do want the behavioural change, I'm also happy to submit a PR for that instead of the docs fix.
## Thanks
I wanted to take this opportunity to say thanks for a fantastic library – I've been a happy user of `requests` for over a decade and I really appreciate the hard work of all involved :) | {
"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/6695/reactions"
} | https://api.github.com/repos/psf/requests/issues/6695/timeline | null | not_planned | null | null | false | [
"Additional note for anyone affected: setting `session.trust_env = False` works around this issue by disregarding the environment variables. However, this will also disable detection of any proxies declared in the environment.",
"Duplicate of #3829",
"In the future, please search **closed and** open issues before creating new ones that are duplicates.",
"Thanks @sigmavirus24 – I did search but didn't find it. I appreciate the redirect."
] |
https://api.github.com/repos/psf/requests/issues/6694 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6694/labels{/name} | https://api.github.com/repos/psf/requests/issues/6694/comments | https://api.github.com/repos/psf/requests/issues/6694/events | https://github.com/psf/requests/issues/6694 | 2,281,801,737 | I_kwDOABTKOs6IAYgJ | 6,694 | Support usage of PKCS#11 Hardware Security Modules where applicable | {
"avatar_url": "https://avatars.githubusercontent.com/u/388671?v=4",
"events_url": "https://api.github.com/users/stevecj/events{/privacy}",
"followers_url": "https://api.github.com/users/stevecj/followers",
"following_url": "https://api.github.com/users/stevecj/following{/other_user}",
"gists_url": "https://api.github.com/users/stevecj/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/stevecj",
"id": 388671,
"login": "stevecj",
"node_id": "MDQ6VXNlcjM4ODY3MQ==",
"organizations_url": "https://api.github.com/users/stevecj/orgs",
"received_events_url": "https://api.github.com/users/stevecj/received_events",
"repos_url": "https://api.github.com/users/stevecj/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/stevecj/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stevecj/subscriptions",
"type": "User",
"url": "https://api.github.com/users/stevecj",
"user_view_type": "public"
} | [
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156041422,
"name": "actions/autoclose-feat",
"node_id": "LA_kwDOABTKOs8AAAABbu28zg",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-feat"
}
] | closed | true | null | [] | null | 1 | 2024-05-06T21:23:49Z | 2024-05-06T21:24:01Z | 2024-05-06T21:24:01Z | NONE | off-topic | Although "requests is not accepting feature requests at this time" I can't find any other way/place to pen a discussion about this.
In the application I am working on, we'd like to add support for using HSMs in the future. It's not obvious how to do that effectively, however, unless support for it is included in `requests`.
Are there any plans to try to add support for HSMs?
| {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6694/reactions"
} | https://api.github.com/repos/psf/requests/issues/6694/timeline | null | not_planned | null | null | false | [
"As described in the template, Requests is not accepting feature requests"
] |
https://api.github.com/repos/psf/requests/issues/6693 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6693/labels{/name} | https://api.github.com/repos/psf/requests/issues/6693/comments | https://api.github.com/repos/psf/requests/issues/6693/events | https://github.com/psf/requests/pull/6693 | 2,281,336,920 | PR_kwDOABTKOs5uqUZp | 6,693 | fix: enviroment variable PYTHONHTTPSVERIFY isn't take in consideration on https requests. | {
"avatar_url": "https://avatars.githubusercontent.com/u/5341637?v=4",
"events_url": "https://api.github.com/users/alvieirajr/events{/privacy}",
"followers_url": "https://api.github.com/users/alvieirajr/followers",
"following_url": "https://api.github.com/users/alvieirajr/following{/other_user}",
"gists_url": "https://api.github.com/users/alvieirajr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alvieirajr",
"id": 5341637,
"login": "alvieirajr",
"node_id": "MDQ6VXNlcjUzNDE2Mzc=",
"organizations_url": "https://api.github.com/users/alvieirajr/orgs",
"received_events_url": "https://api.github.com/users/alvieirajr/received_events",
"repos_url": "https://api.github.com/users/alvieirajr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alvieirajr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alvieirajr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alvieirajr",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 2 | 2024-05-06T17:06:09Z | 2024-05-07T01:59:24Z | null | NONE | null | In case of the ssl certificate of destination host has expired isn't possible to ignore the cert validation using env PYTHONHTTPSVERIFY=0. | 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/6693/reactions"
} | https://api.github.com/repos/psf/requests/issues/6693/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6693.diff",
"html_url": "https://github.com/psf/requests/pull/6693",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6693.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6693"
} | true | [
"We have never supported this: https://requests.readthedocs.io/en/latest/search/?q=PYTHONHTTPSVERIFY",
"- @sigmavirus24: \r\n\r\nIf packages that depend on the \"request\" package encapsulate the get() method in a way that does not give the user the option of determining whether or not to perform SSL validation, this makes it impossible to use the target endpoint if its certificate is expired. An example of this is the hugging face package. Because of this, I advocate the need to empower the user to be able to bypass the SSL check if the package they use does not provide this capability. As it stands, if the package used does not support bypassing validation and the certificate has expired, the project being built stops working until the external endpoint has its certificate updated (if it is updated). Because of this I understand that it would be a case of fixing.\r\n\r\nIf we agree that this need is valid, we then move on to the strategy of how this should be done in terms of implementation (since in terms of bureaucratic process I am still a noob in the python project, I only have 3 months in this universe). I advocate the use of the PYTHONHTTPSVERIFY environment variable because it has already been used within the Python ecosystem to signal, for example, that pip ignores SSL validation in previous versions.\r\n\r\nI suggest using this environment variable for the sake of uniformity but I am open to suggestions."
] |
https://api.github.com/repos/psf/requests/issues/6692 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6692/labels{/name} | https://api.github.com/repos/psf/requests/issues/6692/comments | https://api.github.com/repos/psf/requests/issues/6692/events | https://github.com/psf/requests/issues/6692 | 2,271,944,144 | I_kwDOABTKOs6Hax3Q | 6,692 | requests.request does not check method parameter | {
"avatar_url": "https://avatars.githubusercontent.com/u/96337712?v=4",
"events_url": "https://api.github.com/users/Michal-Martinek/events{/privacy}",
"followers_url": "https://api.github.com/users/Michal-Martinek/followers",
"following_url": "https://api.github.com/users/Michal-Martinek/following{/other_user}",
"gists_url": "https://api.github.com/users/Michal-Martinek/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Michal-Martinek",
"id": 96337712,
"login": "Michal-Martinek",
"node_id": "U_kgDOBb3_MA",
"organizations_url": "https://api.github.com/users/Michal-Martinek/orgs",
"received_events_url": "https://api.github.com/users/Michal-Martinek/received_events",
"repos_url": "https://api.github.com/users/Michal-Martinek/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Michal-Martinek/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Michal-Martinek/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Michal-Martinek",
"user_view_type": "public"
} | [
{
"color": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
}
] | closed | false | null | [] | null | 1 | 2024-04-30T16:15:10Z | 2024-05-01T01:43:53Z | 2024-05-01T01:43:53Z | NONE | null |
```
res = requests.request(method='155661', url='https...')
```
doesn't raise any error (warning) for totally unreasonable value for **method** parameter.
It leads to bugs. | {
"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/6692/reactions"
} | https://api.github.com/repos/psf/requests/issues/6692/timeline | null | not_planned | null | null | false | [
"Hi @Michal-Martinek, this is intentional design. There are many verbs we do not support directly, but may be used such as WebDAV. We don't intend to enumerate all possible options in our library, so it is left to the end user to determine their needs.\r\n\r\nYou'll find you can successfully send your request to well-functioning web servers, so I don't think we intend to change the existing behavior. We should be clear about what \"bug\" means in this case. If there is unexpected behavior in Requests, can you please provide an exact stacktrace or behavior issue? If the problem is the web server returns a non-200 response, I'd propose we close this as working as intended."
] |
https://api.github.com/repos/psf/requests/issues/6691 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6691/labels{/name} | https://api.github.com/repos/psf/requests/issues/6691/comments | https://api.github.com/repos/psf/requests/issues/6691/events | https://github.com/psf/requests/issues/6691 | 2,266,198,520 | I_kwDOABTKOs6HE3H4 | 6,691 | not support HTTP2 header | {
"avatar_url": "https://avatars.githubusercontent.com/u/45868971?v=4",
"events_url": "https://api.github.com/users/geebadan/events{/privacy}",
"followers_url": "https://api.github.com/users/geebadan/followers",
"following_url": "https://api.github.com/users/geebadan/following{/other_user}",
"gists_url": "https://api.github.com/users/geebadan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/geebadan",
"id": 45868971,
"login": "geebadan",
"node_id": "MDQ6VXNlcjQ1ODY4OTcx",
"organizations_url": "https://api.github.com/users/geebadan/orgs",
"received_events_url": "https://api.github.com/users/geebadan/received_events",
"repos_url": "https://api.github.com/users/geebadan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/geebadan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/geebadan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/geebadan",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2024-04-26T17:22:27Z | 2024-04-26T19:55:17Z | 2024-04-26T19:55:14Z | NONE | null | not support http2 header
example:
```
import requests
from hyper.contrib import HTTP20Adapter
headers={':path': '/hello}'
s = requests.Session()
s.mount('https://http2bin.org', HTTP20Adapter())
r = s.get('https://http2bin.org/get', headers=headers)
print(r.status_code)
# raise Invalid leading whitespace, reserved character(s), or return character(s) in header name: ':path'
```
| {
"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/6691/reactions"
} | https://api.github.com/repos/psf/requests/issues/6691/timeline | null | not_planned | null | null | false | [
"This is a duplicate "
] |
https://api.github.com/repos/psf/requests/issues/6690 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6690/labels{/name} | https://api.github.com/repos/psf/requests/issues/6690/comments | https://api.github.com/repos/psf/requests/issues/6690/events | https://github.com/psf/requests/issues/6690 | 2,265,778,069 | I_kwDOABTKOs6HDQeV | 6,690 | Upgrade idna to 3.7 for CVE-2024-3651 | {
"avatar_url": "https://avatars.githubusercontent.com/u/123113322?v=4",
"events_url": "https://api.github.com/users/carlos-villavicencio-adsk/events{/privacy}",
"followers_url": "https://api.github.com/users/carlos-villavicencio-adsk/followers",
"following_url": "https://api.github.com/users/carlos-villavicencio-adsk/following{/other_user}",
"gists_url": "https://api.github.com/users/carlos-villavicencio-adsk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/carlos-villavicencio-adsk",
"id": 123113322,
"login": "carlos-villavicencio-adsk",
"node_id": "U_kgDOB1aPag",
"organizations_url": "https://api.github.com/users/carlos-villavicencio-adsk/orgs",
"received_events_url": "https://api.github.com/users/carlos-villavicencio-adsk/received_events",
"repos_url": "https://api.github.com/users/carlos-villavicencio-adsk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/carlos-villavicencio-adsk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/carlos-villavicencio-adsk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/carlos-villavicencio-adsk",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-04-26T13:20:01Z | 2024-04-26T14:05:34Z | 2024-04-26T14:05:34Z | NONE | null | <!-- Summary. -->
Now that idna released [3.7](https://github.com/kjd/idna/releases/tag/v3.7), can you consider bump the requires to `idna>=3.7,<4`?
## Expected Result
Get rid of [CVE-2024-3651](https://github.com/advisories/GHSA-jjg7-2v4v-x38h)
## Actual Result
SAST analysis shows [CVE-2024-3651](https://github.com/advisories/GHSA-jjg7-2v4v-x38h)
## Reproduction Steps
n/a
## System Information
n/a
<!-- 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/6690/reactions"
} | https://api.github.com/repos/psf/requests/issues/6690/timeline | null | not_planned | null | null | false | [
"Use a better SAST. \n\nThe [requirement](https://github.com/psf/requests/blob/main/setup.cfg#L9) does not forbid you using 3.7. If you aren't also managing your transitive dependency versions a reinstall of requests should pull this unless you have something else blocking you from using that version. "
] |
https://api.github.com/repos/psf/requests/issues/6689 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6689/labels{/name} | https://api.github.com/repos/psf/requests/issues/6689/comments | https://api.github.com/repos/psf/requests/issues/6689/events | https://github.com/psf/requests/issues/6689 | 2,264,585,495 | I_kwDOABTKOs6G-tUX | 6,689 | Python hangs on import of the package | {
"avatar_url": "https://avatars.githubusercontent.com/u/57451206?v=4",
"events_url": "https://api.github.com/users/diasjoaocarlos/events{/privacy}",
"followers_url": "https://api.github.com/users/diasjoaocarlos/followers",
"following_url": "https://api.github.com/users/diasjoaocarlos/following{/other_user}",
"gists_url": "https://api.github.com/users/diasjoaocarlos/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/diasjoaocarlos",
"id": 57451206,
"login": "diasjoaocarlos",
"node_id": "MDQ6VXNlcjU3NDUxMjA2",
"organizations_url": "https://api.github.com/users/diasjoaocarlos/orgs",
"received_events_url": "https://api.github.com/users/diasjoaocarlos/received_events",
"repos_url": "https://api.github.com/users/diasjoaocarlos/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/diasjoaocarlos/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/diasjoaocarlos/subscriptions",
"type": "User",
"url": "https://api.github.com/users/diasjoaocarlos",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-04-25T22:17:19Z | 2024-04-25T23:22:27Z | 2024-04-25T23:22:27Z | NONE | null | <!-- requests package hangs on import -->
I have a Linux server (Ubuntu 22.04.3 LTS x86_64 GNU/Linux), where I have installed virtual environments. Two of them are having problems on importation of the requests package.
1. Environment python3=3.10.12, requests=2.25.1 :
```
$ python3 -v
...
>>> import requests
# /usr/lib/python3/dist-packages/requests/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/__init__.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/__init__.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/__future__.cpython-310.pyc matches /usr/lib/python3.10/__future__.py
# code object from '/usr/lib/python3.10/__pycache__/__future__.cpython-310.pyc'
import '__future__' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8eec0d0>
# /usr/lib/python3.10/logging/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3.10/logging/__init__.py
# code object from '/usr/lib/python3.10/logging/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/traceback.cpython-310.pyc matches /usr/lib/python3.10/traceback.py
# code object from '/usr/lib/python3.10/__pycache__/traceback.cpython-310.pyc'
import 'traceback' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8eef850>
# /usr/lib/python3.10/__pycache__/weakref.cpython-310.pyc matches /usr/lib/python3.10/weakref.py
# code object from '/usr/lib/python3.10/__pycache__/weakref.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/_weakrefset.cpython-310.pyc matches /usr/lib/python3.10/_weakrefset.py
# code object from '/usr/lib/python3.10/__pycache__/_weakrefset.cpython-310.pyc'
import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8c59120>
import 'weakref' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8c58430>
# /usr/lib/python3.10/__pycache__/string.cpython-310.pyc matches /usr/lib/python3.10/string.py
# code object from '/usr/lib/python3.10/__pycache__/string.cpython-310.pyc'
import '_string' # <class '_frozen_importlib.BuiltinImporter'>
import 'string' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8c59b10>
# /usr/lib/python3.10/__pycache__/threading.cpython-310.pyc matches /usr/lib/python3.10/threading.py
# code object from '/usr/lib/python3.10/__pycache__/threading.cpython-310.pyc'
import 'threading' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8c5a290>
import 'logging' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8eed900>
# /usr/lib/python3/dist-packages/urllib3/__pycache__/exceptions.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/exceptions.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/exceptions.cpython-310.pyc'
# /usr/lib/python3/dist-packages/__pycache__/six.cpython-310.pyc matches /usr/lib/python3/dist-packages/six.py
# code object from '/usr/lib/python3/dist-packages/__pycache__/six.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/struct.cpython-310.pyc matches /usr/lib/python3.10/struct.py
# code object from '/usr/lib/python3.10/__pycache__/struct.cpython-310.pyc'
import '_struct' # <class '_frozen_importlib.BuiltinImporter'>
import 'struct' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cc5480>
import 'six' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cac850>
import 'six.moves' # <six._SixMetaPathImporter object at 0x7f3cb8cadc00>
# /usr/lib/python3.10/http/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3.10/http/__init__.py
# code object from '/usr/lib/python3.10/http/__pycache__/__init__.cpython-310.pyc'
import 'http' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cacf70>
# /usr/lib/python3.10/http/__pycache__/client.cpython-310.pyc matches /usr/lib/python3.10/http/client.py
# code object from '/usr/lib/python3.10/http/__pycache__/client.cpython-310.pyc'
# /usr/lib/python3.10/email/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3.10/email/__init__.py
# code object from '/usr/lib/python3.10/email/__pycache__/__init__.cpython-310.pyc'
import 'email' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cc6d10>
# /usr/lib/python3.10/email/__pycache__/parser.cpython-310.pyc matches /usr/lib/python3.10/email/parser.py
# code object from '/usr/lib/python3.10/email/__pycache__/parser.cpython-310.pyc'
# /usr/lib/python3.10/email/__pycache__/feedparser.cpython-310.pyc matches /usr/lib/python3.10/email/feedparser.py
# code object from '/usr/lib/python3.10/email/__pycache__/feedparser.cpython-310.pyc'
# /usr/lib/python3.10/email/__pycache__/errors.cpython-310.pyc matches /usr/lib/python3.10/email/errors.py
# code object from '/usr/lib/python3.10/email/__pycache__/errors.cpython-310.pyc'
import 'email.errors' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cc7910>
# /usr/lib/python3.10/email/__pycache__/_policybase.cpython-310.pyc matches /usr/lib/python3.10/email/_policybase.py
# code object from '/usr/lib/python3.10/email/__pycache__/_policybase.cpython-310.pyc'
# /usr/lib/python3.10/email/__pycache__/header.cpython-310.pyc matches /usr/lib/python3.10/email/header.py
# code object from '/usr/lib/python3.10/email/__pycache__/header.cpython-310.pyc'
import 'binascii' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.10/email/__pycache__/quoprimime.cpython-310.pyc matches /usr/lib/python3.10/email/quoprimime.py
# code object from '/usr/lib/python3.10/email/__pycache__/quoprimime.cpython-310.pyc'
import 'email.quoprimime' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf5510>
# /usr/lib/python3.10/email/__pycache__/base64mime.cpython-310.pyc matches /usr/lib/python3.10/email/base64mime.py
# code object from '/usr/lib/python3.10/email/__pycache__/base64mime.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/base64.cpython-310.pyc matches /usr/lib/python3.10/base64.py
# code object from '/usr/lib/python3.10/__pycache__/base64.cpython-310.pyc'
import 'base64' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf5c00>
import 'email.base64mime' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf5a20>
# /usr/lib/python3.10/email/__pycache__/charset.cpython-310.pyc matches /usr/lib/python3.10/email/charset.py
# code object from '/usr/lib/python3.10/email/__pycache__/charset.cpython-310.pyc'
# /usr/lib/python3.10/email/__pycache__/encoders.cpython-310.pyc matches /usr/lib/python3.10/email/encoders.py
# code object from '/usr/lib/python3.10/email/__pycache__/encoders.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/quopri.cpython-310.pyc matches /usr/lib/python3.10/quopri.py
# code object from '/usr/lib/python3.10/__pycache__/quopri.cpython-310.pyc'
import 'quopri' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf6fb0>
import 'email.encoders' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf6cb0>
import 'email.charset' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf6830>
import 'email.header' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf4d00>
# /usr/lib/python3.10/email/__pycache__/utils.cpython-310.pyc matches /usr/lib/python3.10/email/utils.py
# code object from '/usr/lib/python3.10/email/__pycache__/utils.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/random.cpython-310.pyc matches /usr/lib/python3.10/random.py
# code object from '/usr/lib/python3.10/__pycache__/random.cpython-310.pyc'
import 'math' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.10/__pycache__/bisect.cpython-310.pyc matches /usr/lib/python3.10/bisect.py
# code object from '/usr/lib/python3.10/__pycache__/bisect.cpython-310.pyc'
import '_bisect' # <class '_frozen_importlib.BuiltinImporter'>
import 'bisect' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b34430>
import '_random' # <class '_frozen_importlib.BuiltinImporter'>
import '_sha512' # <class '_frozen_importlib.BuiltinImporter'>
import 'random' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf77f0>
# /usr/lib/python3.10/__pycache__/socket.cpython-310.pyc matches /usr/lib/python3.10/socket.py
# code object from '/usr/lib/python3.10/__pycache__/socket.cpython-310.pyc'
import '_socket' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.10/__pycache__/selectors.cpython-310.pyc matches /usr/lib/python3.10/selectors.py
# code object from '/usr/lib/python3.10/__pycache__/selectors.cpython-310.pyc'
import 'select' # <class '_frozen_importlib.BuiltinImporter'>
import 'selectors' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b35210>
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
import 'array' # <class '_frozen_importlib.BuiltinImporter'>
import 'socket' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b346d0>
# /usr/lib/python3.10/__pycache__/datetime.cpython-310.pyc matches /usr/lib/python3.10/datetime.py
# code object from '/usr/lib/python3.10/__pycache__/datetime.cpython-310.pyc'
import '_datetime' # <class '_frozen_importlib.BuiltinImporter'>
import 'datetime' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b34880>
# /usr/lib/python3.10/urllib/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3.10/urllib/__init__.py
# code object from '/usr/lib/python3.10/urllib/__pycache__/__init__.cpython-310.pyc'
import 'urllib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b37070>
# /usr/lib/python3.10/urllib/__pycache__/parse.cpython-310.pyc matches /usr/lib/python3.10/urllib/parse.py
# code object from '/usr/lib/python3.10/urllib/__pycache__/parse.cpython-310.pyc'
import 'urllib.parse' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b37010>
# /usr/lib/python3.10/email/__pycache__/_parseaddr.cpython-310.pyc matches /usr/lib/python3.10/email/_parseaddr.py
# code object from '/usr/lib/python3.10/email/__pycache__/_parseaddr.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/calendar.cpython-310.pyc matches /usr/lib/python3.10/calendar.py
# code object from '/usr/lib/python3.10/__pycache__/calendar.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/locale.cpython-310.pyc matches /usr/lib/python3.10/locale.py
# code object from '/usr/lib/python3.10/__pycache__/locale.cpython-310.pyc'
import 'locale' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b731f0>
import 'calendar' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b71000>
import 'email._parseaddr' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b71210>
import 'email.utils' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf7670>
import 'email._policybase' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cf4310>
import 'email.feedparser' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cc7280>
import 'email.parser' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cc6e30>
# /usr/lib/python3.10/email/__pycache__/message.cpython-310.pyc matches /usr/lib/python3.10/email/message.py
# code object from '/usr/lib/python3.10/email/__pycache__/message.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/uu.cpython-310.pyc matches /usr/lib/python3.10/uu.py
# code object from '/usr/lib/python3.10/__pycache__/uu.cpython-310.pyc'
import 'uu' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8bc1390>
# /usr/lib/python3.10/email/__pycache__/_encoded_words.cpython-310.pyc matches /usr/lib/python3.10/email/_encoded_words.py
# code object from '/usr/lib/python3.10/email/__pycache__/_encoded_words.cpython-310.pyc'
import 'email._encoded_words' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8bc1660>
# /usr/lib/python3.10/email/__pycache__/iterators.cpython-310.pyc matches /usr/lib/python3.10/email/iterators.py
# code object from '/usr/lib/python3.10/email/__pycache__/iterators.cpython-310.pyc'
import 'email.iterators' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8bc1ab0>
import 'email.message' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cc76d0>
# /usr/lib/python3.10/__pycache__/ssl.cpython-310.pyc matches /usr/lib/python3.10/ssl.py
# code object from '/usr/lib/python3.10/__pycache__/ssl.cpython-310.pyc'
# extension module '_ssl' loaded from '/usr/lib/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-gnu.so'
# extension module '_ssl' executed from '/usr/lib/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-gnu.so'
import '_ssl' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f3cb8bc3610>
import 'ssl' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8bc1ea0>
import 'http.client' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cacc40>
import 'six.moves.http_client' # <six._SixMetaPathImporter object at 0x7f3cb8cadc00>
import 'urllib3.exceptions' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8eee3e0>
# /usr/lib/python3/dist-packages/urllib3/__pycache__/_version.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/_version.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/_version.cpython-310.pyc'
import 'urllib3._version' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cac220>
# /usr/lib/python3/dist-packages/urllib3/__pycache__/connectionpool.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/connectionpool.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/connectionpool.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/__pycache__/_collections.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/_collections.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/_collections.cpython-310.pyc'
import 'urllib3._collections' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb851b220>
# /usr/lib/python3/dist-packages/urllib3/__pycache__/connection.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/connection.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/connection.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/__init__.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/connection.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/connection.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/connection.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/contrib/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/contrib/__init__.py
# code object from '/usr/lib/python3/dist-packages/urllib3/contrib/__pycache__/__init__.cpython-310.pyc'
import 'urllib3.contrib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854c9d0>
# /usr/lib/python3/dist-packages/urllib3/contrib/__pycache__/_appengine_environ.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/contrib/_appengine_environ.py
# code object from '/usr/lib/python3/dist-packages/urllib3/contrib/__pycache__/_appengine_environ.cpython-310.pyc'
import 'urllib3.contrib._appengine_environ' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854cb80>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/wait.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/wait.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/wait.cpython-310.pyc'
import 'urllib3.util.wait' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854cd00>
import 'urllib3.util.connection' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854c700>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/request.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/request.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/request.cpython-310.pyc'
import 'urllib3.util.request' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854d000>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/response.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/response.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/response.cpython-310.pyc'
import 'urllib3.util.response' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854d0c0>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/retry.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/retry.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/retry.cpython-310.pyc'
import 'urllib3.util.retry' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854d150>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/ssl_.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/ssl_.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/ssl_.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/hmac.cpython-310.pyc matches /usr/lib/python3.10/hmac.py
# code object from '/usr/lib/python3.10/__pycache__/hmac.cpython-310.pyc'
# extension module '_hashlib' loaded from '/usr/lib/python3.10/lib-dynload/_hashlib.cpython-310-x86_64-linux-gnu.so'
# extension module '_hashlib' executed from '/usr/lib/python3.10/lib-dynload/_hashlib.cpython-310-x86_64-linux-gnu.so'
import '_hashlib' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f3cb8b37c40>
# /usr/lib/python3.10/__pycache__/hashlib.cpython-310.pyc matches /usr/lib/python3.10/hashlib.py
# code object from '/usr/lib/python3.10/__pycache__/hashlib.cpython-310.pyc'
import '_blake2' # <class '_frozen_importlib.BuiltinImporter'>
import 'hashlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b375b0>
import 'hmac' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854e0e0>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/url.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/url.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/url.cpython-310.pyc'
import 'urllib3.util.url' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8b37460>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/ssltransport.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/ssltransport.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/ssltransport.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/packages/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/packages/__init__.py
# code object from '/usr/lib/python3/dist-packages/urllib3/packages/__pycache__/__init__.cpython-310.pyc'
import 'urllib3.packages' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854ece0>
# destroy urllib3.util.ssltransport
import 'urllib3.util.ssl_' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854dd20>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/timeout.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/timeout.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/timeout.cpython-310.pyc'
import 'urllib3.util.timeout' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854dbd0>
import 'urllib3.util' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854c400>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/proxy.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/proxy.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/proxy.cpython-310.pyc'
import 'urllib3.util.proxy' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854f370>
# /usr/lib/python3/dist-packages/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/packages/ssl_match_hostname/__init__.py
# code object from '/usr/lib/python3/dist-packages/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/packages/ssl_match_hostname/_implementation.py
# code object from '/usr/lib/python3/dist-packages/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/ipaddress.cpython-310.pyc matches /usr/lib/python3.10/ipaddress.py
# code object from '/usr/lib/python3.10/__pycache__/ipaddress.cpython-310.pyc'
import 'ipaddress' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854ec80>
import 'urllib3.packages.ssl_match_hostname._implementation' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854f130>
import 'urllib3.packages.ssl_match_hostname' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854f340>
import 'urllib3.connection' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb851bbe0>
# /usr/lib/python3.10/__pycache__/queue.cpython-310.pyc matches /usr/lib/python3.10/queue.py
# code object from '/usr/lib/python3.10/__pycache__/queue.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/heapq.cpython-310.pyc matches /usr/lib/python3.10/heapq.py
# code object from '/usr/lib/python3.10/__pycache__/heapq.cpython-310.pyc'
import '_heapq' # <class '_frozen_importlib.BuiltinImporter'>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb858b4f0>
# extension module '_queue' loaded from '/usr/lib/python3.10/lib-dynload/_queue.cpython-310-x86_64-linux-gnu.so'
# extension module '_queue' executed from '/usr/lib/python3.10/lib-dynload/_queue.cpython-310-x86_64-linux-gnu.so'
import '_queue' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f3cb858b5b0>
import 'queue' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb854f310>
# /usr/lib/python3/dist-packages/urllib3/__pycache__/request.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/request.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/request.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/__pycache__/filepost.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/filepost.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/filepost.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/__pycache__/fields.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/fields.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/fields.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/mimetypes.cpython-310.pyc matches /usr/lib/python3.10/mimetypes.py
# code object from '/usr/lib/python3.10/__pycache__/mimetypes.cpython-310.pyc'
import 'mimetypes' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b43d0>
import 'urllib3.fields' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb858beb0>
import 'urllib3.filepost' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb858bb50>
import 'six.moves.urllib' # <six._SixMetaPathImporter object at 0x7f3cb8cadc00>
import 'six.moves.urllib.parse' # <six._SixMetaPathImporter object at 0x7f3cb8cadc00>
import 'urllib3.request' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb858b8b0>
# /usr/lib/python3/dist-packages/urllib3/__pycache__/response.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/response.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/response.cpython-310.pyc'
import 'zlib' # <class '_frozen_importlib.BuiltinImporter'>
import 'urllib3.response' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb858b9d0>
# /usr/lib/python3/dist-packages/urllib3/util/__pycache__/queue.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/util/queue.py
# code object from '/usr/lib/python3/dist-packages/urllib3/util/__pycache__/queue.cpython-310.pyc'
import 'urllib3.util.queue' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b52d0>
import 'urllib3.connectionpool' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8cac340>
# /usr/lib/python3/dist-packages/urllib3/__pycache__/poolmanager.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/poolmanager.py
# code object from '/usr/lib/python3/dist-packages/urllib3/__pycache__/poolmanager.cpython-310.pyc'
import 'urllib3.poolmanager' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b5450>
import 'urllib3' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8eed030>
# /usr/lib/python3/dist-packages/chardet/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/__init__.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/universaldetector.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/universaldetector.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/universaldetector.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/charsetgroupprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/charsetgroupprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/charsetgroupprober.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/enums.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/enums.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/enums.cpython-310.pyc'
import 'chardet.enums' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b6a70>
# /usr/lib/python3/dist-packages/chardet/__pycache__/charsetprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/charsetprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/charsetprober.cpython-310.pyc'
import 'chardet.charsetprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b6680>
import 'chardet.charsetgroupprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b6ce0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/escprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/escprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/escprober.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/codingstatemachine.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/codingstatemachine.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/codingstatemachine.cpython-310.pyc'
import 'chardet.codingstatemachine' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b5c90>
# /usr/lib/python3/dist-packages/chardet/__pycache__/escsm.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/escsm.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/escsm.cpython-310.pyc'
import 'chardet.escsm' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b79a0>
import 'chardet.escprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b60b0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/latin1prober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/latin1prober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/latin1prober.cpython-310.pyc'
import 'chardet.latin1prober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b79d0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/mbcsgroupprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/mbcsgroupprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/mbcsgroupprober.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/utf8prober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/utf8prober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/utf8prober.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/mbcssm.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/mbcssm.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/mbcssm.cpython-310.pyc'
import 'chardet.mbcssm' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e8370>
import 'chardet.utf8prober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b7fa0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/sjisprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/sjisprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/sjisprober.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/mbcharsetprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/mbcharsetprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/mbcharsetprober.cpython-310.pyc'
import 'chardet.mbcharsetprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e8790>
# /usr/lib/python3/dist-packages/chardet/__pycache__/chardistribution.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/chardistribution.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/chardistribution.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/euctwfreq.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/euctwfreq.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/euctwfreq.cpython-310.pyc'
import 'chardet.euctwfreq' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e8f10>
# /usr/lib/python3/dist-packages/chardet/__pycache__/euckrfreq.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/euckrfreq.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/euckrfreq.cpython-310.pyc'
import 'chardet.euckrfreq' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e8fd0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/gb2312freq.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/gb2312freq.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/gb2312freq.cpython-310.pyc'
import 'chardet.gb2312freq' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e9060>
# /usr/lib/python3/dist-packages/chardet/__pycache__/big5freq.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/big5freq.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/big5freq.cpython-310.pyc'
import 'chardet.big5freq' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e90f0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/jisfreq.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/jisfreq.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/jisfreq.cpython-310.pyc'
import 'chardet.jisfreq' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e9180>
import 'chardet.chardistribution' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e8b50>
# /usr/lib/python3/dist-packages/chardet/__pycache__/jpcntx.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/jpcntx.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/jpcntx.cpython-310.pyc'
import 'chardet.jpcntx' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e9480>
import 'chardet.sjisprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e83d0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/eucjpprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/eucjpprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/eucjpprober.cpython-310.pyc'
import 'chardet.eucjpprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e98a0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/gb2312prober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/gb2312prober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/gb2312prober.cpython-310.pyc'
import 'chardet.gb2312prober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e9b70>
# /usr/lib/python3/dist-packages/chardet/__pycache__/euckrprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/euckrprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/euckrprober.cpython-310.pyc'
import 'chardet.euckrprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e9d80>
# /usr/lib/python3/dist-packages/chardet/__pycache__/cp949prober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/cp949prober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/cp949prober.cpython-310.pyc'
import 'chardet.cp949prober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85e9fc0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/big5prober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/big5prober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/big5prober.cpython-310.pyc'
import 'chardet.big5prober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85ea200>
# /usr/lib/python3/dist-packages/chardet/__pycache__/euctwprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/euctwprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/euctwprober.cpython-310.pyc'
import 'chardet.euctwprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85ea440>
import 'chardet.mbcsgroupprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b7c40>
# /usr/lib/python3/dist-packages/chardet/__pycache__/sbcsgroupprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/sbcsgroupprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/sbcsgroupprober.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/hebrewprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/hebrewprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/hebrewprober.cpython-310.pyc'
import 'chardet.hebrewprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85ea740>
# /usr/lib/python3/dist-packages/chardet/__pycache__/langbulgarianmodel.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/langbulgarianmodel.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/langbulgarianmodel.cpython-310.pyc'
# /usr/lib/python3/dist-packages/chardet/__pycache__/sbcharsetprober.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/sbcharsetprober.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/sbcharsetprober.cpython-310.pyc'
import 'chardet.sbcharsetprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85eab00>
import 'chardet.langbulgarianmodel' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85ea9e0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/langgreekmodel.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/langgreekmodel.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/langgreekmodel.cpython-310.pyc'
import 'chardet.langgreekmodel' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85eb9d0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/langhebrewmodel.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/langhebrewmodel.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/langhebrewmodel.cpython-310.pyc'
import 'chardet.langhebrewmodel' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85eb940>
# /usr/lib/python3/dist-packages/chardet/__pycache__/langrussianmodel.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/langrussianmodel.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/langrussianmodel.cpython-310.pyc'
import 'chardet.langrussianmodel' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85eb8b0>
# /usr/lib/python3/dist-packages/chardet/__pycache__/langthaimodel.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/langthaimodel.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/langthaimodel.cpython-310.pyc'
import 'chardet.langthaimodel' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85eb820>
# /usr/lib/python3/dist-packages/chardet/__pycache__/langturkishmodel.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/langturkishmodel.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/langturkishmodel.cpython-310.pyc'
import 'chardet.langturkishmodel' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85eb790>
import 'chardet.sbcsgroupprober' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85ea5f0>
import 'chardet.universaldetector' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b7310>
# /usr/lib/python3/dist-packages/chardet/__pycache__/version.cpython-310.pyc matches /usr/lib/python3/dist-packages/chardet/version.py
# code object from '/usr/lib/python3/dist-packages/chardet/__pycache__/version.cpython-310.pyc'
import 'chardet.version' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b7340>
import 'chardet' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b6fe0>
# /usr/lib/python3/dist-packages/requests/__pycache__/exceptions.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/exceptions.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/exceptions.cpython-310.pyc'
import 'requests.exceptions' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85b7370>
# /usr/lib/python3/dist-packages/requests/__pycache__/__version__.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/__version__.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/__version__.cpython-310.pyc'
import 'requests.__version__' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85eb490>
# /usr/lib/python3/dist-packages/requests/__pycache__/utils.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/utils.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/utils.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/tempfile.cpython-310.pyc matches /usr/lib/python3.10/tempfile.py
# code object from '/usr/lib/python3.10/__pycache__/tempfile.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/shutil.cpython-310.pyc matches /usr/lib/python3.10/shutil.py
# code object from '/usr/lib/python3.10/__pycache__/shutil.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/fnmatch.cpython-310.pyc matches /usr/lib/python3.10/fnmatch.py
# code object from '/usr/lib/python3.10/__pycache__/fnmatch.cpython-310.pyc'
import 'fnmatch' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb84c1fc0>
# /usr/lib/python3.10/__pycache__/bz2.cpython-310.pyc matches /usr/lib/python3.10/bz2.py
# code object from '/usr/lib/python3.10/__pycache__/bz2.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/_compression.cpython-310.pyc matches /usr/lib/python3.10/_compression.py
# code object from '/usr/lib/python3.10/__pycache__/_compression.cpython-310.pyc'
import '_compression' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb84c2a70>
# extension module '_bz2' loaded from '/usr/lib/python3.10/lib-dynload/_bz2.cpython-310-x86_64-linux-gnu.so'
# extension module '_bz2' executed from '/usr/lib/python3.10/lib-dynload/_bz2.cpython-310-x86_64-linux-gnu.so'
import '_bz2' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f3cb84c2f80>
import 'bz2' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb84c22c0>
# /usr/lib/python3.10/__pycache__/lzma.cpython-310.pyc matches /usr/lib/python3.10/lzma.py
# code object from '/usr/lib/python3.10/__pycache__/lzma.cpython-310.pyc'
# extension module '_lzma' loaded from '/usr/lib/python3.10/lib-dynload/_lzma.cpython-310-x86_64-linux-gnu.so'
# extension module '_lzma' executed from '/usr/lib/python3.10/lib-dynload/_lzma.cpython-310-x86_64-linux-gnu.so'
import '_lzma' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f3cb84c3640>
import 'lzma' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb84c3010>
import 'shutil' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb84c1210>
import 'tempfile' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb84c01f0>
# /usr/lib/python3.10/__pycache__/zipfile.cpython-310.pyc matches /usr/lib/python3.10/zipfile.py
# code object from '/usr/lib/python3.10/__pycache__/zipfile.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/pathlib.cpython-310.pyc matches /usr/lib/python3.10/pathlib.py
# code object from '/usr/lib/python3.10/__pycache__/pathlib.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/ntpath.cpython-310.pyc matches /usr/lib/python3.10/ntpath.py
# code object from '/usr/lib/python3.10/__pycache__/ntpath.cpython-310.pyc'
import 'ntpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8247250>
import 'pathlib' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82455a0>
import 'zipfile' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb84c0760>
# /usr/lib/python3/dist-packages/requests/__pycache__/certs.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/certs.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/certs.cpython-310.pyc'
# /home/server/.local/lib/python3.10/site-packages/certifi/__pycache__/__init__.cpython-310.pyc matches /home/server/.local/lib/python3.10/site-packages/certifi/__init__.py
# code object from '/home/server/.local/lib/python3.10/site-packages/certifi/__pycache__/__init__.cpython-310.pyc'
# /home/server/.local/lib/python3.10/site-packages/certifi/__pycache__/core.cpython-310.pyc matches /home/server/.local/lib/python3.10/site-packages/certifi/core.py
# code object from '/home/server/.local/lib/python3.10/site-packages/certifi/__pycache__/core.cpython-310.pyc'
# /usr/lib/python3.10/importlib/__pycache__/resources.cpython-310.pyc matches /usr/lib/python3.10/importlib/resources.py
# code object from '/usr/lib/python3.10/importlib/__pycache__/resources.cpython-310.pyc'
# /usr/lib/python3.10/importlib/__pycache__/_common.cpython-310.pyc matches /usr/lib/python3.10/importlib/_common.py
# code object from '/usr/lib/python3.10/importlib/__pycache__/_common.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/typing.cpython-310.pyc matches /usr/lib/python3.10/typing.py
# code object from '/usr/lib/python3.10/__pycache__/typing.cpython-310.pyc'
import 'typing' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82854e0>
# /usr/lib/python3.10/importlib/__pycache__/abc.cpython-310.pyc matches /usr/lib/python3.10/importlib/abc.py
# code object from '/usr/lib/python3.10/importlib/__pycache__/abc.cpython-310.pyc'
import 'importlib.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82867a0>
# /usr/lib/python3.10/importlib/__pycache__/_adapters.cpython-310.pyc matches /usr/lib/python3.10/importlib/_adapters.py
# code object from '/usr/lib/python3.10/importlib/__pycache__/_adapters.cpython-310.pyc'
import 'importlib._adapters' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82ce8f0>
import 'importlib._common' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8285060>
import 'importlib.resources' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8284970>
import 'certifi.core' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8284670>
import 'certifi' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82843a0>
import 'requests.certs' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8245030>
# /usr/lib/python3/dist-packages/requests/__pycache__/_internal_utils.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/_internal_utils.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/_internal_utils.cpython-310.pyc'
# /usr/lib/python3/dist-packages/requests/__pycache__/compat.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/compat.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/compat.cpython-310.pyc'
# /usr/lib/python3.10/json/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3.10/json/__init__.py
# code object from '/usr/lib/python3.10/json/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3.10/json/__pycache__/decoder.cpython-310.pyc matches /usr/lib/python3.10/json/decoder.py
# code object from '/usr/lib/python3.10/json/__pycache__/decoder.cpython-310.pyc'
# /usr/lib/python3.10/json/__pycache__/scanner.cpython-310.pyc matches /usr/lib/python3.10/json/scanner.py
# code object from '/usr/lib/python3.10/json/__pycache__/scanner.cpython-310.pyc'
# extension module '_json' loaded from '/usr/lib/python3.10/lib-dynload/_json.cpython-310-x86_64-linux-gnu.so'
# extension module '_json' executed from '/usr/lib/python3.10/lib-dynload/_json.cpython-310-x86_64-linux-gnu.so'
import '_json' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f3cb82cf8b0>
import 'json.scanner' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82cf730>
import 'json.decoder' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82cf520>
# /usr/lib/python3.10/json/__pycache__/encoder.cpython-310.pyc matches /usr/lib/python3.10/json/encoder.py
# code object from '/usr/lib/python3.10/json/__pycache__/encoder.cpython-310.pyc'
import 'json.encoder' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82cf5b0>
import 'json' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82cf310>
# /usr/lib/python3.10/urllib/__pycache__/request.cpython-310.pyc matches /usr/lib/python3.10/urllib/request.py
# code object from '/usr/lib/python3.10/urllib/__pycache__/request.cpython-310.pyc'
# /usr/lib/python3.10/urllib/__pycache__/error.cpython-310.pyc matches /usr/lib/python3.10/urllib/error.py
# code object from '/usr/lib/python3.10/urllib/__pycache__/error.cpython-310.pyc'
# /usr/lib/python3.10/urllib/__pycache__/response.cpython-310.pyc matches /usr/lib/python3.10/urllib/response.py
# code object from '/usr/lib/python3.10/urllib/__pycache__/response.cpython-310.pyc'
import 'urllib.response' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8309f90>
import 'urllib.error' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8309b10>
import 'urllib.request' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82cf4f0>
# /usr/lib/python3.10/http/__pycache__/cookiejar.cpython-310.pyc matches /usr/lib/python3.10/http/cookiejar.py
# code object from '/usr/lib/python3.10/http/__pycache__/cookiejar.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/copy.cpython-310.pyc matches /usr/lib/python3.10/copy.py
# code object from '/usr/lib/python3.10/__pycache__/copy.cpython-310.pyc'
import 'copy' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb830b430>
import 'http.cookiejar' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb83085e0>
# /usr/lib/python3.10/http/__pycache__/cookies.cpython-310.pyc matches /usr/lib/python3.10/http/cookies.py
# code object from '/usr/lib/python3.10/http/__pycache__/cookies.cpython-310.pyc'
import 'http.cookies' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb830b9d0>
import 'requests.compat' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82847f0>
import 'requests._internal_utils' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb8284340>
# /usr/lib/python3/dist-packages/requests/__pycache__/cookies.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/cookies.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/cookies.cpython-310.pyc'
import 'requests.cookies' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb82843d0>
# /usr/lib/python3/dist-packages/requests/__pycache__/structures.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/structures.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/structures.cpython-310.pyc'
import 'requests.structures' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815cd90>
# /usr/lib/python3.10/importlib/__pycache__/readers.cpython-310.pyc matches /usr/lib/python3.10/importlib/readers.py
# code object from '/usr/lib/python3.10/importlib/__pycache__/readers.cpython-310.pyc'
import 'importlib.readers' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815d300>
import 'requests.utils' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb85eb3a0>
# /usr/lib/python3/dist-packages/requests/__pycache__/packages.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/packages.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/packages.cpython-310.pyc'
# /usr/lib/python3/dist-packages/idna/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3/dist-packages/idna/__init__.py
# code object from '/usr/lib/python3/dist-packages/idna/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3/dist-packages/idna/__pycache__/package_data.cpython-310.pyc matches /usr/lib/python3/dist-packages/idna/package_data.py
# code object from '/usr/lib/python3/dist-packages/idna/__pycache__/package_data.cpython-310.pyc'
import 'idna.package_data' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815ddb0>
# /usr/lib/python3/dist-packages/idna/__pycache__/core.cpython-310.pyc matches /usr/lib/python3/dist-packages/idna/core.py
# code object from '/usr/lib/python3/dist-packages/idna/__pycache__/core.cpython-310.pyc'
# /usr/lib/python3/dist-packages/idna/__pycache__/idnadata.cpython-310.pyc matches /usr/lib/python3/dist-packages/idna/idnadata.py
# code object from '/usr/lib/python3/dist-packages/idna/__pycache__/idnadata.cpython-310.pyc'
import 'idna.idnadata' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815e3b0>
import 'unicodedata' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3/dist-packages/idna/__pycache__/intranges.cpython-310.pyc matches /usr/lib/python3/dist-packages/idna/intranges.py
# code object from '/usr/lib/python3/dist-packages/idna/__pycache__/intranges.cpython-310.pyc'
import 'idna.intranges' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815e4d0>
import 'idna.core' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815de40>
import 'idna' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815d990>
import 'requests.packages' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815dab0>
# /usr/lib/python3/dist-packages/requests/__pycache__/models.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/models.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/models.cpython-310.pyc'
# /usr/lib/python3.10/encodings/__pycache__/idna.cpython-310.pyc matches /usr/lib/python3.10/encodings/idna.py
# code object from '/usr/lib/python3.10/encodings/__pycache__/idna.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/stringprep.cpython-310.pyc matches /usr/lib/python3.10/stringprep.py
# code object from '/usr/lib/python3.10/__pycache__/stringprep.cpython-310.pyc'
import 'stringprep' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815f310>
import 'encodings.idna' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815f010>
# /usr/lib/python3/dist-packages/requests/__pycache__/hooks.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/hooks.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/hooks.cpython-310.pyc'
import 'requests.hooks' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815f700>
# /usr/lib/python3/dist-packages/requests/__pycache__/auth.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/auth.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/auth.cpython-310.pyc'
import 'requests.auth' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815f850>
# /usr/lib/python3/dist-packages/requests/__pycache__/status_codes.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/status_codes.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/status_codes.cpython-310.pyc'
import 'requests.status_codes' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815fdc0>
import 'requests.models' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb815db70>
# /usr/lib/python3/dist-packages/requests/__pycache__/api.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/api.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/api.cpython-310.pyc'
# /usr/lib/python3/dist-packages/requests/__pycache__/sessions.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/sessions.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/sessions.cpython-310.pyc'
# /usr/lib/python3/dist-packages/requests/__pycache__/adapters.cpython-310.pyc matches /usr/lib/python3/dist-packages/requests/adapters.py
# code object from '/usr/lib/python3/dist-packages/requests/__pycache__/adapters.cpython-310.pyc'
# /usr/lib/python3/dist-packages/urllib3/contrib/__pycache__/socks.cpython-310.pyc matches /usr/lib/python3/dist-packages/urllib3/contrib/socks.py
# code object from '/usr/lib/python3/dist-packages/urllib3/contrib/__pycache__/socks.cpython-310.pyc'
# /home/server/__pycache__/socks.cpython-310.pyc matches /home/server/socks.py
# code object from '/home/server/__pycache__/socks.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/socketserver.cpython-310.pyc matches /usr/lib/python3.10/socketserver.py
# code object from '/usr/lib/python3.10/__pycache__/socketserver.cpython-310.pyc'
import 'socketserver' # <_frozen_importlib_external.SourceFileLoader object at 0x7f3cb81ae050>
```
and hangs just here.
2. Environment: python3=3.10.12, requests=2.31.0: gives the same result:
```
>>> import requests
...
# code object from '/usr/lib/python3.10/__pycache__/socketserver.cpython-310.pyc'
import 'socketserver' # <_frozen_importlib_external.SourceFileLoader object at 0x7fe751447c40>
```
## Actual Result
The import statement hangs for package requests
## Reproduction Steps
```python
import requests
```
## System Information - tried to run the command, but also hangs
$ python -m requests.help
```json
{
"paste": "here"
}
```
| {
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6689/reactions"
} | https://api.github.com/repos/psf/requests/issues/6689/timeline | null | not_planned | null | null | false | [
"Towards the end of your paste\n\n```\n# /home/server/__pycache__/socks.cpython-310.pyc matches /home/server/socks.py\n# code object from '/home/server/__pycache__/socks.cpython-310.pyc\n```\n\nSo you've broken your python path probably and have files shadowing names that you must not shadow. This is not a bug in Requests. Please look more closely in the future before opening a bug for something in the very information you yourself provided. "
] |
https://api.github.com/repos/psf/requests/issues/6688 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6688/labels{/name} | https://api.github.com/repos/psf/requests/issues/6688/comments | https://api.github.com/repos/psf/requests/issues/6688/events | https://github.com/psf/requests/pull/6688 | 2,259,345,945 | PR_kwDOABTKOs5tgCrh | 6,688 | Pin 3.8 and 3.9 runners back to macos-13 | {
"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 | false | null | [] | null | 0 | 2024-04-23T16:58:07Z | 2024-04-23T17:50:20Z | 2024-04-23T17:50:20Z | MEMBER | null | This will fix the breakages that started this morning with the GHA cut over to macOS 14 which uses an arm64 platform for the test runners. | {
"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/6688/reactions"
} | https://api.github.com/repos/psf/requests/issues/6688/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6688.diff",
"html_url": "https://github.com/psf/requests/pull/6688",
"merged_at": "2024-04-23T17:50:20Z",
"patch_url": "https://github.com/psf/requests/pull/6688.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6688"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6687 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6687/labels{/name} | https://api.github.com/repos/psf/requests/issues/6687/comments | https://api.github.com/repos/psf/requests/issues/6687/events | https://github.com/psf/requests/pull/6687 | 2,244,145,694 | PR_kwDOABTKOs5ss68d | 6,687 | Bump github/codeql-action from 3.24.0 to 3.25.0 | {
"avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4",
"events_url": "https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/dependabot%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/dependabot",
"id": 49699333,
"login": "dependabot[bot]",
"node_id": "MDM6Qm90NDk2OTkzMzM=",
"organizations_url": "https://api.github.com/users/dependabot%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/dependabot%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/dependabot%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dependabot%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/dependabot%5Bbot%5D",
"user_view_type": "public"
} | [
{
"color": "0366d6",
"default": false,
"description": "Pull requests that update a dependency file",
"id": 1868210094,
"name": "dependencies",
"node_id": "MDU6TGFiZWwxODY4MjEwMDk0",
"url": "https://api.github.com/repos/psf/requests/labels/dependencies"
},
{
"color": "000000",
"default": false,
"description": "Pull requests that update GitHub Actions code",
"id": 5838729011,
"name": "github_actions",
"node_id": "LA_kwDOABTKOs8AAAABXAPvMw",
"url": "https://api.github.com/repos/psf/requests/labels/github_actions"
}
] | closed | false | null | [] | null | 0 | 2024-04-15T16:40:36Z | 2024-04-15T17:01:40Z | 2024-04-15T17:01:39Z | CONTRIBUTOR | null | Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.0 to 3.25.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/github/codeql-action/blob/main/CHANGELOG.md">github/codeql-action's changelog</a>.</em></p>
<blockquote>
<h1>CodeQL Action Changelog</h1>
<p>See the <a href="https://github.com/github/codeql-action/releases">releases page</a> for the relevant changes to the CodeQL CLI and language packs.</p>
<p>Note that the only difference between <code>v2</code> and <code>v3</code> of the CodeQL Action is the node version they support, with <code>v3</code> running on node 20 while we continue to release <code>v2</code> to support running on node 16. For example <code>3.22.11</code> was the first <code>v3</code> release and is functionally identical to <code>2.22.11</code>. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.</p>
<h2>[UNRELEASED]</h2>
<p>No user facing changes.</p>
<h2>3.25.0 - 15 Apr 2024</h2>
<ul>
<li>
<p>The deprecated feature for extracting dependencies for a Python analysis has been removed. <a href="https://redirect.github.com/github/codeql-action/pull/2224">#2224</a></p>
<p>As a result, the following inputs and environment variables are now ignored:</p>
<ul>
<li>The <code>setup-python-dependencies</code> input to the <code>init</code> Action</li>
<li>The <code>CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION</code> environment variable</li>
</ul>
<p>We recommend removing any references to these from your workflows. For more information, see the release notes for CodeQL Action v3.23.0 and v2.23.0.</p>
</li>
<li>
<p>Automatically overwrite an existing database if found on the filesystem. <a href="https://redirect.github.com/github/codeql-action/pull/2229">#2229</a></p>
</li>
<li>
<p>Bump the minimum CodeQL bundle version to 2.12.6. <a href="https://redirect.github.com/github/codeql-action/pull/2232">#2232</a></p>
</li>
<li>
<p>A more relevant log message and a diagnostic are now emitted when the <code>file</code> program is not installed on a Linux runner, but is required for Go tracing to succeed. <a href="https://redirect.github.com/github/codeql-action/pull/2234">#2234</a></p>
</li>
</ul>
<h2>3.24.10 - 05 Apr 2024</h2>
<ul>
<li>Update default CodeQL bundle version to 2.17.0. <a href="https://redirect.github.com/github/codeql-action/pull/2219">#2219</a></li>
<li>Add a deprecation warning for customers using CodeQL version 2.12.5 and earlier. These versions of CodeQL were discontinued on 26 March 2024 alongside GitHub Enterprise Server 3.8, and will be unsupported by CodeQL Action versions 3.25.0 and later and versions 2.25.0 and later. <a href="https://redirect.github.com/github/codeql-action/pull/2220">#2220</a>
<ul>
<li>If you are using one of these versions, please update to CodeQL CLI version 2.12.6 or later. For instance, if you have specified a custom version of the CLI using the 'tools' input to the 'init' Action, you can remove this input to use the default version.</li>
<li>Alternatively, if you want to continue using a version of the CodeQL CLI between 2.11.6 and 2.12.5, you can replace <code>github/codeql-action/*@v3</code> by <code>github/codeql-action/*@v3.24.10</code> and <code>github/codeql-action/*@v2</code> by <code>github/codeql-action/*@v2.24.10</code> in your code scanning workflow to ensure you continue using this version of the CodeQL Action.</li>
</ul>
</li>
</ul>
<h2>3.24.9 - 22 Mar 2024</h2>
<ul>
<li>Update default CodeQL bundle version to 2.16.5. <a href="https://redirect.github.com/github/codeql-action/pull/2203">#2203</a></li>
</ul>
<h2>3.24.8 - 18 Mar 2024</h2>
<ul>
<li>Improve the ease of debugging extraction issues by increasing the verbosity of the extractor logs when running in debug mode. <a href="https://redirect.github.com/github/codeql-action/pull/2195">#2195</a></li>
</ul>
<h2>3.24.7 - 12 Mar 2024</h2>
<ul>
<li>Update default CodeQL bundle version to 2.16.4. <a href="https://redirect.github.com/github/codeql-action/pull/2185">#2185</a></li>
</ul>
<h2>3.24.6 - 29 Feb 2024</h2>
<p>No user facing changes.</p>
<h2>3.24.5 - 23 Feb 2024</h2>
<ul>
<li>Update default CodeQL bundle version to 2.16.3. <a href="https://redirect.github.com/github/codeql-action/pull/2156">#2156</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/github/codeql-action/commit/df5a14dc28094dc936e103b37d749c6628682b60"><code>df5a14d</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2238">#2238</a> from github/update-v3.25.0-2b2cee522</li>
<li><a href="https://github.com/github/codeql-action/commit/3f70eaa4d31bbf0600be93a0ae88db6c0aef186a"><code>3f70eaa</code></a> Update changelog for v3.25.0</li>
<li><a href="https://github.com/github/codeql-action/commit/2b2cee52294c410df28cc7ba0beaf429d5b4e82c"><code>2b2cee5</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2234">#2234</a> from github/mbg/clearer-file-command-failure</li>
<li><a href="https://github.com/github/codeql-action/commit/4fcf7a216ce13f13ffe9f395a802a3f22f8190e6"><code>4fcf7a2</code></a> Add changelog entry</li>
<li><a href="https://github.com/github/codeql-action/commit/d30d1cabb492838711c91e6280899193c0f779c7"><code>d30d1ca</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2237">#2237</a> from github/henrymercer/more-configuration-errors</li>
<li><a href="https://github.com/github/codeql-action/commit/55585360a353847d36f63bc5c29f1b7086340901"><code>5558536</code></a> Add configuration error for unsupported build mode</li>
<li><a href="https://github.com/github/codeql-action/commit/fa75c144b4edca3ccd9a781733939fad7515f12e"><code>fa75c14</code></a> Capture rate limit and ref not existing config errors</li>
<li><a href="https://github.com/github/codeql-action/commit/5a599c68cf43195b46783a38eafaca73404ea2e4"><code>5a599c6</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2236">#2236</a> from github/henrymercer/feature-flags-with-tool-feat...</li>
<li><a href="https://github.com/github/codeql-action/commit/829376a61898ee2e4be42297fc41c4adcc10bf00"><code>829376a</code></a> Allow feature flags to specify tool feature requirements</li>
<li><a href="https://github.com/github/codeql-action/commit/efc474680fa70a6df5c97b97233f665b4b7d6749"><code>efc4746</code></a> Downgrade log levels for some messages to debug</li>
<li>Additional commits viewable in <a href="https://github.com/github/codeql-action/compare/e8893c57a1f3a2b659b6b55564fdfdbbd2982911...df5a14dc28094dc936e103b37d749c6628682b60">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details> | {
"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/6687/reactions"
} | https://api.github.com/repos/psf/requests/issues/6687/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6687.diff",
"html_url": "https://github.com/psf/requests/pull/6687",
"merged_at": "2024-04-15T17:01:39Z",
"patch_url": "https://github.com/psf/requests/pull/6687.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6687"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6686 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6686/labels{/name} | https://api.github.com/repos/psf/requests/issues/6686/comments | https://api.github.com/repos/psf/requests/issues/6686/events | https://github.com/psf/requests/issues/6686 | 2,243,200,020 | I_kwDOABTKOs6FtIQU | 6,686 | Issue With Decimals In JSON Handling | {
"avatar_url": "https://avatars.githubusercontent.com/u/30216972?v=4",
"events_url": "https://api.github.com/users/Hady-Eslam/events{/privacy}",
"followers_url": "https://api.github.com/users/Hady-Eslam/followers",
"following_url": "https://api.github.com/users/Hady-Eslam/following{/other_user}",
"gists_url": "https://api.github.com/users/Hady-Eslam/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Hady-Eslam",
"id": 30216972,
"login": "Hady-Eslam",
"node_id": "MDQ6VXNlcjMwMjE2OTcy",
"organizations_url": "https://api.github.com/users/Hady-Eslam/orgs",
"received_events_url": "https://api.github.com/users/Hady-Eslam/received_events",
"repos_url": "https://api.github.com/users/Hady-Eslam/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Hady-Eslam/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Hady-Eslam/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Hady-Eslam",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 3 | 2024-04-15T09:42:03Z | 2024-04-15T10:31:35Z | 2024-04-15T10:31:35Z | NONE | null | <!-- Summary. -->
Issue In Handling Decimal in JSON when simplejson package is not installed
## Expected Result
When There is a Decimal in JSON data it should be handled without an error
```
import requests
from decimal import Decimal
data = {
'key': Decimal('0.0')
}
print(requests.post('https://jsonplaceholder.typicode.com/', json=data))
```
It should send the request without an issue
## Actual Result
When installing the requests Package
```
pip3 install requests==2.31.0
```
and running this script
```
import requests
from decimal import Decimal
data = {
'key': Decimal('0.0')
}
print(requests.post('https://jsonplaceholder.typicode.com/', json=data))
```
it gives an exception
```
TypeError: Object of type Decimal is not JSON serializable
```
But When installing SimpleJson With It
```
pip3 install requests==2.31.0 simplejson==3.17.2
```
and running the same script, it will send requests normally without an issue
## Reproduction Steps
install the requests package and run the bellow script, and then install simplejson package and run the same script, You will see different results
```python
import requests
from decimal import Decimal
data = {
'key': Decimal('0.0')
}
print(requests.post('https://jsonplaceholder.typicode.com/', json=data))
```
## System Information
$ python3 -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "2.1.1"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.4"
},
"implementation": {
"name": "CPython",
"version": "3.10.12"
},
"platform": {
"release": "6.5.0-26-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "30000020"
},
"urllib3": {
"version": "2.0.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/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": 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/6686/reactions"
} | https://api.github.com/repos/psf/requests/issues/6686/timeline | null | not_planned | null | null | false | [
"I was able to reproduce this on Mac OS. System information:\r\n\r\n```\r\n{\r\n \"chardet\": {\r\n \"version\": null\r\n },\r\n \"charset_normalizer\": {\r\n \"version\": \"3.3.1\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"3.4\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.11.5\"\r\n },\r\n \"platform\": {\r\n \"release\": \"23.3.0\",\r\n \"system\": \"Darwin\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.31.0\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"30100020\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"2.0.7\"\r\n },\r\n \"using_charset_normalizer\": true,\r\n \"using_pyopenssl\": false\r\n}\r\n```",
"I have the same issue.\r\nSystem information:\r\n{\r\n \"chardet\": {\r\n \"version\": \"4.0.0\"\r\n },\r\n \"charset_normalizer\": {\r\n \"version\": \"2.0.6\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"\"\r\n },\r\n \"idna\": {\r\n \"version\": \"3.3\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"3.10.12\"\r\n },\r\n \"platform\": {\r\n \"release\": \"6.5.0-27-generic\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"\",\r\n \"version\": null\r\n },\r\n \"requests\": {\r\n \"version\": \"2.31.0\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"30000020\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"2.0.7\"\r\n },\r\n \"using_charset_normalizer\": false,\r\n \"using_pyopenssl\": false\r\n}\r\n",
"This is the behavior of the standard library. We do not customize the encoder or decoder but you can do that yourself. Or you can use simplejson "
] |
https://api.github.com/repos/psf/requests/issues/6685 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6685/labels{/name} | https://api.github.com/repos/psf/requests/issues/6685/comments | https://api.github.com/repos/psf/requests/issues/6685/events | https://github.com/psf/requests/pull/6685 | 2,242,373,234 | PR_kwDOABTKOs5sm3AP | 6,685 | Fix raise for status #6683 | {
"avatar_url": "https://avatars.githubusercontent.com/u/7195133?v=4",
"events_url": "https://api.github.com/users/dennyb87/events{/privacy}",
"followers_url": "https://api.github.com/users/dennyb87/followers",
"following_url": "https://api.github.com/users/dennyb87/following{/other_user}",
"gists_url": "https://api.github.com/users/dennyb87/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dennyb87",
"id": 7195133,
"login": "dennyb87",
"node_id": "MDQ6VXNlcjcxOTUxMzM=",
"organizations_url": "https://api.github.com/users/dennyb87/orgs",
"received_events_url": "https://api.github.com/users/dennyb87/received_events",
"repos_url": "https://api.github.com/users/dennyb87/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dennyb87/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dennyb87/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dennyb87",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 3 | 2024-04-14T21:20:51Z | 2024-04-15T17:21:26Z | 2024-04-15T17:08:03Z | NONE | null | Fix `raise_for_status()` behaviour to comply with documentation as per [issue #6683](https://github.com/psf/requests/issues/6683). In particular, makes it return the response to ease chaining in trivial cases. | {
"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/6685/reactions"
} | https://api.github.com/repos/psf/requests/issues/6685/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6685.diff",
"html_url": "https://github.com/psf/requests/pull/6685",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6685.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6685"
} | true | [
"> I'm not convinced the documentation was ever right it that we should change the code to comport\r\n\r\nI see, if that's the case feel free to close the pull request, fixing the documentation would do as well, although returning the response seemed useful.",
"Yeah I'd want Nate's input too when he has time. I'm more inclined to fix the docs ",
"This looks wrong. The documentation being linked in the original issue is not our documentation, it's Kenneth's 3.x fork. This was a requested feature several years ago to allow for more functional programming with something like `response.raise_for_status().content` which was rejected. If Kenneth added it to his 3.x branch, that's not something we'll be supporting.\r\n\r\nI'm not able to find this line in any of our [public docs](https://requests.readthedocs.io/en/latest/user/quickstart/#response-status-codes), but if you are able to, please provide a link. I'm going to close this PR out as won't fix since this isn't expected behavior, we can discuss any instances of this in the official docs in the tracking issue. Thanks!"
] |
https://api.github.com/repos/psf/requests/issues/6684 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6684/labels{/name} | https://api.github.com/repos/psf/requests/issues/6684/comments | https://api.github.com/repos/psf/requests/issues/6684/events | https://github.com/psf/requests/pull/6684 | 2,242,066,932 | PR_kwDOABTKOs5sl56a | 6,684 | Fixed #6683 | {
"avatar_url": "https://avatars.githubusercontent.com/u/70821878?v=4",
"events_url": "https://api.github.com/users/ManiFaridi/events{/privacy}",
"followers_url": "https://api.github.com/users/ManiFaridi/followers",
"following_url": "https://api.github.com/users/ManiFaridi/following{/other_user}",
"gists_url": "https://api.github.com/users/ManiFaridi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ManiFaridi",
"id": 70821878,
"login": "ManiFaridi",
"node_id": "MDQ6VXNlcjcwODIxODc4",
"organizations_url": "https://api.github.com/users/ManiFaridi/orgs",
"received_events_url": "https://api.github.com/users/ManiFaridi/received_events",
"repos_url": "https://api.github.com/users/ManiFaridi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ManiFaridi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ManiFaridi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ManiFaridi",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 4 | 2024-04-14T09:34:24Z | 2024-04-15T17:11:23Z | 2024-04-15T17:11:22Z | NONE | null | Since the documentation says that it should return a response object in case of no difficulties and the code didn't seem to, I added a statement to return the response object at the end.
[This is the issue](https://github.com/psf/requests/issues/6683)
| {
"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/6684/reactions"
} | https://api.github.com/repos/psf/requests/issues/6684/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6684.diff",
"html_url": "https://github.com/psf/requests/pull/6684",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6684.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6684"
} | true | [
"In hindsight perhaps a test wouldn't hurt",
"My bad, you are absolutely right. I'll get to it.",
"All good man :thumbsup: I don't have merge rights so can't really do much here anyway :smile: I raised it just in case :shrug: ",
"Thanks for the PR @ManiFaridi. This isn't something we'll likely be adding though, please refer to the original issue for more information."
] |
https://api.github.com/repos/psf/requests/issues/6683 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6683/labels{/name} | https://api.github.com/repos/psf/requests/issues/6683/comments | https://api.github.com/repos/psf/requests/issues/6683/events | https://github.com/psf/requests/issues/6683 | 2,242,062,886 | I_kwDOABTKOs6Foyom | 6,683 | raise_for_status documentation is out of sync | {
"avatar_url": "https://avatars.githubusercontent.com/u/7195133?v=4",
"events_url": "https://api.github.com/users/dennyb87/events{/privacy}",
"followers_url": "https://api.github.com/users/dennyb87/followers",
"following_url": "https://api.github.com/users/dennyb87/following{/other_user}",
"gists_url": "https://api.github.com/users/dennyb87/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dennyb87",
"id": 7195133,
"login": "dennyb87",
"node_id": "MDQ6VXNlcjcxOTUxMzM=",
"organizations_url": "https://api.github.com/users/dennyb87/orgs",
"received_events_url": "https://api.github.com/users/dennyb87/received_events",
"repos_url": "https://api.github.com/users/dennyb87/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dennyb87/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dennyb87/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dennyb87",
"user_view_type": "public"
} | [
{
"color": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
}
] | closed | false | null | [] | null | 4 | 2024-04-14T09:24:00Z | 2024-04-15T20:36:53Z | 2024-04-15T20:35:18Z | NONE | null | Not a bug per se, more like a discrepancy between documentation and actual behaviour.
## Expected Result
The [documentation](https://3.python-requests.org/user/quickstart/#response-status-codes) says `response.raise_for_status()` should return the response for chaining in trivial use cases.

## Actual Result
The code in the latest version of package doesn't actually allow it, see [raise_for_status in models.py](https://github.com/psf/requests/blob/v2.31.0/requests/models.py#L994)
## Reproduction Steps
```
...
response.raise_for_status().json()
AttributeError: 'NoneType' object has no attribute 'json'
``` | {
"avatar_url": "https://avatars.githubusercontent.com/u/7195133?v=4",
"events_url": "https://api.github.com/users/dennyb87/events{/privacy}",
"followers_url": "https://api.github.com/users/dennyb87/followers",
"following_url": "https://api.github.com/users/dennyb87/following{/other_user}",
"gists_url": "https://api.github.com/users/dennyb87/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dennyb87",
"id": 7195133,
"login": "dennyb87",
"node_id": "MDQ6VXNlcjcxOTUxMzM=",
"organizations_url": "https://api.github.com/users/dennyb87/orgs",
"received_events_url": "https://api.github.com/users/dennyb87/received_events",
"repos_url": "https://api.github.com/users/dennyb87/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dennyb87/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dennyb87/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dennyb87",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6683/reactions"
} | https://api.github.com/repos/psf/requests/issues/6683/timeline | null | completed | null | null | false | [
"Hi @dennyb87, thanks for raising this. I responded in a comment here in [your PR](https://github.com/psf/requests/pull/6685#issuecomment-2057416891). If you can provide examples from the official docs hosted on readthedocs, we'd be happy to fix this, but from what I can see currently, this never existed in the Requests documentation. What you provided above is an unmaintained fork we do not have control over.",
"Nice catch @nateprewitt . I didn't have time to click through but the screenshot seemed convincing",
"Ouch :facepalm: that's embarrassing :sweat_smile: my bad! apologies for the annoyance :wave: ",
"No worries, thanks for checking in!"
] |
https://api.github.com/repos/psf/requests/issues/6682 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6682/labels{/name} | https://api.github.com/repos/psf/requests/issues/6682/comments | https://api.github.com/repos/psf/requests/issues/6682/events | https://github.com/psf/requests/pull/6682 | 2,238,384,896 | PR_kwDOABTKOs5sZWXf | 6,682 | Fix compatibility with pytest 8 | {
"avatar_url": "https://avatars.githubusercontent.com/u/5688939?v=4",
"events_url": "https://api.github.com/users/frenzymadness/events{/privacy}",
"followers_url": "https://api.github.com/users/frenzymadness/followers",
"following_url": "https://api.github.com/users/frenzymadness/following{/other_user}",
"gists_url": "https://api.github.com/users/frenzymadness/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/frenzymadness",
"id": 5688939,
"login": "frenzymadness",
"node_id": "MDQ6VXNlcjU2ODg5Mzk=",
"organizations_url": "https://api.github.com/users/frenzymadness/orgs",
"received_events_url": "https://api.github.com/users/frenzymadness/received_events",
"repos_url": "https://api.github.com/users/frenzymadness/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/frenzymadness/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/frenzymadness/subscriptions",
"type": "User",
"url": "https://api.github.com/users/frenzymadness",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 0 | 2024-04-11T19:10:21Z | 2024-04-11T19:49:35Z | 2024-04-11T19:49:35Z | CONTRIBUTOR | null | `pytest.warns(None)` has been deprecated in pytest 7.0.0 and it's no longer working in pytest 8.
Resolves: https://github.com/psf/requests/issues/6679 | {
"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/6682/reactions"
} | https://api.github.com/repos/psf/requests/issues/6682/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6682.diff",
"html_url": "https://github.com/psf/requests/pull/6682",
"merged_at": "2024-04-11T19:49:35Z",
"patch_url": "https://github.com/psf/requests/pull/6682.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6682"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6681 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6681/labels{/name} | https://api.github.com/repos/psf/requests/issues/6681/comments | https://api.github.com/repos/psf/requests/issues/6681/events | https://github.com/psf/requests/issues/6681 | 2,235,998,968 | I_kwDOABTKOs6FRqL4 | 6,681 | what if someone sets both data and files when making a request? | {
"avatar_url": "https://avatars.githubusercontent.com/u/127623723?v=4",
"events_url": "https://api.github.com/users/siddhsql/events{/privacy}",
"followers_url": "https://api.github.com/users/siddhsql/followers",
"following_url": "https://api.github.com/users/siddhsql/following{/other_user}",
"gists_url": "https://api.github.com/users/siddhsql/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/siddhsql",
"id": 127623723,
"login": "siddhsql",
"node_id": "U_kgDOB5tiKw",
"organizations_url": "https://api.github.com/users/siddhsql/orgs",
"received_events_url": "https://api.github.com/users/siddhsql/received_events",
"repos_url": "https://api.github.com/users/siddhsql/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/siddhsql/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/siddhsql/subscriptions",
"type": "User",
"url": "https://api.github.com/users/siddhsql",
"user_view_type": "public"
} | [
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156042717,
"name": "actions/autoclose-qa",
"node_id": "LA_kwDOABTKOs8AAAABbu3B3Q",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-qa"
}
] | closed | true | null | [] | null | 1 | 2024-04-10T16:28:16Z | 2024-04-10T16:28:27Z | 2024-04-10T16:28:26Z | NONE | off-topic | from the [docs](https://requests.readthedocs.io/en/latest/api/):
**data** – (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the [Request](https://requests.readthedocs.io/en/latest/api/#requests.Request).
**files** – (optional) Dictionary of 'name': file-like-objects (or {'name': file-tuple}) for multipart encoding upload. file-tuple can be a 2-tuple ('filename', fileobj), 3-tuple ('filename', fileobj, 'content_type') or a 4-tuple ('filename', fileobj, 'content_type', custom_headers), where 'content_type' is a string defining the content type of the given file and custom_headers a dict-like object containing additional headers to add for the file.
what happens if someone sets both? i ask because AFAIU, `files` is sent in the request body | {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6681/reactions"
} | https://api.github.com/repos/psf/requests/issues/6681/timeline | null | completed | null | null | false | [
"As described in the template, we won't be able to answer questions on this issue tracker. Please use [Stack Overflow](https://stackoverflow.com/)"
] |
https://api.github.com/repos/psf/requests/issues/6680 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6680/labels{/name} | https://api.github.com/repos/psf/requests/issues/6680/comments | https://api.github.com/repos/psf/requests/issues/6680/events | https://github.com/psf/requests/pull/6680 | 2,231,979,385 | PR_kwDOABTKOs5sDW0x | 6,680 | Add rfc9110 HTTP status code names | {
"avatar_url": "https://avatars.githubusercontent.com/u/659504?v=4",
"events_url": "https://api.github.com/users/mbeijen/events{/privacy}",
"followers_url": "https://api.github.com/users/mbeijen/followers",
"following_url": "https://api.github.com/users/mbeijen/following{/other_user}",
"gists_url": "https://api.github.com/users/mbeijen/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mbeijen",
"id": 659504,
"login": "mbeijen",
"node_id": "MDQ6VXNlcjY1OTUwNA==",
"organizations_url": "https://api.github.com/users/mbeijen/orgs",
"received_events_url": "https://api.github.com/users/mbeijen/received_events",
"repos_url": "https://api.github.com/users/mbeijen/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mbeijen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mbeijen/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mbeijen",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 0 | 2024-04-08T19:57:43Z | 2024-04-11T14:10:57Z | 2024-04-11T14:10:57Z | CONTRIBUTOR | null | RFC 9110 _HTTP Semantics_ obsoletes some earlier RFCs which defined HTTP 1.1. It adds some status codes that were previously only used for WebDAV to HTTP _proper_ after making the names somewhat more generic.
See https://www.rfc-editor.org/rfc/rfc9110.html#name-changes-from-rfc-7231
This commit adds the http status code names from that RFC.
RFC 9110 has been accepted as Internet Standard in June 2022.
In https://github.com/psf/requests/blob/main/docs/user/advanced.rst#compliance it states:
> Requests is intended to be compliant with all relevant specifications and RFCs where that compliance will not cause difficulties for users.
So it seems only logical that the status code descriptions found in that RFC are also available in 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"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6680/reactions"
} | https://api.github.com/repos/psf/requests/issues/6680/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6680.diff",
"html_url": "https://github.com/psf/requests/pull/6680",
"merged_at": "2024-04-11T14:10:57Z",
"patch_url": "https://github.com/psf/requests/pull/6680.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6680"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6679 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6679/labels{/name} | https://api.github.com/repos/psf/requests/issues/6679/comments | https://api.github.com/repos/psf/requests/issues/6679/events | https://github.com/psf/requests/issues/6679 | 2,229,741,283 | I_kwDOABTKOs6E5ybj | 6,679 | pytest.warns(None) is no longer supported | {
"avatar_url": "https://avatars.githubusercontent.com/u/241039?v=4",
"events_url": "https://api.github.com/users/wRAR/events{/privacy}",
"followers_url": "https://api.github.com/users/wRAR/followers",
"following_url": "https://api.github.com/users/wRAR/following{/other_user}",
"gists_url": "https://api.github.com/users/wRAR/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wRAR",
"id": 241039,
"login": "wRAR",
"node_id": "MDQ6VXNlcjI0MTAzOQ==",
"organizations_url": "https://api.github.com/users/wRAR/orgs",
"received_events_url": "https://api.github.com/users/wRAR/received_events",
"repos_url": "https://api.github.com/users/wRAR/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wRAR/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wRAR/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wRAR",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 4 | 2024-04-07T12:16:58Z | 2024-04-11T19:49:36Z | 2024-04-11T19:49:36Z | NONE | null | Not sure what was this code supposed to mean (making sure that there are no warnings? I don't think it ever did that?), but on pytest 8 it no longer works: "TypeError: exceptions must be derived from Warning, not <class 'NoneType'>"
https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests | {
"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/6679/reactions"
} | https://api.github.com/repos/psf/requests/issues/6679/timeline | null | completed | null | null | false | [
"From the pytest's changelog:\r\n\r\n> #8645: pytest.warns(None) is now deprecated because many people used it to mean “this code does not emit warnings”, but it actually had the effect of checking that the code emits at least one warning of any type - like pytest.warns() or pytest.warns(Warning).",
"And this is the code we are talking about:\r\n\r\nhttps://github.com/psf/requests/blob/2a438c27b5a5828c8ea0dc958112eecffca70b12/tests/test_requests.py#L1006-L1008",
"In our testing environment with pytest 8.1.1 and urllib3 < 2.0 removing the None from `pytest.warns` fixes the problem.",
"I'm not sure why the last comment by @kloczek has been removed but PR with the simple fix is ready."
] |
https://api.github.com/repos/psf/requests/issues/6678 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6678/labels{/name} | https://api.github.com/repos/psf/requests/issues/6678/comments | https://api.github.com/repos/psf/requests/issues/6678/events | https://github.com/psf/requests/pull/6678 | 2,226,359,626 | PR_kwDOABTKOs5rwRa9 | 6,678 | Adds json.JSONDecodeError from standard library to requests.JSONDecodeError | {
"avatar_url": "https://avatars.githubusercontent.com/u/35944885?v=4",
"events_url": "https://api.github.com/users/jon-behnken/events{/privacy}",
"followers_url": "https://api.github.com/users/jon-behnken/followers",
"following_url": "https://api.github.com/users/jon-behnken/following{/other_user}",
"gists_url": "https://api.github.com/users/jon-behnken/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jon-behnken",
"id": 35944885,
"login": "jon-behnken",
"node_id": "MDQ6VXNlcjM1OTQ0ODg1",
"organizations_url": "https://api.github.com/users/jon-behnken/orgs",
"received_events_url": "https://api.github.com/users/jon-behnken/received_events",
"repos_url": "https://api.github.com/users/jon-behnken/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jon-behnken/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jon-behnken/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jon-behnken",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 3 | 2024-04-04T19:33:33Z | 2024-04-11T15:01:08Z | 2024-04-11T14:16:01Z | NONE | null | Below is a suggestion for slightly enhancing the `JSONDecodeError` behavior.
### Background
The [comments](https://github.com/psf/requests/blob/main/src/requests/models.py#L972) for the `json()` method of `Response` say that `requests.JSONDecodeError` should alias the JSONDecodeError from the standard `json` library (`json.JSONDecodeError`) and `simplejson.JSONDecodeError`.
### Problem
When `simplejson` is installed, `requests.JSONDecodeError` is not an instance of `json.JSONDecodeError`
### How to reproduce
1. Install `simplejson` in a virtual environment
```
pip install simplejson
```
2. Without the proposed change, [this test](https://github.com/psf/requests/compare/main...jon-behnken:requests:main#diff-05180dda5cdc530f95d400932961d6152bd515a6447af23d22c7f335b390b9d8R2810) should fail:
```
pytest tests/test_requests.py -k test_json_decode_compatibility
```
### Why
Implementations like this should behave as expected:
```
try:
response = requests.get("https://www.example.com/data").json()
except json.JSONDecodeError:
# do something
```
but this exception does not get caught. Currently you must use `requests.exceptions.JSONDecodeError` which is a bit unintuitive. | {
"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/6678/reactions"
} | https://api.github.com/repos/psf/requests/issues/6678/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6678.diff",
"html_url": "https://github.com/psf/requests/pull/6678",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6678.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6678"
} | true | [
"I think the docs aren't sufficiently clear but with this PR you're now doubly inheriting from the stdlib JSONDecodeError if there's no simplejson which seems rather silly. The reason we inherit from whichever library is used is because people had been previously catching that and others reasonably expected to be able to catch an exception from requests. It's not meant such that you can always catch the stdlib exception class",
"I agree with sigmavirus24, the example behavior isn't how this exception was intended to work. It was made to provide a shim allowing code to function regardless of the dependencies available. I'd be happy to review a doc PR to clarify intent of the exception, but don't think this PR is the right path for addressing any confusion.",
"It's not even how it's documented I think. I think this is purely talking about an inaccurate code comment"
] |
https://api.github.com/repos/psf/requests/issues/6677 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6677/labels{/name} | https://api.github.com/repos/psf/requests/issues/6677/comments | https://api.github.com/repos/psf/requests/issues/6677/events | https://github.com/psf/requests/pull/6677 | 2,218,667,362 | PR_kwDOABTKOs5rVre8 | 6,677 | Bump actions/setup-python from 5.0.0 to 5.1.0 | {
"avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4",
"events_url": "https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/dependabot%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/dependabot",
"id": 49699333,
"login": "dependabot[bot]",
"node_id": "MDM6Qm90NDk2OTkzMzM=",
"organizations_url": "https://api.github.com/users/dependabot%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/dependabot%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/dependabot%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dependabot%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/dependabot%5Bbot%5D",
"user_view_type": "public"
} | [
{
"color": "0366d6",
"default": false,
"description": "Pull requests that update a dependency file",
"id": 1868210094,
"name": "dependencies",
"node_id": "MDU6TGFiZWwxODY4MjEwMDk0",
"url": "https://api.github.com/repos/psf/requests/labels/dependencies"
},
{
"color": "000000",
"default": false,
"description": "Pull requests that update GitHub Actions code",
"id": 5838729011,
"name": "github_actions",
"node_id": "LA_kwDOABTKOs8AAAABXAPvMw",
"url": "https://api.github.com/repos/psf/requests/labels/github_actions"
}
] | closed | false | null | [] | null | 0 | 2024-04-01T17:00:21Z | 2024-04-01T17:36:47Z | 2024-04-01T17:36:47Z | CONTRIBUTOR | null | Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.0.0 to 5.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/setup-python/releases">actions/setup-python's releases</a>.</em></p>
<blockquote>
<h2>v5.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Leveraging the raw API to retrieve the version-manifest, as it does not impose a rate limit and hence facilitates unrestricted consumption without the need for a token for Github Enterprise Servers by <a href="https://github.com/Shegox"><code>@Shegox</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/766">actions/setup-python#766</a>.</li>
<li>Dependency updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a> and <a href="https://github.com/HarithaVattikuti"><code>@HarithaVattikuti</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/817">actions/setup-python#817</a></li>
<li>Documentation changes for version in README by <a href="https://github.com/basnijholt"><code>@basnijholt</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/776">actions/setup-python#776</a></li>
<li>Documentation changes for link in README by <a href="https://github.com/ukd1"><code>@ukd1</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/793">actions/setup-python#793</a></li>
<li>Documentation changes for link in Advanced Usage by <a href="https://github.com/Jamim"><code>@Jamim</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/782">actions/setup-python#782</a></li>
<li>Documentation changes for avoiding rate limit issues on GHES by <a href="https://github.com/priya-kinthali"><code>@priya-kinthali</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/835">actions/setup-python#835</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/basnijholt"><code>@basnijholt</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/776">actions/setup-python#776</a></li>
<li><a href="https://github.com/ukd1"><code>@ukd1</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/793">actions/setup-python#793</a></li>
<li><a href="https://github.com/Jamim"><code>@Jamim</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/782">actions/setup-python#782</a></li>
<li><a href="https://github.com/Shegox"><code>@Shegox</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/766">actions/setup-python#766</a></li>
<li><a href="https://github.com/priya-kinthali"><code>@priya-kinthali</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/835">actions/setup-python#835</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/setup-python/compare/v5.0.0...v5.1.0">https://github.com/actions/setup-python/compare/v5.0.0...v5.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/actions/setup-python/commit/82c7e631bb3cdc910f68e0081d67478d79c6982d"><code>82c7e63</code></a> Documentation changes for avoiding rate limit issues on GHES (<a href="https://redirect.github.com/actions/setup-python/issues/835">#835</a>)</li>
<li><a href="https://github.com/actions/setup-python/commit/10aa35afd7f071e70ffaa122e3d7c6ffcb5f7ed1"><code>10aa35a</code></a> feat: fallback to raw endpoint for manifest when rate limit is reached (<a href="https://redirect.github.com/actions/setup-python/issues/766">#766</a>)</li>
<li><a href="https://github.com/actions/setup-python/commit/9a7ac94420f42ee15fc60ab88d0dca4be1fd5757"><code>9a7ac94</code></a> Bump undici from 5.27.2 to 5.28.3 (<a href="https://redirect.github.com/actions/setup-python/issues/817">#817</a>)</li>
<li><a href="https://github.com/actions/setup-python/commit/871daa956ca9ea99f3c3e30acb424b7960676734"><code>871daa9</code></a> Fix the "Specifying multiple Python/PyPy versions" link (<a href="https://redirect.github.com/actions/setup-python/issues/782">#782</a>)</li>
<li><a href="https://github.com/actions/setup-python/commit/2f078955e4d0f34cc7a8b0108b2eb7bbe154438e"><code>2f07895</code></a> Fix broken README.md link (<a href="https://redirect.github.com/actions/setup-python/issues/793">#793</a>)</li>
<li><a href="https://github.com/actions/setup-python/commit/e9d6f990972a57673cdb72ec29e19d42ba28880f"><code>e9d6f99</code></a> Replace setup-python@v4 by setup-python@v5 in README (<a href="https://redirect.github.com/actions/setup-python/issues/776">#776</a>)</li>
<li>See full diff in <a href="https://github.com/actions/setup-python/compare/0a5c61591373683505ea898e09a3ea4f39ef2b9c...82c7e631bb3cdc910f68e0081d67478d79c6982d">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details> | {
"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/6677/reactions"
} | https://api.github.com/repos/psf/requests/issues/6677/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6677.diff",
"html_url": "https://github.com/psf/requests/pull/6677",
"merged_at": "2024-04-01T17:36:47Z",
"patch_url": "https://github.com/psf/requests/pull/6677.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6677"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6676 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6676/labels{/name} | https://api.github.com/repos/psf/requests/issues/6676/comments | https://api.github.com/repos/psf/requests/issues/6676/events | https://github.com/psf/requests/issues/6676 | 2,217,861,786 | I_kwDOABTKOs6EMeKa | 6,676 | Error in requests version 2.31.0 with urllib3 2.2.1 and 2.10 raise IncompleteRead(self._fp_bytes_read, self.length_remaining) | {
"avatar_url": "https://avatars.githubusercontent.com/u/5290055?v=4",
"events_url": "https://api.github.com/users/pcor/events{/privacy}",
"followers_url": "https://api.github.com/users/pcor/followers",
"following_url": "https://api.github.com/users/pcor/following{/other_user}",
"gists_url": "https://api.github.com/users/pcor/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pcor",
"id": 5290055,
"login": "pcor",
"node_id": "MDQ6VXNlcjUyOTAwNTU=",
"organizations_url": "https://api.github.com/users/pcor/orgs",
"received_events_url": "https://api.github.com/users/pcor/received_events",
"repos_url": "https://api.github.com/users/pcor/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pcor/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pcor/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pcor",
"user_view_type": "public"
} | [
{
"color": "e11d21",
"default": false,
"description": null,
"id": 136589914,
"name": "Needs Info",
"node_id": "MDU6TGFiZWwxMzY1ODk5MTQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Needs%20Info"
},
{
"color": "fef2c0",
"default": false,
"description": null,
"id": 298537994,
"name": "Needs More Information",
"node_id": "MDU6TGFiZWwyOTg1Mzc5OTQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Needs%20More%20Information"
},
{
"color": "0366d6",
"default": false,
"description": "Pull requests that update a dependency file",
"id": 1868210094,
"name": "dependencies",
"node_id": "MDU6TGFiZWwxODY4MjEwMDk0",
"url": "https://api.github.com/repos/psf/requests/labels/dependencies"
}
] | closed | false | null | [] | null | 2 | 2024-04-01T09:00:04Z | 2024-04-01T22:35:40Z | 2024-04-01T22:35:40Z | NONE | null | <!-- Summary. -->
We have updated from urllib3 1.26 to urllib3 2.xx and now we have same requests with this error.
lib/python3.10/site-packages/urllib3/response.py", line 833, in _raw_read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
urllib3.exceptions.IncompleteRead: IncompleteRead(119510 bytes read, -59755 more expected)
We have moved to version 1.26.18 and it works correctly with the same requests. We have done several tests and there are some requests that always fail with urllib3 version 2.1 or 2.2.1 and work correctly with version 1.26.
| {
"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/6676/reactions"
} | https://api.github.com/repos/psf/requests/issues/6676/timeline | null | not_planned | null | null | false | [
"\r\nI have installed an empty enviroment with conda and requests:\r\n\r\npython 3.12.2\r\nrequests 2.31.0\r\nurllib3 1.26.18\r\n\r\nAnd we have no errors, when I install urllib3 2.1.0, the program crashes, Below is a simple test program that crashes.\r\n\r\npython 3.12.2\r\nrequests 2.31.0\r\nurllib3 2.1.0\r\n\r\n```\r\nimport requests\r\nfrom io import BytesIO\r\n\r\n\r\nclass Test():\r\n def __init__(self):\r\n self.proxy = None\r\n self.headers = {}\r\n self.headers['Connection'] = 'close'\r\n self.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'\r\n self.headers['Accept'] = '*/*'\r\n self.headers['Accept-Encoding'] = 'gzip, deflate'\r\n self.session = requests.Session()\r\n\r\n def get(self, url):\r\n self.session.headers = self.headers\r\n r = self.session.get(url, proxies=self.proxy, allow_redirects=True, stream=True)\r\n raw_content = r.raw.read()\r\n content_length = len(raw_content)\r\n r.raw._fp = BytesIO(raw_content)\r\n content=r.text\r\n with open('test.html', 'w', encoding='utf-8') as fo:\r\n fo.write(content)\r\n\r\nlurl = 'https://www.nolon.es/es/es/comprar?MainUseId=&Invest=False&ClassId=&HighlightTypeId=&PropertyTypeId=&DistrictId=30&CountyId=&AreaRange.MinValue=&AreaRange.MaxValue=&PriceRange.MinValue=0&PriceRange.MaxValue=&CampaignId=&PropertyId=&ResultsPerPage=27&SortOrderBy=DescendingDate&SortOrderBy=DescendingDate'\r\nTest().get(lurl)`\r\n\r\n\r\n\r\n```\r\nThis is the error I get:\r\n\r\ntraceback (most recent call last):\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/urllib3/response.py\", line 712, in _error_catcher\r\n yield\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/urllib3/response.py\", line 833, in _raw_read\r\n raise IncompleteRead(self._fp_bytes_read, self.length_remaining)\r\nurllib3.exceptions.IncompleteRead: IncompleteRead(42084 bytes read, -21042 more expected)\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/requests/models.py\", line 816, in generate\r\n yield from self.raw.stream(chunk_size, decode_content=True)\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/urllib3/response.py\", line 934, in stream\r\n data = self.read(amt=amt, decode_content=decode_content)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/urllib3/response.py\", line 877, in read\r\n data = self._raw_read(amt)\r\n ^^^^^^^^^^^^^^^^^^^\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/urllib3/response.py\", line 811, in _raw_read\r\n with self._error_catcher():\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/contextlib.py\", line 158, in __exit__\r\n self.gen.throw(value)\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/urllib3/response.py\", line 729, in _error_catcher\r\n raise ProtocolError(f\"Connection broken: {e!r}\", e) from e\r\nurllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(42084 bytes read, -21042 more expected)', IncompleteRead(42084 bytes read, -21042 more expected))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/home/datos1/test/test.py\", line 28, in <module>\r\n Test().get(lurl)\r\n File \"/home/datos1/test/test.py\", line 23, in get\r\n content=r.text\r\n ^^^^^^\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/requests/models.py\", line 923, in text\r\n if not self.content:\r\n ^^^^^^^^^^^^\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/requests/models.py\", line 899, in content\r\n self._content = b\"\".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b\"\"\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/opt/miniconda3/envs/test/lib/python3.12/site-packages/requests/models.py\", line 818, in generate\r\n raise ChunkedEncodingError(e)\r\nrequests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(42084 bytes read, -21042 more expected)', IncompleteRead(42084 bytes read, -21042 more expected))\r\n\r\n\r\n",
"You must never call `r.text` or `r.content` after consuming the underlying response data. That's you're actual bug. I suspect requests and urllib3 were silently returning nothing but you're code has always been the issue"
] |
https://api.github.com/repos/psf/requests/issues/6675 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6675/labels{/name} | https://api.github.com/repos/psf/requests/issues/6675/comments | https://api.github.com/repos/psf/requests/issues/6675/events | https://github.com/psf/requests/pull/6675 | 2,210,123,960 | PR_kwDOABTKOs5q5GcK | 6,675 | Fix utils functions with invalid ip/cidr inputs | {
"avatar_url": "https://avatars.githubusercontent.com/u/125774763?v=4",
"events_url": "https://api.github.com/users/vcapparelli/events{/privacy}",
"followers_url": "https://api.github.com/users/vcapparelli/followers",
"following_url": "https://api.github.com/users/vcapparelli/following{/other_user}",
"gists_url": "https://api.github.com/users/vcapparelli/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/vcapparelli",
"id": 125774763,
"login": "vcapparelli",
"node_id": "U_kgDOB38rqw",
"organizations_url": "https://api.github.com/users/vcapparelli/orgs",
"received_events_url": "https://api.github.com/users/vcapparelli/received_events",
"repos_url": "https://api.github.com/users/vcapparelli/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/vcapparelli/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vcapparelli/subscriptions",
"type": "User",
"url": "https://api.github.com/users/vcapparelli",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 2 | 2024-03-27T08:03:45Z | 2024-11-01T19:26:04Z | null | NONE | null | - add test cases reported in #5131
- fix utils functions `address_in_network`, `is_ipv4_address` and `is_valid_cidr`
- replace socket with `ipaddress` module
- prepare ipv6 support
Fixes #5131 | 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/6675/reactions"
} | https://api.github.com/repos/psf/requests/issues/6675/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6675.diff",
"html_url": "https://github.com/psf/requests/pull/6675",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6675.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6675"
} | true | [
"@kennethreitz, @Lukasa, @sigmavirus24, @nateprewitt, @slingamn,\r\n\r\n This is my first contribution to this project, and I don't know if is necessary request to someone to review the PR",
"@Pjrich1313, \r\n\r\n> Fast node isn't work\r\n\r\nHow can i test this case?"
] |
https://api.github.com/repos/psf/requests/issues/6674 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6674/labels{/name} | https://api.github.com/repos/psf/requests/issues/6674/comments | https://api.github.com/repos/psf/requests/issues/6674/events | https://github.com/psf/requests/pull/6674 | 2,206,608,620 | PR_kwDOABTKOs5qtDkk | 6,674 | Feature update | {
"avatar_url": "https://avatars.githubusercontent.com/u/159827478?v=4",
"events_url": "https://api.github.com/users/duke-maosa/events{/privacy}",
"followers_url": "https://api.github.com/users/duke-maosa/followers",
"following_url": "https://api.github.com/users/duke-maosa/following{/other_user}",
"gists_url": "https://api.github.com/users/duke-maosa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/duke-maosa",
"id": 159827478,
"login": "duke-maosa",
"node_id": "U_kgDOCYbGFg",
"organizations_url": "https://api.github.com/users/duke-maosa/orgs",
"received_events_url": "https://api.github.com/users/duke-maosa/received_events",
"repos_url": "https://api.github.com/users/duke-maosa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/duke-maosa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/duke-maosa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/duke-maosa",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-03-25T20:10:09Z | 2024-03-25T20:16:32Z | 2024-03-25T20:15:14Z | NONE | null | 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/6674/reactions"
} | https://api.github.com/repos/psf/requests/issues/6674/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6674.diff",
"html_url": "https://github.com/psf/requests/pull/6674",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6674.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6674"
} | true | [
"@TheDukeroyalty, we're going to have to ask you please stop opening PRs against this repo. Please refer to my previous comment in #6672 or the [official GitHub PR documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). Further PRs with the same content may result in restriction of permissions to post in the repository. Thanks for your cooperation."
] |
https://api.github.com/repos/psf/requests/issues/6673 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6673/labels{/name} | https://api.github.com/repos/psf/requests/issues/6673/comments | https://api.github.com/repos/psf/requests/issues/6673/events | https://github.com/psf/requests/pull/6673 | 2,206,597,474 | PR_kwDOABTKOs5qtBH4 | 6,673 | Feature update | {
"avatar_url": "https://avatars.githubusercontent.com/u/159827478?v=4",
"events_url": "https://api.github.com/users/duke-maosa/events{/privacy}",
"followers_url": "https://api.github.com/users/duke-maosa/followers",
"following_url": "https://api.github.com/users/duke-maosa/following{/other_user}",
"gists_url": "https://api.github.com/users/duke-maosa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/duke-maosa",
"id": 159827478,
"login": "duke-maosa",
"node_id": "U_kgDOCYbGFg",
"organizations_url": "https://api.github.com/users/duke-maosa/orgs",
"received_events_url": "https://api.github.com/users/duke-maosa/received_events",
"repos_url": "https://api.github.com/users/duke-maosa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/duke-maosa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/duke-maosa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/duke-maosa",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 0 | 2024-03-25T20:04:29Z | 2024-03-25T20:06:53Z | 2024-03-25T20:06:51Z | NONE | null | 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/6673/reactions"
} | https://api.github.com/repos/psf/requests/issues/6673/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6673.diff",
"html_url": "https://github.com/psf/requests/pull/6673",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6673.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6673"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6672 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6672/labels{/name} | https://api.github.com/repos/psf/requests/issues/6672/comments | https://api.github.com/repos/psf/requests/issues/6672/events | https://github.com/psf/requests/pull/6672 | 2,206,525,789 | PR_kwDOABTKOs5qsxGh | 6,672 | added a user input prompt. | {
"avatar_url": "https://avatars.githubusercontent.com/u/159827478?v=4",
"events_url": "https://api.github.com/users/duke-maosa/events{/privacy}",
"followers_url": "https://api.github.com/users/duke-maosa/followers",
"following_url": "https://api.github.com/users/duke-maosa/following{/other_user}",
"gists_url": "https://api.github.com/users/duke-maosa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/duke-maosa",
"id": 159827478,
"login": "duke-maosa",
"node_id": "U_kgDOCYbGFg",
"organizations_url": "https://api.github.com/users/duke-maosa/orgs",
"received_events_url": "https://api.github.com/users/duke-maosa/received_events",
"repos_url": "https://api.github.com/users/duke-maosa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/duke-maosa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/duke-maosa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/duke-maosa",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 2 | 2024-03-25T19:27:10Z | 2024-03-26T07:43:36Z | 2024-03-25T19:32:28Z | NONE | null | Intro To Python Assignment
Objective: To learn how to take user input in Python
Write a program that asks the user for their name, age, and location and then prints out a personalized message.
Instructions:
Create a new Python file and name it "user_input.py"
Use the input() function to ask the user for their name and store it in a variable called "name".
Use the input() function to ask the user for their age and store it in a variable called "age".
Use the input() function to ask the user for their location and store it in a variable called "location".
Print out a personalized message using the user's name, age, and location. For example: "Hello [name], you are [age] years old and live in [location]."
Save and run the program to see the output. | {
"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/6672/reactions"
} | https://api.github.com/repos/psf/requests/issues/6672/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6672.diff",
"html_url": "https://github.com/psf/requests/pull/6672",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6672.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6672"
} | true | [
"Hi @TheDukeroyalty,\r\n\r\nYou may have accidently opened a PR against the wrong repository. In the future you'll want to do test [PRs against your own repository](https://github.com/TheDukeroyalty/advanced-git_requests/compare/main...TheDukeroyalty:advanced-git_requests:main) by ensuring you have the right Base repository selected. I'll close this out for now.",
"Hi,\r\n\r\nThank you for bringing this to my attention. I acknowledge that I made a\r\nmistake in opening the PR against the wrong repository. I am currently a\r\nstudent and was in the process of learning and experimenting with GitHub\r\nfor a class assignment. I apologize for any inconvenience this may have\r\ncaused. I will ensure to double-check and select the correct Base\r\nrepository for any future PRs.\r\n\r\nBest regards,\r\n\r\n\r\nOn Mon, Mar 25, 2024 at 10:32 PM Nate Prewitt ***@***.***>\r\nwrote:\r\n\r\n> Hi @TheDukeroyalty <https://github.com/TheDukeroyalty>,\r\n>\r\n> You may have accidently opened a PR against the wrong repository. In the\r\n> future you'll want to do test PRs against your own repository\r\n> <https://github.com/TheDukeroyalty/advanced-git_requests/compare/main...TheDukeroyalty:advanced-git_requests:main>\r\n> by ensuring you have the right Base repository selected. I'll close this\r\n> out for now.\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/psf/requests/pull/6672#issuecomment-2018759781>, or\r\n> unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/BGDMMFWZXKOXZSB76FRCHE3Y2B3WHAVCNFSM6AAAAABFHTF6IWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJYG42TSNZYGE>\r\n> .\r\n> You are receiving this because you were mentioned.Message ID:\r\n> ***@***.***>\r\n>\r\n"
] |
https://api.github.com/repos/psf/requests/issues/6671 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6671/labels{/name} | https://api.github.com/repos/psf/requests/issues/6671/comments | https://api.github.com/repos/psf/requests/issues/6671/events | https://github.com/psf/requests/issues/6671 | 2,205,886,037 | I_kwDOABTKOs6DeyZV | 6,671 | [AttributeError]: Module 'collections' has no attribute 'MutableMapping' | {
"avatar_url": "https://avatars.githubusercontent.com/u/67120469?v=4",
"events_url": "https://api.github.com/users/GopalVerma1303/events{/privacy}",
"followers_url": "https://api.github.com/users/GopalVerma1303/followers",
"following_url": "https://api.github.com/users/GopalVerma1303/following{/other_user}",
"gists_url": "https://api.github.com/users/GopalVerma1303/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/GopalVerma1303",
"id": 67120469,
"login": "GopalVerma1303",
"node_id": "MDQ6VXNlcjY3MTIwNDY5",
"organizations_url": "https://api.github.com/users/GopalVerma1303/orgs",
"received_events_url": "https://api.github.com/users/GopalVerma1303/received_events",
"repos_url": "https://api.github.com/users/GopalVerma1303/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/GopalVerma1303/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/GopalVerma1303/subscriptions",
"type": "User",
"url": "https://api.github.com/users/GopalVerma1303",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-03-25T14:24:15Z | 2024-03-25T16:13:56Z | 2024-03-25T16:13:56Z | NONE | null | <!-- Summary. -->
## Expected Result
Should not result this error and run flask server successfully or at-least suggest upgrading or downgrading any dependency if that's the issue (using pipdeptree currently).
<!-- What you expected. -->
## Actual Result
<!-- What happened instead. -->
```bash
Traceback (most recent call last):
File "/Volumes/GopalSSD/EC/quillbook/server/upload_image.py", line 2, in <module>
import pyrebase
File "/Volumes/GopalSSD/EC/quillbook/server/venv/lib/python3.12/site-packages/pyrebase/__init__.py", line 1, in <module>
from .pyrebase import initialize_app
File "/Volumes/GopalSSD/EC/quillbook/server/venv/lib/python3.12/site-packages/pyrebase/pyrebase.py", line 1, in <module>
import requests
File "/Volumes/GopalSSD/EC/quillbook/server/venv/lib/python3.12/site-packages/requests/__init__.py", line 63, in <module>
from . import utils
File "/Volumes/GopalSSD/EC/quillbook/server/venv/lib/python3.12/site-packages/requests/utils.py", line 27, in <module>
from .cookies import RequestsCookieJar, cookiejar_from_dict
File "/Volumes/GopalSSD/EC/quillbook/server/venv/lib/python3.12/site-packages/requests/cookies.py", line 172, in <module>
class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'MutableMapping'
```
## Reproduction Steps
### Create upload_image.py flask server .py file
```python
from flask import Flask, request
import pyrebase
app = Flask(__name__)
config = {
"apiKey": "",
"authDomain": "",
"databaseURL": "",
"projectId": "",
"storageBucket": "",
"messagingSenderId": "",
"appId": "",
"measurementId": "",
"serviceAccount": ""
}
firebase = pyrebase.initialize_app(config)
storage = firebase.storage()
@app.route("/", methods=["GET"])
def index():
return "Welcome to Quillbook!"
@app.route("/upload", methods=["POST"])
def upload_file():
if "file" not in request.files:
return "No file part"
file = request.files["file"]
if file.filename == "":
return "No selected file"
filename = "uploads/" + str(file.filename)
storage.child(filename).put(file)
return "File uploaded successfully"
```
### Once created, run it:
```python
python3 upload_image.py
```
## System Information and Dep. Tree
```bash
Python==3.12.2
Flask==3.0.2
├── blinker [required: >=1.6.2, installed: 1.7.0]
├── click [required: >=8.1.3, installed: 8.1.7]
├── itsdangerous [required: >=2.1.2, installed: 2.1.2]
├── Jinja2 [required: >=3.1.2, installed: 3.1.3]
│ └── MarkupSafe [required: >=2.0, installed: 2.1.5]
└── Werkzeug [required: >=3.0.0, installed: 3.0.1]
└── MarkupSafe [required: >=2.1.1, installed: 2.1.5]
pip==24.0
pipdeptree==2.16.1
Pyrebase==3.0.27
├── gcloud [required: ==0.17.0, installed: 0.17.0]
│ ├── googleapis-common-protos [required: Any, installed: 1.63.0]
│ │ └── protobuf [required: >=3.19.5,<5.0.0.dev0,!=4.21.5,!=4.21.4,!=4.21.3,!=4.21.2,!=4.21.1,!=3.20.1,!=3.20.0, installed: 4.25.3]
│ ├── httplib2 [required: >=0.9.1, installed: 0.22.0]
│ │ └── pyparsing [required: >=2.4.2,<4,!=3.0.3,!=3.0.2,!=3.0.1,!=3.0.0, installed: 3.1.2]
│ ├── oauth2client [required: >=2.0.1, installed: 3.0.0]
│ │ ├── httplib2 [required: >=0.9.1, installed: 0.22.0]
│ │ │ └── pyparsing [required: >=2.4.2,<4,!=3.0.3,!=3.0.2,!=3.0.1,!=3.0.0, installed: 3.1.2]
│ │ ├── pyasn1 [required: >=0.1.7, installed: 0.5.1]
│ │ ├── pyasn1-modules [required: >=0.0.5, installed: 0.3.0]
│ │ │ └── pyasn1 [required: >=0.4.6,<0.6.0, installed: 0.5.1]
│ │ ├── rsa [required: >=3.1.4, installed: 4.9]
│ │ │ └── pyasn1 [required: >=0.1.3, installed: 0.5.1]
│ │ └── six [required: >=1.6.1, installed: 1.16.0]
│ ├── protobuf [required: >=3.0.0b2,!=3.0.0.b2.post1, installed: 4.25.3]
│ └── six [required: Any, installed: 1.16.0]
├── oauth2client [required: ==3.0.0, installed: 3.0.0]
│ ├── httplib2 [required: >=0.9.1, installed: 0.22.0]
│ │ └── pyparsing [required: >=2.4.2,<4,!=3.0.3,!=3.0.2,!=3.0.1,!=3.0.0, installed: 3.1.2]
│ ├── pyasn1 [required: >=0.1.7, installed: 0.5.1]
│ ├── pyasn1-modules [required: >=0.0.5, installed: 0.3.0]
│ │ └── pyasn1 [required: >=0.4.6,<0.6.0, installed: 0.5.1]
│ ├── rsa [required: >=3.1.4, installed: 4.9]
│ │ └── pyasn1 [required: >=0.1.3, installed: 0.5.1]
│ └── six [required: >=1.6.1, installed: 1.16.0]
├── pycryptodome [required: ==3.4.3, installed: 3.4.3]
├── python-jwt [required: ==2.0.1, installed: 2.0.1]
│ └── jws [required: >=0.1.3, installed: 0.1.3]
├── requests [required: ==2.11.1, installed: 2.11.1]
└── requests-toolbelt [required: ==0.7.0, installed: 0.7.0]
└── requests [required: >=2.0.1,<3.0.0, installed: 2.11.1]
urllib3==2.2.1
```
| {
"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/6671/reactions"
} | https://api.github.com/repos/psf/requests/issues/6671/timeline | null | not_planned | null | null | false | [
"You're using requests 2.11 which is ancient. That's why you're encountering this. Upgrade the version and it will go away "
] |
https://api.github.com/repos/psf/requests/issues/6670 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6670/labels{/name} | https://api.github.com/repos/psf/requests/issues/6670/comments | https://api.github.com/repos/psf/requests/issues/6670/events | https://github.com/psf/requests/issues/6670 | 2,204,290,425 | I_kwDOABTKOs6DYs15 | 6,670 | Support for PKey (openssl) or cryptography Key classes in cert parameter in request (and linked) calls | {
"avatar_url": "https://avatars.githubusercontent.com/u/7229754?v=4",
"events_url": "https://api.github.com/users/msetina/events{/privacy}",
"followers_url": "https://api.github.com/users/msetina/followers",
"following_url": "https://api.github.com/users/msetina/following{/other_user}",
"gists_url": "https://api.github.com/users/msetina/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/msetina",
"id": 7229754,
"login": "msetina",
"node_id": "MDQ6VXNlcjcyMjk3NTQ=",
"organizations_url": "https://api.github.com/users/msetina/orgs",
"received_events_url": "https://api.github.com/users/msetina/received_events",
"repos_url": "https://api.github.com/users/msetina/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/msetina/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/msetina/subscriptions",
"type": "User",
"url": "https://api.github.com/users/msetina",
"user_view_type": "public"
} | [
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156041422,
"name": "actions/autoclose-feat",
"node_id": "LA_kwDOABTKOs8AAAABbu28zg",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-feat"
}
] | closed | true | null | [] | null | 1 | 2024-03-24T10:48:49Z | 2024-03-24T10:48:58Z | 2024-03-24T10:48:58Z | NONE | off-topic | I would like to use PKCS11 card for client authentication with your great library, but I am stuck with the need for key files. WIth the requested classes extensibility of the key support can be open for others to explore.
| {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6670/reactions"
} | https://api.github.com/repos/psf/requests/issues/6670/timeline | null | not_planned | null | null | false | [
"As described in the template, Requests is not accepting feature requests"
] |
https://api.github.com/repos/psf/requests/issues/6669 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6669/labels{/name} | https://api.github.com/repos/psf/requests/issues/6669/comments | https://api.github.com/repos/psf/requests/issues/6669/events | https://github.com/psf/requests/issues/6669 | 2,204,020,760 | I_kwDOABTKOs6DXrAY | 6,669 | Failed to ignore the SSL certificate verification when using `verify=False` option | {
"avatar_url": "https://avatars.githubusercontent.com/u/16805527?v=4",
"events_url": "https://api.github.com/users/urbanogilson/events{/privacy}",
"followers_url": "https://api.github.com/users/urbanogilson/followers",
"following_url": "https://api.github.com/users/urbanogilson/following{/other_user}",
"gists_url": "https://api.github.com/users/urbanogilson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/urbanogilson",
"id": 16805527,
"login": "urbanogilson",
"node_id": "MDQ6VXNlcjE2ODA1NTI3",
"organizations_url": "https://api.github.com/users/urbanogilson/orgs",
"received_events_url": "https://api.github.com/users/urbanogilson/received_events",
"repos_url": "https://api.github.com/users/urbanogilson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/urbanogilson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/urbanogilson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/urbanogilson",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 5 | 2024-03-23T19:40:30Z | 2024-03-24T12:49:47Z | 2024-03-24T12:49:47Z | NONE | null | <!-- Summary. -->
Requests is not ignoring the SSL certificate verification when using the `verify=False` option.
## Expected Result
Same as curl with `-k`
```bash
$ curl -k https://website
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.20.1</center>
</body>
</html>
```
or
```python
import httpx
session = httpx.Client(verify=False)
session.get("https://website")
```
## Actual Result
```python
>> import requests
>> requests.get("https://website", verify=False)
Traceback (most recent call last):
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 467, in _make_request
self._validate_conn(conn)
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1092, in _validate_conn
conn.connect()
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/connection.py", line 635, in connect
sock_and_verified = _ssl_wrap_socket_and_match_hostname(
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/connection.py", line 776, in _ssl_wrap_socket_and_match_hostname
ssl_sock = ssl_wrap_socket(
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 466, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 510, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/local/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/usr/local/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/usr/local/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 491, in _make_request
raise new_e
urllib3.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/vscode/.local/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "/home/vscode/.local/lib/python3.10/site-packages/urllib3/util/retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='website', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vscode/.local/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/home/vscode/.local/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/home/vscode/.local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/vscode/.local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/home/vscode/.local/lib/python3.10/site-packages/requests/adapters.py", line 517, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='website', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)')))
```
The result is similar to curl without `-k`.
```
$ curl -v https://website
* Trying 255.255.255.255:443...
* Connected to website (255.255.255.255) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
```
## Reproduction Steps
```python
import requests
session = requests.Session()
session.verify = False
session.get("https://website")
```
or
```python
import requests
session.get("https://website", verify=False)
```
## System Information
Tested in two systems
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.1.0"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.4"
},
"implementation": {
"name": "CPython",
"version": "3.10.12"
},
"platform": {
"release": "5.15.146.1-microsoft-standard-WSL2",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "1010117f"
},
"urllib3": {
"version": "2.0.3"
},
"using_charset_normalizer": true,
"using_pyopenssl": false
}
```
$ python -m requests.help
```json
{
"chardet": {
"version": "5.2.0"
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": "42.0.5"
},
"idna": {
"version": "3.6"
},
"implementation": {
"name": "CPython",
"version": "3.10.12"
},
"platform": {
"release": "6.1.58+",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "30200010",
"version": "24.1.0"
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "30000020"
},
"urllib3": {
"version": "2.0.7"
},
"using_charset_normalizer": false,
"using_pyopenssl": true
}
```
Note: URL and IP were masked to `https://website` and `255.255.255.255` respectively
| {
"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/6669/reactions"
} | https://api.github.com/repos/psf/requests/issues/6669/timeline | null | not_planned | null | null | false | [
"A handshake error is not the same as verifying a trust chain. My guess is that requests/urllib3 and your server cannot agree on ciphersuites to use during the handshake. Otherwise you would see a very different exception message. ",
"From https://www.ssllabs.com/ssltest the supported cipher suites:\r\n\r\n<pre>\r\n<b>Protocols</b>\r\nTLS 1.3\tNo\r\nTLS 1.2\tYes\r\nTLS 1.1\tYes\r\nTLS 1.0\tYes\r\nSSL 3\tNo\r\nSSL 2\tNo\r\n\r\n<b>Cipher Suites</b>\r\n# TLS 1.2 (suites in server-preferred order)\r\nTLS_RSA_WITH_AES_256_CBC_SHA256 (0x3d) WEAK\t256\r\nTLS_RSA_WITH_AES_256_CBC_SHA (0x35) WEAK\t256\r\nTLS_RSA_WITH_AES_256_GCM_SHA384 (0x9d) WEAK\t256\r\nTLS_RSA_WITH_AES_128_CBC_SHA256 (0x3c) WEAK\t128\r\nTLS_RSA_WITH_AES_128_CBC_SHA (0x2f) WEAK\t128\r\nTLS_RSA_WITH_AES_128_GCM_SHA256 (0x9c) WEAK\t128\r\n# TLS 1.1 (suites in server-preferred order)\r\nTLS_RSA_WITH_AES_256_CBC_SHA (0x35) WEAK\t256\r\nTLS_RSA_WITH_AES_128_CBC_SHA (0x2f) WEAK\t128\r\n# TLS 1.0 (suites in server-preferred order)\r\nTLS_RSA_WITH_AES_256_CBC_SHA (0x35) WEAK\t256\r\nTLS_RSA_WITH_AES_128_CBC_SHA (0x2f) WEAK\t128\r\n</pre>",
"Yeah, the only cipher suites this site offers are awful, and I suspect that if you do the following:\r\n\r\n```py\r\nfrom urllib3.util.ssl_ import create_urllib3_context\r\n\r\nfor item in create_urllib3_context().get_ciphers():\r\n print(item['name'])\r\n```\r\n\r\nI would suggest trying the following:\r\n\r\n```py\r\nimport urllib3\r\n\r\nhttp = urllib3.PoolManager()\r\nresponse = http.request('GET', 'https://...', ca_certs=\"CERT_NONE\")\r\n```\r\n\r\nI expect you'll encounter the same issue.",
"You are right, it is reproducible using `urllib3`\r\n\r\n```python\r\nfrom urllib3.util.ssl_ import create_urllib3_context\r\n\r\nfor item in create_urllib3_context().get_ciphers():\r\n print(item['name'])\r\n\r\nTLS_AES_256_GCM_SHA384\r\nTLS_CHACHA20_POLY1305_SHA256\r\nTLS_AES_128_GCM_SHA256\r\nECDHE-ECDSA-AES256-GCM-SHA384\r\nECDHE-RSA-AES256-GCM-SHA384\r\nECDHE-ECDSA-AES128-GCM-SHA256\r\nECDHE-RSA-AES128-GCM-SHA256\r\nECDHE-ECDSA-CHACHA20-POLY1305\r\nECDHE-RSA-CHACHA20-POLY1305\r\nECDHE-ECDSA-AES256-SHA384\r\nECDHE-RSA-AES256-SHA384\r\nECDHE-ECDSA-AES128-SHA256\r\nECDHE-RSA-AES128-SHA256\r\nDHE-RSA-AES256-GCM-SHA384\r\nDHE-RSA-AES128-GCM-SHA256\r\nDHE-RSA-AES256-SHA256\r\nDHE-RSA-AES128-SHA256\r\n```\r\n\r\n----\r\n```python\r\nhttp = urllib3.PoolManager(ca_certs=None)\r\nresponse = http.request('GET', 'https://website')\r\n\r\nTraceback (most recent call last):\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 467, in _make_request\r\n self._validate_conn(conn)\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 1092, in _validate_conn\r\n conn.connect()\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connection.py\", line 635, in connect\r\n sock_and_verified = _ssl_wrap_socket_and_match_hostname(\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connection.py\", line 776, in _ssl_wrap_socket_and_match_hostname\r\n ssl_sock = ssl_wrap_socket(\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/util/ssl_.py\", line 466, in ssl_wrap_socket\r\n ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/util/ssl_.py\", line 510, in _ssl_wrap_socket_impl\r\n return ssl_context.wrap_socket(sock, server_hostname=server_hostname)\r\n File \"/usr/local/lib/python3.10/ssl.py\", line 513, in wrap_socket\r\n return self.sslsocket_class._create(\r\n File \"/usr/local/lib/python3.10/ssl.py\", line 1071, in _create\r\n self.do_handshake()\r\n File \"/usr/local/lib/python3.10/ssl.py\", line 1342, in do_handshake\r\n self._sslobj.do_handshake()\r\nssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 790, in urlopen\r\n response = self._make_request(\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 491, in _make_request\r\n raise new_e\r\nurllib3.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/_request_methods.py\", line 110, in request\r\n return self.request_encode_url(\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/_request_methods.py\", line 143, in request_encode_url\r\n return self.urlopen(method, url, **extra_kw)\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/poolmanager.py\", line 443, in urlopen\r\n response = conn.urlopen(method, u.request_uri, **kw)\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 874, in urlopen\r\n return self.urlopen(\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 874, in urlopen\r\n return self.urlopen(\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 874, in urlopen\r\n return self.urlopen(\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 844, in urlopen\r\n retries = retries.increment(\r\n File \"/home/vscode/.local/lib/python3.10/site-packages/urllib3/util/retry.py\", line 515, in increment\r\n raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]\r\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='websitw', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1007)')))\r\n```\r\n",
"Yeah and as you can see the ciphers that are default on your system (because the version of urllib3 you're using relies on system defaults) don't overlap with the very weak set offered by your server. You can customize the ciphers in creating the context for urllib3 and create a custom requests adapter to work around this but this is not a bug. Using the default ciphers is a good security practice and we will not be modifying things to make default ciphers accept weaker algorithms "
] |
https://api.github.com/repos/psf/requests/issues/6668 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6668/labels{/name} | https://api.github.com/repos/psf/requests/issues/6668/comments | https://api.github.com/repos/psf/requests/issues/6668/events | https://github.com/psf/requests/pull/6668 | 2,203,073,736 | PR_kwDOABTKOs5qhPch | 6,668 | converted summing of strings to f-strings | {
"avatar_url": "https://avatars.githubusercontent.com/u/5280697?v=4",
"events_url": "https://api.github.com/users/igeni/events{/privacy}",
"followers_url": "https://api.github.com/users/igeni/followers",
"following_url": "https://api.github.com/users/igeni/following{/other_user}",
"gists_url": "https://api.github.com/users/igeni/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/igeni",
"id": 5280697,
"login": "igeni",
"node_id": "MDQ6VXNlcjUyODA2OTc=",
"organizations_url": "https://api.github.com/users/igeni/orgs",
"received_events_url": "https://api.github.com/users/igeni/received_events",
"repos_url": "https://api.github.com/users/igeni/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/igeni/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/igeni/subscriptions",
"type": "User",
"url": "https://api.github.com/users/igeni",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-03-22T18:28:10Z | 2024-03-22T22:23:03Z | 2024-03-22T22:23:03Z | NONE | null | converted summing of strings to f-strings to avoid potential cases of type's mismatch and make code more clear | {
"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/6668/reactions"
} | https://api.github.com/repos/psf/requests/issues/6668/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6668.diff",
"html_url": "https://github.com/psf/requests/pull/6668",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6668.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6668"
} | true | [
"We don't accept cosmetic changes that will mask any errors that are purported to be fixed by this change. "
] |
https://api.github.com/repos/psf/requests/issues/6667 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6667/labels{/name} | https://api.github.com/repos/psf/requests/issues/6667/comments | https://api.github.com/repos/psf/requests/issues/6667/events | https://github.com/psf/requests/pull/6667 | 2,197,341,967 | PR_kwDOABTKOs5qNiTk | 6,667 | Avoid reloading root certificates to improve concurrent performance | {
"avatar_url": "https://avatars.githubusercontent.com/u/1207202?v=4",
"events_url": "https://api.github.com/users/agubelu/events{/privacy}",
"followers_url": "https://api.github.com/users/agubelu/followers",
"following_url": "https://api.github.com/users/agubelu/following{/other_user}",
"gists_url": "https://api.github.com/users/agubelu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/agubelu",
"id": 1207202,
"login": "agubelu",
"node_id": "MDQ6VXNlcjEyMDcyMDI=",
"organizations_url": "https://api.github.com/users/agubelu/orgs",
"received_events_url": "https://api.github.com/users/agubelu/received_events",
"repos_url": "https://api.github.com/users/agubelu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/agubelu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/agubelu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/agubelu",
"user_view_type": "public"
} | [] | closed | false | null | [] | {
"closed_at": null,
"closed_issues": 13,
"created_at": "2023-08-13T17:04:53Z",
"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/33",
"id": 9786066,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/33/labels",
"node_id": "MI_kwDOABTKOs4AlVLS",
"number": 33,
"open_issues": 0,
"state": "open",
"title": "2.32.0",
"updated_at": "2024-05-20T14:17:03Z",
"url": "https://api.github.com/repos/psf/requests/milestones/33"
} | 21 | 2024-03-20T11:51:17Z | 2024-10-28T00:08:02Z | 2024-05-15T20:07:26Z | CONTRIBUTOR | null | ## Reproducing the problem
Let's consider the following script. It runs a bunch of concurrent requests against a URL, both with certificate verification enabled and disabled, and outputs the time it takes to do it in both cases.
```py
from time import time
from threading import Thread
import requests
import urllib3
urllib3.disable_warnings()
def do_request(verify):
requests.get('https://example.com', verify=verify)
def measure(verify):
threads = [Thread(target=do_request, args=(verify,)) for _ in range(30)]
start = time()
for t in threads: t.start()
for t in threads: t.join()
end = time()
print(end - start)
measure(verify=True)
measure(verify=False)
```
What's the time difference between the two? It turns out it is highly dependent on your local configuration. On my local machine, with a relatively modern config (Python 3.12 + OpenSSL 3.0.2), the times are `~1.2s` for `verify=True` and `~0.5s` for `verify=False`.
It's a >100% difference, but we initially blamed it on cert verification taking some time. However, we observed even larger differences (>500%) in some environments, and decided to find out what was going on.
## Problem description
Our main use case for requests is running lots of requests concurrently, and we spent some time bisecting this oddity to see if there was room for a performance optimization.
The issue is a bit more clear if you profile the concurrent executions. When verifying certs, these are the top 3 function calls by time spent in them:
```
ncalls tottime percall cumtime percall filename:lineno(function)
30/1 0.681 0.023 0.002 0.002 {method 'load_verify_locations' of '_ssl._SSLContext' objects}
30/1 0.181 0.006 0.002 0.002 {method 'connect' of '_socket.socket' objects}
60/2 0.180 0.003 1.323 0.662 {method 'read' of '_ssl._SSLSocket' objects}
```
Conversely, this is how the top 3 looks like without cert verification:
```
ncalls tottime percall cumtime percall filename:lineno(function)
30/1 0.233 0.008 0.001 0.001 {method 'do_handshake' of '_ssl._SSLSocket' objects}
30/1 0.106 0.004 0.002 0.002 {method 'connect' of '_socket.socket' objects}
60/2 0.063 0.001 0.505 0.253 {method 'read' of '_ssl._SSLSocket' objects}
```
In the first case, a full 0.68 seconds are spent in the `load_verify_locations()` function of the `ssl` module, which configures a `SSLContext` object to use a set of CA certificates for validation. Inside it, there is a C FFI call to OpenSSL's `SSL_CTX_load_verify_locations()` which [is known](https://github.com/python/cpython/issues/95031) to be [quite slow](https://github.com/openssl/openssl/issues/16871). This happens once per request (hence the `30` on the left).
We believe that, in some cases, there is even some blocking going on, either because each FFI call locks up the GIL or because of some thread safety mechanisms in OpenSSL itself. We also think that this is more or less pronounced depending on internal changes between OpenSSL's versions, hence the variability between environments.
When cert validation isn't needed, these calls are skipped which speeds up concurrent performance dramatically.
## Submitted solution
It isn't possible to skip loading root CA certificates entirely, but it isn't necessary to do it on every request. More specifically, a call to `load_verify_locations()` happens when:
- A new `urllib3.connectionpool.HTTPSConnectionPool` is created.
- On connection, by urllib3's `ssl_wrap_socket()`, when the connection's `ca_certs` or `ca_cert_dir` attributes are set (see [the relevant code](https://github.com/urllib3/urllib3/blob/9929d3c4e03b71ba485148a8390cd9411981f40f/src/urllib3/util/ssl_.py#L438)).
The first case doesn't need to be addressed anymore after the latest addition of `_get_connection()`. Since it now passes down `pool_kwargs`, this allows urllib3 to use a cached pool with the same settings every time, instead of creating one per request.
The second one is addressed in this PR. If a verified connection is requested, `_urllib3_request_context()` already makes it so that a connection pool using a `SSLContext` with all relevant certificates loaded is always used. Hence, there is no need to trigger a call to `load_verify_locations()` again.
You can test against https://invalid.badssl.com to check that `verify=True` and `verify=False` still behave as expected and are now equally fast.
I'd like to mention that there have been a few changes in Requests since I started drafting this, and I'm not sure that setting `conn.ca_certs` or `conn.ca_certs = cert_loc` in `cert_verify()` is even still needed, since I think that the logic could be moved to `_urllib3_request_context()` and benefit from using a cached context in those cases too. | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | {
"+1": 5,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 5,
"url": "https://api.github.com/repos/psf/requests/issues/6667/reactions"
} | https://api.github.com/repos/psf/requests/issues/6667/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6667.diff",
"html_url": "https://github.com/psf/requests/pull/6667",
"merged_at": "2024-05-15T20:07:26Z",
"patch_url": "https://github.com/psf/requests/pull/6667.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6667"
} | true | [
"We've been hit by the slowness of `load_verify_locations` as well. After turning `request.get` into `session.get` performances improves a lot. But we still face the performance hit, because:\r\n- it happens on the first connection (vs. module init time). This creates noise in our live profiles.\r\n- after connections in the `PoolManager`/`HTTPConnectionPool` time out, the SSLContext is recreated over and over\r\n- `HTTPConnectionPool`s are keyed by host/scheme/... which means a new SSLContext is created for each pool\r\n- we use `session.get(proxies={...})` which leads to even more pools and SSLContext initializations (this part might not yet be covered by this PR)\r\n\r\nIs there anything I can do to advance this PR?",
"Given this breaks the behavior of the module for a whole class of users as it's written today, there's not much to do to advance it. \n\nEven still, I'm pretty sure SSLComtext is not itself thread safe but I need to find a reference for that so loading it at the module will likely cause issues",
"> Even still, I'm pretty sure SSLComtext is not itself thread safe but I need to find a reference for that so loading it at the module will likely cause issues\r\n\r\nHere's your quote: https://github.com/python/cpython/issues/95031#issuecomment-1749489998\r\n> SSLContext is thread and async-safe.\r\n\r\nCan't speak for the reliability of that quote though. Given that a lot of time is spent in `pthread_rwlock` it doesn't sound completely unbelievable though.",
"[Here](https://github.com/openssl/openssl/issues/2165) is a more reliable reference from the openssl guys themselves about `SSL_CTX`. The info is from 2017 though.\r\n\r\nEDIT: [Here](https://github.com/openssl/openssl/blob/067fbc01b9e867b31c71091d62f0f9012dc9e41a/doc/man7/openssl-threads.pod#L5) are the official docs for openssl.\r\n\r\nUnfortunately the [python SSLContext docs](https://github.com/openssl/openssl/blob/067fbc01b9e867b31c71091d62f0f9012dc9e41a/doc/man7/openssl-threads.pod#L5) don't mention thread safety at all.\r\n\r\nFound this in the [Python 3.13.0a5 release docs](https://github.com/python/cpython/blob/1b22d801b86ed314c4804b19a1fc4b13484e3cea/Misc/NEWS.d/3.13.0a5.rst#L23):\r\n> ssl.SSLContext.cert_store_stats and ssl.SSLContext.get_ca_certs now correctly lock access to the certificate store, when the ssl.SSLContext is shared across multiple threads.\r\n\r\nAsked for official clarification on the thread-safety of SSLContext [here](https://github.com/python/cpython/issues/95031#issuecomment-2094561182).",
"`SSLContext` is designed to be shared and used for multiple connections. It is thread safe as long as you don't reconfigure it once it is used by a connection. Adding new certs to the internal trust store is fine, but changing ciphers, verification settings, or mTLS certs can lead to surprising behavior. The problem is unrelated to threads and can even occur in a single-threaded program.\r\n\r\nIf you don't trust me, then please trust David Benjamin's [statement](https://github.com/openssl/openssl/issues/2165#issuecomment-270007943) on threading. He is the main lead behind BoringSSL and did a lot of TLS stuff in Chrome browser.",
"@tiran Thank you very much for your detailed commentary!\r\n\r\n> Given this breaks the behavior of the module for a whole class of users as it's written today, there's not much to do to advance it.\r\n\r\n@sigmavirus24 What exactly are you unhappy about with the current solution and what would an acceptable solution for you look like? Would you prefer something like introducing a new \"ssl_context\" parameter somehow that could be set by the library user and be set to something like `None` for backwards compatibility? Or would you not want to change the `request` api in any way?",
"See #2118\r\n\r\nI recommend that you either use urllib3 directly or switch to httpx. Most of the secret sauce of requests is in urllib3. httpx has HTTP/2 support.",
"> @tiran Thank you very much for your detailed commentary!\n> \n> > Given this breaks the behavior of the module for a whole class of users as it's written today, there's not much to do to advance it.\n> \n> @sigmavirus24 What exactly are you unhappy about with the current solution and what would an acceptable solution for you look like? Would you prefer something like introducing a new \"ssl_context\" parameter somehow that could be set by the library user and be set to something like `None` for backwards compatibility? Or would you not want to change the `request` api in any way?\n\nRequests supports being run (with certifi) inside a zip file created by a tool like pants, pyinstaller, etc. The code here removes that support in loading the trust stores. ",
"Ah, I see that the PR was updated and moved the extraction. I think the last blocker is the context being \"public\" in how it is named. That will encourage people to modify it in a way we don't want to be supporting. People will attempt to modify it anyway but when things go wrong, it will be clear that they weren't intended to modify it. \n\nTo be clear, I expect people to use this to work around libraries that aren't written correctly that leverage requests but do not allow people to specify a trust store or customize a session. Either way, if we rename the default I'm in favor of merging this. Unless @nateprewitt has objections. \n\n(And yes, the caveats around changing ciphers or loading other trust stores is what I recalled being a problem that has odd behavior but even so, making this private will alleviate that likely spike in issues.)",
"Thanks for the follow-up @sigmavirus24. I renamed the default context as requested, please let me know if you'd like any further changes.",
"Thank you so much!\r\n\r\nThis made a big improvement for my use case, which is load generation (https://github.com/locustio/locust), so lots of concurrent request.Sessions. Especially on Windows, where Python 3.12 was completely broken for for my users...\r\n\r\nAny chance 2.32 will be upon us soon? If not, a pre-release version would also be very helpful.",
"We don't have solidified dates for 2.32.0 but I would wager it's sometime in mid-late June. As for a pre-release, time permitting I'll take a look at it but can't guarantee anything currently.",
"@cyberw I remember doing some profiling on Windows as well and finding out that it was particularly infamous there, because the certificates were being reloaded not one, but two or three times per request. I don't recall the specific reason since I ran most of the experiments on Linux afterwards, but I think it had to do with the CA store being a folder instead of a bundle file.\r\n\r\nIn any case, hopefully this mitigates the issue now that it's merged. If not, feel free to ping me and I'll try to follow up with something more specific for Windows.",
"On Windows (3.12.2) the example (modified to run against github.com) takes ~1.5s without the fix and ~0.2 with it (which is actually _faster_ than the verify=False version, at ~0.5s. Odd)",
"This patch has the side-effect, that it is no longer possible to pass in a custom ssl_context via the PoolManager.\r\nThis is a problem because now it does not seem possible anymore to enable/use a custom ssl_context to reduce the OpenSSL seclevel used by request. The following worked in 2.31.0 and stopped working now:\r\n\r\n```\r\nfrom urllib3.util import create_urllib3_context\r\nfrom urllib3 import PoolManager\r\nfrom requests.adapters import HTTPAdapter\r\nfrom requests import Session\r\n\r\nclass AddedCipherAdapter(HTTPAdapter):\r\n def init_poolmanager(self, *args, **kwargs):\r\n print(\"using poolmanager\")\r\n ctx = create_urllib3_context(ciphers=\"ALL:@SECLEVEL=0\")\r\n kwargs['ssl_context'] = ctx\r\n return super(AddedCipherAdapter, self).init_poolmanager(*args, **kwargs)\r\n\r\n# use our own post session with lowered seclevel adapter\r\ndef post(url, cert=None, data=None, verify=True, headers=None):\r\n with Session() as s:\r\n s.adapters.pop(\"https://\", None)\r\n s.mount(\"https://\", AddedCipherAdapter())\r\n return s.post(url, cert=cert, data=data,verify=verify, headers=headers)\r\n```\r\nThis worked in 2.31.0 and stopped working, because custom 'ssl_context' is overwritten by default 'ssl_context' with this merge request.\r\n\r\nI think it would be good to support a custom ssl_context again, since otherwise it does not seem to be possible to change the seclevel settings of python requests anymore and that is required if you are working with legacy code and old certificates that can't easily be renewed.\r\n",
"I am being to see the error `Segmentation fault` after upgrading the `requests` to `v2.32.0`. I tried version `v2.31.0`, `v2.32.0`, `v2.32.1`, `v2.32.2` and `v2.32.3`. and seeing same error with all versions after `v2.32.0`. but no problem with `v2.31.0`\r\nI am not sure if this problem is related to SSLContext thread safe, but my code is indeed running under `concurrent.futures`.\r\nAnd after adding `faulthandler.enable()` into my code, I saw the trace is below, looks like it is related to ssl context\r\n```\r\nFile \"/opt/vpnaas/lib64/python3.11/site-packages/urllib3/util/ssl_.py\", line 418 in ssl_wrap_socket\r\n File \"/opt/vpnaas/lib64/python3.11/site-packages/urllib3/connection.py\", line 419 in connect\r\n File \"/opt/vpnaas/lib64/python3.11/site-packages/urllib3/connectionpool.py\", line 1058 in _validate_conn\r\n File \"/opt/vpnaas/lib64/python3.11/site-packages/urllib3/connectionpool.py\", line 404 in _make_request\r\n File \"/opt/vpnaas/lib64/python3.11/site-packages/urllib3/connectionpool.py\", line 715 in urlopen\r\n File \"/opt/vpnaas/lib64/python3.11/site-packages/requests/adapters.py\", line 564 in send\r\n File \"/opt/vpnaas/lib64/python3.11/site-packages/requests/sessions.py\", line 703 in send\r\n File \"/opt/vpnaas/lib64/python3.11/site-packages/requests/sessions.py\", line 589 in request\r\n File \"/opt/vpnaas/lib64/python3.11/site-packages/requests/api.py\", line 59 in request\r\n File \"/opt/vpnaas/lib64/python3.11/site-packages/requests/api.py\", line 73 in get\r\n```",
"> I am not sure if this problem is related to SSLContext thread safe\r\n\r\nYou might want to try with a more recent Python version to see if that helps the problem. I vaguely recall there were some threading bugfixes regarding the ssl library in the CPython changelogs.\r\n\r\nAlso, my CPython PR regarding this is still open: https://github.com/python/cpython/pull/118597 .",
"thanks, @mm-matthias i am using python 3.11.7. will do more testing with other versions",
"Hi @mm-matthias I tried the latest cpython 3.12.4 and saw the same problem. So I written a python script below to simulate my code in production. and this script can reproduce this problem quickly with requests 2.32.3, and no such kind problem wiht requests 2.31.0. \r\n\r\n```python\r\nimport concurrent.futures\r\nimport random\r\nimport uuid\r\nfrom threading import Thread\r\nfrom time import time\r\n\r\nimport requests\r\n\r\n\r\ndef do_request():\r\n start = time()\r\n random_id = uuid.uuid4()\r\n delay = random.randint(1, 5)\r\n print(\"start {} delay {} seconds\".format(random_id, delay))\r\n endpoints = []\r\n endpoints.append('https://httpbin.org/delay/' + str(delay))\r\n delay = str(random.randint(1, 5)) + 's'\r\n endpoints.append('https://run.mocky.io/v3/0432e9f0-674f-45bd-9c18-628b861c2258?mocky-delay=' + str(delay))\r\n random.shuffle(endpoints)\r\n response = None\r\n for endpoint in endpoints:\r\n try:\r\n print(\"start {} delay {} seconds\".format(random_id, endpoint))\r\n if 'run' in endpoint:\r\n cert = './client.crt', './client.key'\r\n response = requests.get(endpoint, timeout=random.randint(1, 5), cert=cert)\r\n else:\r\n response = requests.get(endpoint, timeout=random.randint(1, 5))\r\n except Exception as e:\r\n print(e)\r\n end = time()\r\n print(\"finished {} in {} seconds\".format(random_id, end - start))\r\n return response\r\n\r\n\r\ndef measure():\r\n cnt = 20\r\n with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:\r\n futures = []\r\n for server in range(1, cnt):\r\n futures.append(executor.submit(do_request))\r\n for future in concurrent.futures.as_completed(futures):\r\n pass\r\n\r\n\r\nfor i in range(1, 500):\r\n threads = [Thread(target=measure, args=()) for _ in range(5)]\r\n\r\n for t in threads: t.start()\r\n for t in threads: t.join()\r\n\r\n```",
"@mingshuang I've run your script, but without the `client.crt/client.key` as I don't have any files for that. This did not cause any exceptions for me.\r\nBut if you feed different cert files for different files and somewhere the global ssl context is modified (which should not happen) this might maybe cause your errors?\r\nI am not very familiar with how the requests project works, but maybe you should open this as a separate issue (including your OS)? I saw that 2.32.0-2.32.3 suffered from quite a few problems related to the SSL context that were at least partially caused by this PR. So having this on the official radar is probably better than it being buried in this already merged PR discussion.\r\nAlso see https://github.com/psf/requests/issues/6726 .",
"hi @mm-matthias sorry forgot to attach the certificate. the certificate can be generated with command `openssl req -x509 -newkey rsa:4096 -keyout client.key -out client.crt -days 365 -nodes`. In my testing, I am using a certificate from letsencrypt. I tried openssl generated certificate and letsencrypt with the script above, both of them can reproduce the problem, but letsencrypt is easier, might saw the `Segmentation fault` in a few minutes, but openssl generated certificate needs around 10 minutes. Because my service is using letsencrypt certificate so i can not attach it here.\r\nAnd I just opened a new issue https://github.com/psf/requests/issues/6745 to track this problem"
] |
https://api.github.com/repos/psf/requests/issues/6666 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6666/labels{/name} | https://api.github.com/repos/psf/requests/issues/6666/comments | https://api.github.com/repos/psf/requests/issues/6666/events | https://github.com/psf/requests/issues/6666 | 2,191,720,271 | I_kwDOABTKOs6Cov9P | 6,666 | Consider making certifi an optional dependency | {
"avatar_url": "https://avatars.githubusercontent.com/u/4661021?v=4",
"events_url": "https://api.github.com/users/dolfinus/events{/privacy}",
"followers_url": "https://api.github.com/users/dolfinus/followers",
"following_url": "https://api.github.com/users/dolfinus/following{/other_user}",
"gists_url": "https://api.github.com/users/dolfinus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dolfinus",
"id": 4661021,
"login": "dolfinus",
"node_id": "MDQ6VXNlcjQ2NjEwMjE=",
"organizations_url": "https://api.github.com/users/dolfinus/orgs",
"received_events_url": "https://api.github.com/users/dolfinus/received_events",
"repos_url": "https://api.github.com/users/dolfinus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dolfinus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dolfinus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dolfinus",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2024-03-18T09:47:47Z | 2024-03-18T10:25:23Z | 2024-03-18T10:25:21Z | NONE | null | 1. In some cases users may need to access some site in a company private network, with SSL certificate signed by custom root certificate (not public). Accessing this site using browser is working fine if user added this root certificate to system cert store. But requests will complain that certificate cannot be verified, and user have to pass this root certificate to `session.verify = '/path/to/cert.pem"` or by passing the same path to `REQUESTS_CA_BUNDLE` env variable. IMHO, this is redundant step which introduces more headache than solves anything.
2. `certifi` has MPL 2.0 license which _may be_ considered as copyleft, and prohibited to use by legals. Not all of users know that MPL 2.0 license is file-based, and license actually cannot "spread" to packages which depend on it.
Is is possible to introduce `pip install requests[certifi]` for installing certifi explicitly, and remove if from default installation? | {
"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/6666/reactions"
} | https://api.github.com/repos/psf/requests/issues/6666/timeline | null | not_planned | null | null | false | [
"No"
] |
https://api.github.com/repos/psf/requests/issues/6665 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6665/labels{/name} | https://api.github.com/repos/psf/requests/issues/6665/comments | https://api.github.com/repos/psf/requests/issues/6665/events | https://github.com/psf/requests/issues/6665 | 2,191,684,574 | I_kwDOABTKOs6ConPe | 6,665 | Is feature freeze permanent? | {
"avatar_url": "https://avatars.githubusercontent.com/u/4661021?v=4",
"events_url": "https://api.github.com/users/dolfinus/events{/privacy}",
"followers_url": "https://api.github.com/users/dolfinus/followers",
"following_url": "https://api.github.com/users/dolfinus/following{/other_user}",
"gists_url": "https://api.github.com/users/dolfinus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dolfinus",
"id": 4661021,
"login": "dolfinus",
"node_id": "MDQ6VXNlcjQ2NjEwMjE=",
"organizations_url": "https://api.github.com/users/dolfinus/orgs",
"received_events_url": "https://api.github.com/users/dolfinus/received_events",
"repos_url": "https://api.github.com/users/dolfinus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dolfinus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dolfinus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dolfinus",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 2 | 2024-03-18T09:35:24Z | 2024-03-18T10:26:57Z | 2024-03-18T10:26:46Z | NONE | null | Hi.
For several years I see feature freeze on this project (although I haven't see any announce about it). Are there any plans start to accept new features? Can contributors help with anything?
Lack of new features leads to introducing new HTTP clients like [niquests](https://github.com/jawah/niquests) which do support HTTP/2, QUICK, DNS over HTTPS and so on. | {
"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/6665/reactions"
} | https://api.github.com/repos/psf/requests/issues/6665/timeline | null | not_planned | null | null | false | [
"Yes it is. There's an issue describing the feature freeze policy. ",
"Duplicate #969"
] |
https://api.github.com/repos/psf/requests/issues/6664 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6664/labels{/name} | https://api.github.com/repos/psf/requests/issues/6664/comments | https://api.github.com/repos/psf/requests/issues/6664/events | https://github.com/psf/requests/issues/6664 | 2,191,683,029 | I_kwDOABTKOs6Com3V | 6,664 | Is feature freeze permanent? | {
"avatar_url": "https://avatars.githubusercontent.com/u/4661021?v=4",
"events_url": "https://api.github.com/users/dolfinus/events{/privacy}",
"followers_url": "https://api.github.com/users/dolfinus/followers",
"following_url": "https://api.github.com/users/dolfinus/following{/other_user}",
"gists_url": "https://api.github.com/users/dolfinus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dolfinus",
"id": 4661021,
"login": "dolfinus",
"node_id": "MDQ6VXNlcjQ2NjEwMjE=",
"organizations_url": "https://api.github.com/users/dolfinus/orgs",
"received_events_url": "https://api.github.com/users/dolfinus/received_events",
"repos_url": "https://api.github.com/users/dolfinus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dolfinus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dolfinus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dolfinus",
"user_view_type": "public"
} | [
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156041422,
"name": "actions/autoclose-feat",
"node_id": "LA_kwDOABTKOs8AAAABbu28zg",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-feat"
}
] | closed | true | null | [] | null | 1 | 2024-03-18T09:34:39Z | 2024-03-18T09:34:49Z | 2024-03-18T09:34:48Z | NONE | off-topic | Hi.
For several years I see feature freeze on this project (although I haven't see any announce about it). Are there any plans start to accept new features? Can contributors help with anything?
Lack of new features leads to introducing new HTTP clients like [niquests](https://github.com/jawah/niquests) which do support HTTP/2, QUICK, DNS over HTTPS and so on. | {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6664/reactions"
} | https://api.github.com/repos/psf/requests/issues/6664/timeline | null | not_planned | null | null | false | [
"As described in the template, Requests is not accepting feature requests"
] |
https://api.github.com/repos/psf/requests/issues/6663 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6663/labels{/name} | https://api.github.com/repos/psf/requests/issues/6663/comments | https://api.github.com/repos/psf/requests/issues/6663/events | https://github.com/psf/requests/issues/6663 | 2,189,859,185 | I_kwDOABTKOs6Chplx | 6,663 | How to download multiple files in local system using POST API request in python rather than in ascii or binary form data ? | {
"avatar_url": "https://avatars.githubusercontent.com/u/46193115?v=4",
"events_url": "https://api.github.com/users/dhingrachirag/events{/privacy}",
"followers_url": "https://api.github.com/users/dhingrachirag/followers",
"following_url": "https://api.github.com/users/dhingrachirag/following{/other_user}",
"gists_url": "https://api.github.com/users/dhingrachirag/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dhingrachirag",
"id": 46193115,
"login": "dhingrachirag",
"node_id": "MDQ6VXNlcjQ2MTkzMTE1",
"organizations_url": "https://api.github.com/users/dhingrachirag/orgs",
"received_events_url": "https://api.github.com/users/dhingrachirag/received_events",
"repos_url": "https://api.github.com/users/dhingrachirag/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dhingrachirag/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dhingrachirag/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dhingrachirag",
"user_view_type": "public"
} | [
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156042717,
"name": "actions/autoclose-qa",
"node_id": "LA_kwDOABTKOs8AAAABbu3B3Q",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-qa"
}
] | closed | true | null | [] | null | 1 | 2024-03-16T08:28:26Z | 2024-03-16T08:28:37Z | 2024-03-16T08:28:36Z | NONE | off-topic | I struck in one scenario in which i need to download multiple files in local repository using POST API request in python 3.9.12.
I tried below code but not able to resolve the issue.
```
def download(url: str, dest_folder: str):
if not os.path.exists(dest_folder):
os.makedirs(dest_folder)
filename = url.split('/')[-1].replace(" ", "_")
file_path = os.path.join(dest_folder, filename)
payload = {'testcaseId': '305432601'}
r = requests.post(url, data=json.dumps(payload), stream=False)
if r.ok:
print("saving to", os.path.abspath(file_path))
with open(file_path, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024 * 8):
if chunk:
f.write(chunk)
f.flush()
os.fsync(f.fileno())
else: # HTTP status code 4XX/5XX
print("Download failed: status code {}\n{}".format(r.status_code, r.text))
download("https://api.demo.com/siteapi/resultfiles/", dest_folder="//PycharmProjects//Testing_Local//Logs")
```
When I used above code it gives me below error:
```
Download failed: status code 500
{"timestamp":"2024-03-14T11:45:42.109+00:00","status":500,"error":"Internal Server Error","path":"/siteapi/resultfiles/"}
```
**In postman we have that option to SEND and DOWNLOAD files and through that i am able to download multiple files in zip folder in my local system.**

My questions are :
1. How to download multiple files in local system or directory using python through POST API request rather than binary stream ?
2. How to achieve task through python code which postman UI is providing through SEND and DOWNLOAD option ?
Below scenario is expected :
1. Fire POST API request
2. DOWNLOAD Files through response of POST API
3. STORE files in local directory.
| {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6663/reactions"
} | https://api.github.com/repos/psf/requests/issues/6663/timeline | null | completed | null | null | false | [
"As described in the template, we won't be able to answer questions on this issue tracker. Please use [Stack Overflow](https://stackoverflow.com/)"
] |
https://api.github.com/repos/psf/requests/issues/6662 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6662/labels{/name} | https://api.github.com/repos/psf/requests/issues/6662/comments | https://api.github.com/repos/psf/requests/issues/6662/events | https://github.com/psf/requests/pull/6662 | 2,184,879,896 | PR_kwDOABTKOs5pjYvv | 6,662 | Add local TLS server | {
"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"
} | [] | closed | false | null | [] | null | 2 | 2024-03-13T21:02:03Z | 2024-03-14T11:27:47Z | 2024-03-14T11:25:25Z | CONTRIBUTOR | null | This also adds certificates for testing purposes and files to make it easy to generate/regenerate them.
This also replaces an existing test of how we utilize our pool manager such that we don't connect to badssl.com
Finally, this adds additional context parameters for our pool manager to account for mTLS certificates used by clients to authenticate to a server. | {
"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/6662/reactions"
} | https://api.github.com/repos/psf/requests/issues/6662/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6662.diff",
"html_url": "https://github.com/psf/requests/pull/6662",
"merged_at": "2024-03-14T11:25:25Z",
"patch_url": "https://github.com/psf/requests/pull/6662.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6662"
} | true | [
"Ack didn't mean to add that roadmap file. Was a brain dump for years back",
"\n> Edit: I guess we've got test failures coming from connection resets.\n\nYeah I think having a handshake failure causes the socket to be in an unhappy place but I don't feel like making this a perfect server. "
] |
https://api.github.com/repos/psf/requests/issues/6661 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6661/labels{/name} | https://api.github.com/repos/psf/requests/issues/6661/comments | https://api.github.com/repos/psf/requests/issues/6661/events | https://github.com/psf/requests/pull/6661 | 2,184,825,844 | PR_kwDOABTKOs5pjM8o | 6,661 | chore: change string concatenation way (auth.py) | {
"avatar_url": "https://avatars.githubusercontent.com/u/57540926?v=4",
"events_url": "https://api.github.com/users/mrKazzila/events{/privacy}",
"followers_url": "https://api.github.com/users/mrKazzila/followers",
"following_url": "https://api.github.com/users/mrKazzila/following{/other_user}",
"gists_url": "https://api.github.com/users/mrKazzila/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mrKazzila",
"id": 57540926,
"login": "mrKazzila",
"node_id": "MDQ6VXNlcjU3NTQwOTI2",
"organizations_url": "https://api.github.com/users/mrKazzila/orgs",
"received_events_url": "https://api.github.com/users/mrKazzila/received_events",
"repos_url": "https://api.github.com/users/mrKazzila/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mrKazzila/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mrKazzila/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mrKazzila",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 2 | 2024-03-13T20:24:17Z | 2024-03-15T07:08:46Z | 2024-03-14T12:26:12Z | NONE | null | Referring to [Pep8's recommendation](https://peps.python.org/pep-0008/#programming-recommendations), changed the way strings are concatenated (from `+=` to `''.join`) | {
"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/6661/reactions"
} | https://api.github.com/repos/psf/requests/issues/6661/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6661.diff",
"html_url": "https://github.com/psf/requests/pull/6661",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6661.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6661"
} | true | [
"We don't accept stylistic changes unless they are part of meaningful work. Furthermore, the recommendation against using string addition is only relevant in large enough numbers of concatenation and is likely irrelevant here. ",
"Anyway, Thanks for the feedback!"
] |
https://api.github.com/repos/psf/requests/issues/6660 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6660/labels{/name} | https://api.github.com/repos/psf/requests/issues/6660/comments | https://api.github.com/repos/psf/requests/issues/6660/events | https://github.com/psf/requests/issues/6660 | 2,184,378,393 | I_kwDOABTKOs6CMvgZ | 6,660 | REQUESTS_CA_BUNDLE and CURL_CA_BUNDLE environment variables get ignored when in a venv | {
"avatar_url": "https://avatars.githubusercontent.com/u/41985738?v=4",
"events_url": "https://api.github.com/users/FriederHannenheim/events{/privacy}",
"followers_url": "https://api.github.com/users/FriederHannenheim/followers",
"following_url": "https://api.github.com/users/FriederHannenheim/following{/other_user}",
"gists_url": "https://api.github.com/users/FriederHannenheim/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/FriederHannenheim",
"id": 41985738,
"login": "FriederHannenheim",
"node_id": "MDQ6VXNlcjQxOTg1NzM4",
"organizations_url": "https://api.github.com/users/FriederHannenheim/orgs",
"received_events_url": "https://api.github.com/users/FriederHannenheim/received_events",
"repos_url": "https://api.github.com/users/FriederHannenheim/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/FriederHannenheim/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/FriederHannenheim/subscriptions",
"type": "User",
"url": "https://api.github.com/users/FriederHannenheim",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 2 | 2024-03-13T16:03:02Z | 2024-03-13T18:51:46Z | 2024-03-13T18:51:46Z | NONE | null | <!-- Summary. -->
Requests supports the REQUESTS_CA_BUNDLE and CURL_CA_BUNDLE environment variables to override the certificate
## Expected Result
<!-- What you expected. -->
Here's what's happening outside of the venv
```
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt python3
Python 3.11.8 (main, Feb 08 2024, 08:03:16) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import certifi
>>> certifi.where()
'/etc/ssl/certs/ca-certificates.crt'
```
## Actual Result
<!-- What happened instead. -->
Inside the venv:
```
fried@linux:/tmp> python3 -m venv .venv
fried@linux:/tmp> source .venv/bin/activate
(.venv) fried@linux:/tmp> pip install requests
Collecting requests
Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting charset-normalizer<4,>=2 (from requests)
Downloading charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests)
Downloading idna-3.6-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests)
Downloading urllib3-2.2.1-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests)
Downloading certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB)
Downloading requests-2.31.0-py3-none-any.whl (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 3.4 MB/s eta 0:00:00
Downloading certifi-2024.2.2-py3-none-any.whl (163 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.8/163.8 kB 5.3 MB/s eta 0:00:00
Downloading charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (140 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.3/140.3 kB 10.9 MB/s eta 0:00:00
Downloading idna-3.6-py3-none-any.whl (61 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.6/61.6 kB 5.7 MB/s eta 0:00:00
Downloading urllib3-2.2.1-py3-none-any.whl (121 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.1/121.1 kB 10.1 MB/s eta 0:00:00
Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests
Successfully installed certifi-2024.2.2 charset-normalizer-3.3.2 idna-3.6 requests-2.31.0 urllib3-2.2.1
(.venv) fried@linux:/tmp> REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt python3
Python 3.11.8 (main, Feb 08 2024, 08:03:16) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import certifi
>>> certifi.where()
'/tmp/.venv/lib64/python3.11/site-packages/certifi/cacert.pem'
>>>
```
## Reproduction Steps
```bash
$ python3 -m venv .venv
$ source .venv/bin/activate
$ REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt python
>>> import certifi
>>> certifi.where()
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.6"
},
"implementation": {
"name": "CPython",
"version": "3.11.8"
},
"platform": {
"release": "6.7.7-1-default",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "30100040"
},
"urllib3": {
"version": "2.2.1"
},
"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/6660/reactions"
} | https://api.github.com/repos/psf/requests/issues/6660/timeline | null | completed | null | null | false | [
"A few things:\r\n\r\n1. Requests isn't in use in your examples; you're using `certifi`. \r\n2. My guess, is that outside of the venv you have `certifi` from your package manager, and every Linux distro replaces `certifi` with something else\r\n3. `certifi` (a separate project) does not support either environment variable, Requests does.\r\n4. Requests will continue to honor what you set, except in cases like #3829 \r\n5. Lastly, I think this is effectively a duplicate of #6565 ",
"Duplicate of #6565"
] |
https://api.github.com/repos/psf/requests/issues/6659 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6659/labels{/name} | https://api.github.com/repos/psf/requests/issues/6659/comments | https://api.github.com/repos/psf/requests/issues/6659/events | https://github.com/psf/requests/pull/6659 | 2,176,501,923 | PR_kwDOABTKOs5pG2lO | 6,659 | get_encoding_from_headers fails if charset name not specified #6646 | {
"avatar_url": "https://avatars.githubusercontent.com/u/66105100?v=4",
"events_url": "https://api.github.com/users/alain-khalil/events{/privacy}",
"followers_url": "https://api.github.com/users/alain-khalil/followers",
"following_url": "https://api.github.com/users/alain-khalil/following{/other_user}",
"gists_url": "https://api.github.com/users/alain-khalil/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alain-khalil",
"id": 66105100,
"login": "alain-khalil",
"node_id": "MDQ6VXNlcjY2MTA1MTAw",
"organizations_url": "https://api.github.com/users/alain-khalil/orgs",
"received_events_url": "https://api.github.com/users/alain-khalil/received_events",
"repos_url": "https://api.github.com/users/alain-khalil/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alain-khalil/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alain-khalil/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alain-khalil",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 0 | 2024-03-08T17:49:05Z | 2024-03-08T20:32:07Z | null | NONE | null | null | 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/6659/reactions"
} | https://api.github.com/repos/psf/requests/issues/6659/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6659.diff",
"html_url": "https://github.com/psf/requests/pull/6659",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6659.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6659"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6658 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6658/labels{/name} | https://api.github.com/repos/psf/requests/issues/6658/comments | https://api.github.com/repos/psf/requests/issues/6658/events | https://github.com/psf/requests/issues/6658 | 2,174,587,261 | I_kwDOABTKOs6BnZF9 | 6,658 | Post requests with unicode chars in string as data sends incomplete/trimmed data (in >=2.30 with urllib3 2.0) | {
"avatar_url": "https://avatars.githubusercontent.com/u/76437340?v=4",
"events_url": "https://api.github.com/users/viiand/events{/privacy}",
"followers_url": "https://api.github.com/users/viiand/followers",
"following_url": "https://api.github.com/users/viiand/following{/other_user}",
"gists_url": "https://api.github.com/users/viiand/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/viiand",
"id": 76437340,
"login": "viiand",
"node_id": "MDQ6VXNlcjc2NDM3MzQw",
"organizations_url": "https://api.github.com/users/viiand/orgs",
"received_events_url": "https://api.github.com/users/viiand/received_events",
"repos_url": "https://api.github.com/users/viiand/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/viiand/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/viiand/subscriptions",
"type": "User",
"url": "https://api.github.com/users/viiand",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-03-07T19:11:48Z | 2024-03-07T19:15:20Z | 2024-03-07T19:15:20Z | NONE | null | In the *requests*>=2.30.0 (with urllib3 2+), when you send a post request with `data=<a string containing unicode chars>`, the server receives incomplete/trimmed data. This is due to the fact `content-length` set by *requests* will not match the actually sent data. It is set to len(data), yet it sends data.encoded() - which is longer.
If *requests* uses urllib3 1.x versions this throws an exception, for example:
UnicodeEncodeError: 'latin-1' codec can't encode character '\u0159' in position 10: Body ('ř') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.
## Expected Result
Either:
a) send complete data (where content-length header == len(data.encode()), not len(data) )
b) raise an exception as urlllib3 1.x versions did, suggesting the str should be utf-8 encoded
c) raise an exception telling the user he is not supposed to pass strings to the `data` argument
## Actual Result
No error is reported on the client side, nor is the data sent correctly. Server reads incomplete data.
## Reproduction Steps
```python
import requests
d="Lidová tvořivost na sebe nenechala dlouho čekat."
requests.post('http://localhost:8083/echo', data=d)
```
Server receives `Lidová tvořivost na sebe nenechala dlouho ček` in the requests body, which is incomplete
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "2.0.12"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.6"
},
"implementation": {
"name": "CPython",
"version": "3.11.8"
},
"platform": {
"release": "22.6.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "300000d0"
},
"urllib3": {
"version": "2.2.1"
},
"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/6658/reactions"
} | https://api.github.com/repos/psf/requests/issues/6658/timeline | null | completed | null | null | false | [
"Hi @viiand, this is a duplicate of #6586 which is already fixed in #6589. Please check opened and closed issues before opening new ones. Thanks!"
] |
https://api.github.com/repos/psf/requests/issues/6657 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6657/labels{/name} | https://api.github.com/repos/psf/requests/issues/6657/comments | https://api.github.com/repos/psf/requests/issues/6657/events | https://github.com/psf/requests/issues/6657 | 2,171,460,588 | I_kwDOABTKOs6Bbdvs | 6,657 | Post Request Status and header error. | {
"avatar_url": "https://avatars.githubusercontent.com/u/88251142?v=4",
"events_url": "https://api.github.com/users/b4el7d/events{/privacy}",
"followers_url": "https://api.github.com/users/b4el7d/followers",
"following_url": "https://api.github.com/users/b4el7d/following{/other_user}",
"gists_url": "https://api.github.com/users/b4el7d/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/b4el7d",
"id": 88251142,
"login": "b4el7d",
"node_id": "MDQ6VXNlcjg4MjUxMTQy",
"organizations_url": "https://api.github.com/users/b4el7d/orgs",
"received_events_url": "https://api.github.com/users/b4el7d/received_events",
"repos_url": "https://api.github.com/users/b4el7d/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/b4el7d/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/b4el7d/subscriptions",
"type": "User",
"url": "https://api.github.com/users/b4el7d",
"user_view_type": "public"
} | [
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156042717,
"name": "actions/autoclose-qa",
"node_id": "LA_kwDOABTKOs8AAAABbu3B3Q",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-qa"
}
] | closed | true | null | [] | null | 1 | 2024-03-06T13:02:35Z | 2024-03-06T13:02:48Z | 2024-03-06T13:02:47Z | NONE | off-topic | I am currently involved in a project where it is necessary to send POST requests to a remote server. I have noticed unexpected behavior when trying to emulate a POST request that I receive from Mozilla Firefox.
Specifically, when I perform the POST request through Mozilla Firefox, I receive a response with HTTP/0.9 without headers and a reported status of 200. However, when I try to emulate the same POST request in Python 3 using the requests library, I do not receive any status code, and I encounter an error "raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine('<html><body>\n'))".
After a more in-depth analysis, I discovered that the server is responding with HTTP/0.9, which may be the cause of the problem. However, I am unable to obtain a valid status code using requests.
To temporarily resolve the issue, I modified the behavior of the _read_status(self) function in the requests library to convert the first line into a valid status code. I also simulated the presence of the line "line = b'\r\n'" in the header to avoid issues when reading the headers.
How can I correctly interpret the response from the server? My request header is as follows:
Here is the code:
`
import requests
uid = "3491282510"
url = f'https://10.97.80.44/goform/formPostData?LE=ethPortCfg&UID={uid}'
print(url)
headers = {
"User-Agent": "Mozilla/5.0",
"Accept": "application/xhtml+xml",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate, bz"
}
data = {
'fd0': '0/2',
'fd1': 'Port 2',
'fd2': '0/2',
'fd3': '1000X',
'fd4': 'Disabled',
'fd5': 'On',
'fd6': '1G',
'fd7': 'Full',
'fd8': 'Off',
'fd9': 'Off',
'fd10': 'On',
'fd11': 'Do nothing',
'fd12': 'N/A',
'fd13': '5',
'choice': 'Apply'
}
response = requests.post(url, headers=headers, data=data, verify=False)
print(response.status_code)
# Output the response content
print(response.text)
`
How i can solve this issue?
ty | {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6657/reactions"
} | https://api.github.com/repos/psf/requests/issues/6657/timeline | null | completed | null | null | false | [
"As described in the template, we won't be able to answer questions on this issue tracker. Please use [Stack Overflow](https://stackoverflow.com/)"
] |
https://api.github.com/repos/psf/requests/issues/6656 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6656/labels{/name} | https://api.github.com/repos/psf/requests/issues/6656/comments | https://api.github.com/repos/psf/requests/issues/6656/events | https://github.com/psf/requests/issues/6656 | 2,166,639,219 | I_kwDOABTKOs6BJEpz | 6,656 | The content for this response was already consumed | {
"avatar_url": "https://avatars.githubusercontent.com/u/85281923?v=4",
"events_url": "https://api.github.com/users/AInisha/events{/privacy}",
"followers_url": "https://api.github.com/users/AInisha/followers",
"following_url": "https://api.github.com/users/AInisha/following{/other_user}",
"gists_url": "https://api.github.com/users/AInisha/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AInisha",
"id": 85281923,
"login": "AInisha",
"node_id": "MDQ6VXNlcjg1MjgxOTIz",
"organizations_url": "https://api.github.com/users/AInisha/orgs",
"received_events_url": "https://api.github.com/users/AInisha/received_events",
"repos_url": "https://api.github.com/users/AInisha/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AInisha/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AInisha/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AInisha",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 4 | 2024-03-04T11:41:15Z | 2024-03-06T10:57:27Z | 2024-03-06T10:57:27Z | NONE | null | I am using response.iter_content(chunk_size=None)) to read stream data also kept stream = True, here i am trying to read set of jsons in a loop, but if something breaks due to network issue (which i observed it does removes some characters) and its not complete json i kept except condition to read from response.text for which I am getting an error -->The content for this response was already consumed
## Expected Result
it should read set of json as a stream data in a loop using response.iter_content(chunk_size=None)) and if it breaks or missing something than it should read complete data from response.text in except condition
## Actual Result
i get the error--> The content for this response was already consumed
I am using requests version is '2.31.0'
```python
import requests
```
## System Information
Cell In[15], line 56
53 if json_error==True:
54 print('--------')
---> 56 print(response.text)
57 print('--------')
58 print('\n')
File ~\AppData\Local\anaconda3\Lib\site-packages\requests\models.py:923, in Response.text(self)
920 content = None
921 encoding = self.encoding
--> 923 if not self.content:
924 return ""
926 # Fallback to auto-detected encoding.
File ~\AppData\Local\anaconda3\Lib\site-packages\requests\models.py:894, in Response.content(self)
891 if self._content is False:
892 # Read the contents.
893 if self._content_consumed:
--> 894 raise RuntimeError("The content for this response was already consumed")
896 if self.status_code == 0 or self.raw is None:
897 self._content = None
RuntimeError: The content for this response was already consumed
<!-- 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/6656/reactions"
} | https://api.github.com/repos/psf/requests/issues/6656/timeline | null | not_planned | null | null | false | [
"this is very urgent for me ",
"can library owner can respond?\r\n",
"Hello Alnisha,\r\nI am willing to work on your issue. could you please give me Reproduction Steps so that I understand your issue clearly ? \r\n Best Regards",
"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. There is no urgent unpaid support. Demanding someone help you urgently is not acceptable behavior"
] |
https://api.github.com/repos/psf/requests/issues/6655 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6655/labels{/name} | https://api.github.com/repos/psf/requests/issues/6655/comments | https://api.github.com/repos/psf/requests/issues/6655/events | https://github.com/psf/requests/pull/6655 | 2,165,348,141 | PR_kwDOABTKOs5ogr9A | 6,655 | Use TLS settings in selecting connection pool | {
"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"
} | [] | closed | false | null | [] | {
"closed_at": null,
"closed_issues": 13,
"created_at": "2023-08-13T17:04:53Z",
"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/33",
"id": 9786066,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/33/labels",
"node_id": "MI_kwDOABTKOs4AlVLS",
"number": 33,
"open_issues": 0,
"state": "open",
"title": "2.32.0",
"updated_at": "2024-05-20T14:17:03Z",
"url": "https://api.github.com/repos/psf/requests/milestones/33"
} | 0 | 2024-03-03T13:05:10Z | 2024-10-02T10:27:22Z | 2024-03-11T11:21:59Z | CONTRIBUTOR | null | Previously, if someone made a request with `verify=False` then made a request where they expected verification to be enabled to the same host, they would potentially reuse a connection where TLS had not been verified.
This fixes that 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/6655/reactions"
} | https://api.github.com/repos/psf/requests/issues/6655/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6655.diff",
"html_url": "https://github.com/psf/requests/pull/6655",
"merged_at": "2024-03-11T11:21:59Z",
"patch_url": "https://github.com/psf/requests/pull/6655.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6655"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6654 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6654/labels{/name} | https://api.github.com/repos/psf/requests/issues/6654/comments | https://api.github.com/repos/psf/requests/issues/6654/events | https://github.com/psf/requests/pull/6654 | 2,157,929,017 | PR_kwDOABTKOs5oHftr | 6,654 | Add content to raise for status method | {
"avatar_url": "https://avatars.githubusercontent.com/u/53330796?v=4",
"events_url": "https://api.github.com/users/Xiroo/events{/privacy}",
"followers_url": "https://api.github.com/users/Xiroo/followers",
"following_url": "https://api.github.com/users/Xiroo/following{/other_user}",
"gists_url": "https://api.github.com/users/Xiroo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Xiroo",
"id": 53330796,
"login": "Xiroo",
"node_id": "MDQ6VXNlcjUzMzMwNzk2",
"organizations_url": "https://api.github.com/users/Xiroo/orgs",
"received_events_url": "https://api.github.com/users/Xiroo/received_events",
"repos_url": "https://api.github.com/users/Xiroo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Xiroo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Xiroo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Xiroo",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 4 | 2024-02-28T01:59:36Z | 2024-04-04T03:33:00Z | 2024-02-28T02:36:21Z | NONE | null | added self.content to http_error_msg for helping debugging
Sometimes response content has information that helping debugging.
following is the code I tested.
## Test code
### 402
```
import requests
response = requests.get('https://httpbin.org/status/402')
print(f'status_cod: {response.status_code}')
print(f'content: {response.content}')
print(f'reason: {response.reason}')
response.raise_for_status()
```
### 406
```
import requests
response = requests.get('https://httpbin.org/status/406')
print(f'status_cod: {response.status_code}')
print(f'content: {response.content}')
print(f'reason: {response.reason}')
response.raise_for_status()
```
## Before
### 402
```
status_cod: 402
content: b'Fuck you, pay me!'
reason: PAYMENT REQUIRED
Traceback (most recent call last):
File "/private/tmp/playground.py", line 7, in <module>
response.raise_for_status()
File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 402 Client Error: PAYMENT REQUIRED for url: https://httpbin.org/status/402
```
### 406
```
status_cod: 406
content: b'{"message": "Client did not request a supported media type.", "accept": ["image/webp", "image/svg+xml", "image/jpeg", "image/png", "image/*"]}'
reason: NOT ACCEPTABLE
Traceback (most recent call last):
File "/private/tmp/playground.py", line 7, in <module>
response.raise_for_status()
File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 406 Client Error: NOT ACCEPTABLE for url: https://httpbin.org/status/406
```
## After
### 402
```
status_cod: 402
content: b'Fuck you, pay me!'
reason: PAYMENT REQUIRED
Traceback (most recent call last):
File "/private/tmp/playground.py", line 7, in <module>
response.raise_for_status()
File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 402 Client Error: PAYMENT REQUIRED for url: https://httpbin.org/status/402 content: b'Fuck you, pay me!'
```
### 406
```
status_cod: 406
content: b'{"message": "Client did not request a supported media type.", "accept": ["image/webp", "image/svg+xml", "image/jpeg", "image/png", "image/*"]}'
reason: NOT ACCEPTABLE
Traceback (most recent call last):
File "/private/tmp/playground.py", line 7, in <module>
response.raise_for_status()
File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 406 Client Error: NOT ACCEPTABLE for url: https://httpbin.org/status/406 content: b'{"message": "Client did not request a supported media type.", "accept": ["image/webp", "image/svg+xml", "image/jpeg", "image/png", "image/*"]}'
``` | {
"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/6654/reactions"
} | https://api.github.com/repos/psf/requests/issues/6654/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6654.diff",
"html_url": "https://github.com/psf/requests/pull/6654",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6654.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6654"
} | true | [
"Duplicate #2650",
"To add to what was said in that PR, `self.content` is always bytes so you'll end up with a bytes repr, further the data in the response can very easily be sensitive and it can be enormous. There is no way we will include this in the error",
"@sigmavirus24\r\nAgree with that point. \r\nThen how about printing truncated content. For example, if content length is larger than 100, just print self.content[:100].(If preprocess is needed, add the preprocessing logic like self.reason.)",
"Something sensitive can still be in the first 100 bytes so that's still introducing a vulnerability for anyone that logs the exception without proper scrubbing or sends it to a service like sentry, rollbar, etc which all have questionable track records and shouldn't be trusted with sensitive data.\n\nIt's too risky.\n\nNo. "
] |
https://api.github.com/repos/psf/requests/issues/6653 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6653/labels{/name} | https://api.github.com/repos/psf/requests/issues/6653/comments | https://api.github.com/repos/psf/requests/issues/6653/events | https://github.com/psf/requests/issues/6653 | 2,157,769,336 | I_kwDOABTKOs6AnPJ4 | 6,653 | Document which exceptions request() might raise | {
"avatar_url": "https://avatars.githubusercontent.com/u/3848371?v=4",
"events_url": "https://api.github.com/users/mjperrone/events{/privacy}",
"followers_url": "https://api.github.com/users/mjperrone/followers",
"following_url": "https://api.github.com/users/mjperrone/following{/other_user}",
"gists_url": "https://api.github.com/users/mjperrone/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mjperrone",
"id": 3848371,
"login": "mjperrone",
"node_id": "MDQ6VXNlcjM4NDgzNzE=",
"organizations_url": "https://api.github.com/users/mjperrone/orgs",
"received_events_url": "https://api.github.com/users/mjperrone/received_events",
"repos_url": "https://api.github.com/users/mjperrone/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mjperrone/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mjperrone/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mjperrone",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 3 | 2024-02-27T23:09:53Z | 2024-06-07T14:14:32Z | null | NONE | null | Ask to document which exceptions request() might raise
I notice that the .[json function documents that it might raise](https://requests.readthedocs.io/en/latest/api/#requests.Response.json) a `JSONDecodeError`. This is very helpful for writing comprehensive error handling code around requests. I'm asking for that to be done for [the main interface](https://requests.readthedocs.io/en/latest/api/#main-interface) as well.
While [a list of exceptions](https://requests.readthedocs.io/en/latest/api/#exceptions) is provided in the documentation, it is not clear which exceptions will be returned by which methods. For example I don't think `JSONDecodeError` can be raised by `.get`. I tried to read the requests code to get a sense of which might be thrown from it, but it is a little challenging to follow as a first time reader. | 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/6653/reactions"
} | https://api.github.com/repos/psf/requests/issues/6653/timeline | null | null | null | null | false | [
"As a newcomer to this project, I'm eager to contribute and address the mentioned issue. I'd like to inquire about the exceptions list mentioned in the documentation—is it exhaustive and does it encompass all possible exceptions? If so, I'm prepared to work on enhancing the documentation. My proposal is to not only update the main interface but also extend the coverage to other methods, aiming for consistency similar to what is currently done for the .json() function.",
"That would lead to a lot of code duplication in my opinion, apart from `requests.ReadTimeout` and `requests.JSONDecodeError` , all [request methods return an instance of the `Response` object](https://requests.readthedocs.io/en/latest/api/#exceptions), which can raise the [same exceptions](https://requests.readthedocs.io/en/latest/api/#exceptions).\r\n",
"I want to solve this issue @mjperrone , if this issue is still opened and kindly assign me this issue and provide me necessary required information"
] |
https://api.github.com/repos/psf/requests/issues/6652 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6652/labels{/name} | https://api.github.com/repos/psf/requests/issues/6652/comments | https://api.github.com/repos/psf/requests/issues/6652/events | https://github.com/psf/requests/pull/6652 | 2,156,763,387 | PR_kwDOABTKOs5oDeod | 6,652 | add content to http_error_msg | {
"avatar_url": "https://avatars.githubusercontent.com/u/53330796?v=4",
"events_url": "https://api.github.com/users/Xiroo/events{/privacy}",
"followers_url": "https://api.github.com/users/Xiroo/followers",
"following_url": "https://api.github.com/users/Xiroo/following{/other_user}",
"gists_url": "https://api.github.com/users/Xiroo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Xiroo",
"id": 53330796,
"login": "Xiroo",
"node_id": "MDQ6VXNlcjUzMzMwNzk2",
"organizations_url": "https://api.github.com/users/Xiroo/orgs",
"received_events_url": "https://api.github.com/users/Xiroo/received_events",
"repos_url": "https://api.github.com/users/Xiroo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Xiroo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Xiroo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Xiroo",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2024-02-27T14:37:51Z | 2024-02-27T19:52:56Z | 2024-02-27T14:38:56Z | NONE | null | added self.content to http_error_msg for helping debugging | {
"avatar_url": "https://avatars.githubusercontent.com/u/53330796?v=4",
"events_url": "https://api.github.com/users/Xiroo/events{/privacy}",
"followers_url": "https://api.github.com/users/Xiroo/followers",
"following_url": "https://api.github.com/users/Xiroo/following{/other_user}",
"gists_url": "https://api.github.com/users/Xiroo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Xiroo",
"id": 53330796,
"login": "Xiroo",
"node_id": "MDQ6VXNlcjUzMzMwNzk2",
"organizations_url": "https://api.github.com/users/Xiroo/orgs",
"received_events_url": "https://api.github.com/users/Xiroo/received_events",
"repos_url": "https://api.github.com/users/Xiroo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Xiroo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Xiroo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Xiroo",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6652/reactions"
} | https://api.github.com/repos/psf/requests/issues/6652/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6652.diff",
"html_url": "https://github.com/psf/requests/pull/6652",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6652.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6652"
} | true | [
"Accidentally created PR"
] |
https://api.github.com/repos/psf/requests/issues/6651 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6651/labels{/name} | https://api.github.com/repos/psf/requests/issues/6651/comments | https://api.github.com/repos/psf/requests/issues/6651/events | https://github.com/psf/requests/pull/6651 | 2,156,727,937 | PR_kwDOABTKOs5oDW1m | 6,651 | Add test coverage for api.py | {
"avatar_url": "https://avatars.githubusercontent.com/u/4992440?v=4",
"events_url": "https://api.github.com/users/jschfflr/events{/privacy}",
"followers_url": "https://api.github.com/users/jschfflr/followers",
"following_url": "https://api.github.com/users/jschfflr/following{/other_user}",
"gists_url": "https://api.github.com/users/jschfflr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jschfflr",
"id": 4992440,
"login": "jschfflr",
"node_id": "MDQ6VXNlcjQ5OTI0NDA=",
"organizations_url": "https://api.github.com/users/jschfflr/orgs",
"received_events_url": "https://api.github.com/users/jschfflr/received_events",
"repos_url": "https://api.github.com/users/jschfflr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jschfflr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jschfflr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jschfflr",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 0 | 2024-02-27T14:22:03Z | 2024-02-28T00:21:26Z | null | NONE | null | This change adds tests for the highlevel api that exposes the http methods directly. | 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/6651/reactions"
} | https://api.github.com/repos/psf/requests/issues/6651/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6651.diff",
"html_url": "https://github.com/psf/requests/pull/6651",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6651.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6651"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6650 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6650/labels{/name} | https://api.github.com/repos/psf/requests/issues/6650/comments | https://api.github.com/repos/psf/requests/issues/6650/events | https://github.com/psf/requests/issues/6650 | 2,152,563,452 | I_kwDOABTKOs6ATYL8 | 6,650 | Max retries exceeded with url | {
"avatar_url": "https://avatars.githubusercontent.com/u/11810162?v=4",
"events_url": "https://api.github.com/users/pmiguelr/events{/privacy}",
"followers_url": "https://api.github.com/users/pmiguelr/followers",
"following_url": "https://api.github.com/users/pmiguelr/following{/other_user}",
"gists_url": "https://api.github.com/users/pmiguelr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pmiguelr",
"id": 11810162,
"login": "pmiguelr",
"node_id": "MDQ6VXNlcjExODEwMTYy",
"organizations_url": "https://api.github.com/users/pmiguelr/orgs",
"received_events_url": "https://api.github.com/users/pmiguelr/received_events",
"repos_url": "https://api.github.com/users/pmiguelr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pmiguelr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pmiguelr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pmiguelr",
"user_view_type": "public"
} | [
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156042717,
"name": "actions/autoclose-qa",
"node_id": "LA_kwDOABTKOs8AAAABbu3B3Q",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-qa"
}
] | closed | true | null | [] | null | 1 | 2024-02-25T02:11:56Z | 2024-02-25T02:12:08Z | 2024-02-25T02:12:07Z | NONE | off-topic | Can explain me cause of this error and is possible avoid or solve it ?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/PIDrive/Recordurbate/recordurbate/bot.py", line 81, in is_online
r = requests.get(url)
File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 517, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='chaturbate.com', port=443): Max retries exceeded with url: /api/public/affiliates/onlinerooms/?wm=DkfRj&client_ip=request_ip&limit=500 (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1123)')))
| {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6650/reactions"
} | https://api.github.com/repos/psf/requests/issues/6650/timeline | null | completed | null | null | false | [
"As described in the template, we won't be able to answer questions on this issue tracker. Please use [Stack Overflow](https://stackoverflow.com/)"
] |
https://api.github.com/repos/psf/requests/issues/6649 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6649/labels{/name} | https://api.github.com/repos/psf/requests/issues/6649/comments | https://api.github.com/repos/psf/requests/issues/6649/events | https://github.com/psf/requests/pull/6649 | 2,152,354,747 | PR_kwDOABTKOs5n0ndl | 6,649 | Measure and report test coverage | {
"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"
} | [] | open | false | null | [] | null | 4 | 2024-02-24T15:08:47Z | 2024-03-14T19:57:28Z | null | CONTRIBUTOR | null | This runs pytest within coverage, enables pytest-xdist to improve test run times, and reports the coverage on GitHub Actions for us.
This also ensures that the parallel mode coverage files are ignored and adds things to pytest configuration to make tox command simpler | 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/6649/reactions"
} | https://api.github.com/repos/psf/requests/issues/6649/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6649.diff",
"html_url": "https://github.com/psf/requests/pull/6649",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6649.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6649"
} | true | [
"I haven't had a chance to dig into the failure yet, but it's showing 26% coverage which seems _extremely_ low. I tried to go back to find [older examples of when codecov](https://github.com/psf/requests/pull/3920#issuecomment-285275742) was running and am seeing closer to 89% coverage. Do we possibly have something misconfigured?",
"Running in tox I get north of 80% as well but we're not running in tox on GitHub actions so that may be part of the problem",
"It looks like we're possibly hitting an issue with `coverage combine` similar to what's noted in https://github.com/nedbat/coveragepy/issues/1036.\r\n\r\nWe're generating 21 files for the 21 tests across 7 interpreters. From Ned's response it sounds like those combinations have subtle variances that may result in false flags for missing coverage? When running the tests locally without `parallel=True` and generating a single file it shows 87% like I'd expect. If I use `parallel = True` and don't use `combine`, we get the same results we're seeing in CI as if we're missing coverage data.\r\n\r\nHave you used this workflow in other projects? If not, we might consider dividing coverage by interpreter or another partitioning strategy.",
"I mostly stole this from urllib3 and https://hynek.me/articles/ditch-codecov-python/ but maybe I missed something important "
] |
https://api.github.com/repos/psf/requests/issues/6648 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6648/labels{/name} | https://api.github.com/repos/psf/requests/issues/6648/comments | https://api.github.com/repos/psf/requests/issues/6648/events | https://github.com/psf/requests/issues/6648 | 2,152,191,991 | I_kwDOABTKOs6AR9f3 | 6,648 | POST with multiple files with the form-data sends only 1 file. | {
"avatar_url": "https://avatars.githubusercontent.com/u/4692686?v=4",
"events_url": "https://api.github.com/users/geekbeard/events{/privacy}",
"followers_url": "https://api.github.com/users/geekbeard/followers",
"following_url": "https://api.github.com/users/geekbeard/following{/other_user}",
"gists_url": "https://api.github.com/users/geekbeard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/geekbeard",
"id": 4692686,
"login": "geekbeard",
"node_id": "MDQ6VXNlcjQ2OTI2ODY=",
"organizations_url": "https://api.github.com/users/geekbeard/orgs",
"received_events_url": "https://api.github.com/users/geekbeard/received_events",
"repos_url": "https://api.github.com/users/geekbeard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/geekbeard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/geekbeard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/geekbeard",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 4 | 2024-02-24T08:02:15Z | 2024-04-05T22:58:46Z | 2024-04-05T22:58:46Z | NONE | null | <!-- Summary. -->
POSTing multiple files with a form-data. Using this doc: https://requests.readthedocs.io/en/latest/user/advanced/#post-multiple-multipart-encoded-files
However only 1 file is received by the endpoint.
But if you change the files array (deviates from the documentation):
from:
```python
files=[
('images',('image01.png',open('H:/image01.png','rb'),'image/png')),
('images',('image02.png',open('H:/image02.png','rb'),'image/png'))
]
```
to:
```python
files=[
('images01',('image01.png',open('H:/image01.png','rb'),'image/png')),
('images02',('image02.png',open('H:/image02.png','rb'),'image/png'))
]
```
everything works.
## Expected Result
Receiving endpoint gets an array with 2 items to iterate through them and save them as files.
<!-- What you expected. -->
## Actual Result
Receiving endpoint gets 1 item instead of 2 (or more if you are posting more).
<!-- What happened instead. -->
## Reproduction Steps
Test script. For the endpoint you can run something of your own or even use `https://webhook.site/`
```python
import requests
url = "https://endpoint.com/api/upload"
payload = {}
files=[
('images',('image01.png',open('H:/image01.png','rb'),'image/png')),
('images',('image02.png',open('H:/image02.png','rb'),'image/png'))
]
headers = {}
response = requests.post(url, files=files)
print(response.text)
```
Endpoint will get only 1 file. If you change files array to make `images` have separate value for each file = endpoint gets 2 files.
## 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.11"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.27.1"
},
"system_ssl": {
"version": "1010114f"
},
"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/6648/reactions"
} | https://api.github.com/repos/psf/requests/issues/6648/timeline | null | not_planned | null | null | false | [
"Hello @geekbeard,\r\n\r\nAs request.post takes files as list in that also, this list should be _[(key,value)] or [{key,value}]_ which is checked by function **src.requests.utils.to_key_val_list()** and which make sense that there should be unique key. But, if it is working same key in older versions then it is bug in new one and it should be fixed.\r\n\r\n> For library perspective, we can create unique field name like this images_image01 or update readme document.\r\n\r\nI had tried with get request with same key but different values but it takes only last key and value. That's a reason this key should be unique in form-data also.\r\n\r\n\r\n\r\n\r\n",
"@geekbeard I believe you're correct that this is a bug. I think somewhere things are being round tripped through a dictionary and that's why you're loosing a file here.\n\nAn interim fix is to use the MultipartEncoder from the toolbelt. It doesn't have this bug",
"I believe the bug is on the client side.\r\n\r\nThe request seems to be sent correctly (although https://webhook.site/ only shows one file being received).\r\nAfter creating my own endpoint using fastapi, I was able to see both files I uploaded.\r\n\r\n**Server:**\r\n```\r\nfrom fastapi import FastAPI, File, UploadFile\r\nfrom typing import List\r\n\r\napp = FastAPI()\r\n\r\[email protected](\"/upload\")\r\nasync def upload_files(images: List[UploadFile]):\r\n uploaded_files_info = []\r\n for file in images:\r\n content = await file.read()\r\n uploaded_files_info.append({\r\n \"filename\": file.filename,\r\n \"content_type\": file.content_type,\r\n \"content_length\": len(content)\r\n })\r\n return {\"uploaded_files\": uploaded_files_info}\r\n\r\nif __name__ == \"__main__\":\r\n import uvicorn\r\n uvicorn.run(app, host=\"0.0.0.0\", port=8080)\r\n\r\n```\r\n\r\n**Request:**\r\n```\r\nimport requests\r\nurl = \"http://0.0.0.0:8080/upload\"\r\n\r\nfiles=[\r\n ('images',('a.jpeg',open('/home/ash/Pictures/a.jpeg','rb'),'image/jpeg')),\r\n ('images',('b.jpeg',open('/home/ash/Pictures/b.jpeg','rb'),'image/jpeg'))\r\n]\r\n\r\nresponse = requests.post(url, files=files)\r\nresponse.text\r\n```\r\n**Response:**\r\n```\r\n'{\"uploaded_files\":[{\"filename\":\"a.jpeg\",\"content_type\":\"image/jpeg\",\"content_length\":8155},{\"filename\":\"b.jpeg\",\"content_type\":\"image/jpeg\",\"content_length\":7104}]}'\r\n```\r\n\r\n",
"> I believe the bug is on the client side.\n\nI believe you mean server side.\n\n> \n> The request seems to be sent correctly (although https://webhook.site/ only shows one file being received).\n> After creating my own endpoint using fastapi, I was able to see both files I uploaded.\n> \n> **Server:**\n> ```\n> from fastapi import FastAPI, File, UploadFile\n> from typing import List\n> \n> app = FastAPI()\n> \n> @app.post(\"/upload\")\n> async def upload_files(images: List[UploadFile]):\n> uploaded_files_info = []\n> for file in images:\n> content = await file.read()\n> uploaded_files_info.append({\n> \"filename\": file.filename,\n> \"content_type\": file.content_type,\n> \"content_length\": len(content)\n> })\n> return {\"uploaded_files\": uploaded_files_info}\n> \n> if __name__ == \"__main__\":\n> import uvicorn\n> uvicorn.run(app, host=\"0.0.0.0\", port=8080)\n> \n> ```\n> \n> **Request:**\n> ```\n> import requests\n> url = \"http://0.0.0.0:8080/upload\"\n> \n> files=[\n> ('images',('a.jpeg',open('/home/ash/Pictures/a.jpeg','rb'),'image/jpeg')),\n> ('images',('b.jpeg',open('/home/ash/Pictures/b.jpeg','rb'),'image/jpeg'))\n> ]\n> \n> response = requests.post(url, files=files)\n> response.text\n> ```\n> **Response:**\n> ```\n> '{\"uploaded_files\":[{\"filename\":\"a.jpeg\",\"content_type\":\"image/jpeg\",\"content_length\":8155},{\"filename\":\"b.jpeg\",\"content_type\":\"image/jpeg\",\"content_length\":7104}]}'\n> ```\n> \n> \n\nAs a result I'm going to close this\n"
] |
https://api.github.com/repos/psf/requests/issues/6647 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6647/labels{/name} | https://api.github.com/repos/psf/requests/issues/6647/comments | https://api.github.com/repos/psf/requests/issues/6647/events | https://github.com/psf/requests/issues/6647 | 2,150,619,043 | I_kwDOABTKOs6AL9ej | 6,647 | Wrong CA Certificates used in requests.Session.send | {
"avatar_url": "https://avatars.githubusercontent.com/u/25157310?v=4",
"events_url": "https://api.github.com/users/sunnstix/events{/privacy}",
"followers_url": "https://api.github.com/users/sunnstix/followers",
"following_url": "https://api.github.com/users/sunnstix/following{/other_user}",
"gists_url": "https://api.github.com/users/sunnstix/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sunnstix",
"id": 25157310,
"login": "sunnstix",
"node_id": "MDQ6VXNlcjI1MTU3MzEw",
"organizations_url": "https://api.github.com/users/sunnstix/orgs",
"received_events_url": "https://api.github.com/users/sunnstix/received_events",
"repos_url": "https://api.github.com/users/sunnstix/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sunnstix/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sunnstix/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sunnstix",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 1 | 2024-02-23T08:35:00Z | 2024-05-30T21:11:05Z | null | NONE | null | Bug in requests.sessions.py:
https://github.com/psf/requests/blob/b8be93a721792deeadd2f498b8f77cf610e7765f/src/requests/sessions.py#L579-L589
session.merge_environment_settings is called in session.request and not in session.send which means if users want to build their own prepared requests (see example below), the correct certificates file will not be used unless explicitly passed to send.
I believe these environment settings should be updated in session.send instead.
## Reproduction Steps
```python
import os
import requests
# Set CA certificates file to custom local file
os.environ["REQUESTS_CA_BUNDLE"] = "/etc/ssl/certs/ca-certificates.crt"
# Create request object
req = requests.Request(
method="GET", # any method
url="https://www.example_site.mydomain.com/path" # any url for which the default cert file does not have a cert for
)
with requests.Session() as s:
respA = s.request( # Success: will use CA certificates from REQUESTS_CA_BUNDLE
method=req.method,
url=req.url
)
assert respA.status_code == 200
with requests.Session() as s:
respB = s.send( # Success: will use CA certificates from REQUESTS_CA_BUNDLE if explicitly specified
request=req.prepare(), verify=os.environ["REQUESTS_CA_BUNDLE"]
)
assert respB.status_code == 200
with requests.Session() as s:
respC = s.send( # Error: Will try to use default CA certificates instead of those specified by REQUESTS_CA_BUNDLE
request=req.prepare()
)
assert respC.status_code == 200
```
## Expected Result
No output
## Actual Result
```
requests.exceptions.SSLError: HTTPSConnectionPool(host='https://www.example_site.mydomain.com/path', port=443): Max retries exceeded with url: /path (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.6"
},
"implementation": {
"name": "CPython",
"version": "3.10.4"
},
"platform": {
"release": "5.4.0-150-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "30000020"
},
"urllib3": {
"version": "2.2.1"
},
"using_charset_normalizer": true,
"using_pyopenssl": false
}
```
| null | {
"+1": 2,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/6647/reactions"
} | https://api.github.com/repos/psf/requests/issues/6647/timeline | null | null | null | null | false | [
"I can confirm I'm seeing this behavior when using prepared requests and `sessions.send()`, being forced to set `session.verify = os.environ['REQUESTS_CA_BUNDLE']` before `send()`."
] |
https://api.github.com/repos/psf/requests/issues/6646 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6646/labels{/name} | https://api.github.com/repos/psf/requests/issues/6646/comments | https://api.github.com/repos/psf/requests/issues/6646/events | https://github.com/psf/requests/issues/6646 | 2,150,140,274 | I_kwDOABTKOs6AKIly | 6,646 | `get_encoding_from_headers` fails if charset name not specified | {
"avatar_url": "https://avatars.githubusercontent.com/u/18488?v=4",
"events_url": "https://api.github.com/users/batterseapower/events{/privacy}",
"followers_url": "https://api.github.com/users/batterseapower/followers",
"following_url": "https://api.github.com/users/batterseapower/following{/other_user}",
"gists_url": "https://api.github.com/users/batterseapower/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/batterseapower",
"id": 18488,
"login": "batterseapower",
"node_id": "MDQ6VXNlcjE4NDg4",
"organizations_url": "https://api.github.com/users/batterseapower/orgs",
"received_events_url": "https://api.github.com/users/batterseapower/received_events",
"repos_url": "https://api.github.com/users/batterseapower/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/batterseapower/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/batterseapower/subscriptions",
"type": "User",
"url": "https://api.github.com/users/batterseapower",
"user_view_type": "public"
} | [] | open | false | null | [] | null | 2 | 2024-02-22T23:56:00Z | 2024-09-01T04:23:19Z | null | NONE | null | `requests.utils.get_encoding_from_headers` assumes that the charset parameter always specifies a name. In very rare cases a server can send a malformed content-type header which does not specify a name. In these cases, requests should probably just treat it as if no charset had been specified.
## Expected Result
`requests.utils.get_encoding_from_headers({'content-type': 'text/html; charset'}) == 'ISO-8859-1'`
## Actual Result
```
File ~/opt/anaconda3/2023.03/envs/mamba/envs/py3/lib/python3.9/site-packages/requests/utils.py:553, in get_encoding_from_headers(headers)
550 content_type, params = _parse_content_type_header(content_type)
552 if "charset" in params:
--> 553 return params["charset"].strip("'\"")
555 if "text" in content_type:
556 return "ISO-8859-1"
AttributeError: 'bool' object has no attribute 'strip'
```
## System Information
```json
{
"chardet": {
"version": "4.0.0"
},
"charset_normalizer": {
"version": "2.0.4"
},
"cryptography": {
"version": "41.0.3"
},
"idna": {
"version": "3.4"
},
"implementation": {
"name": "CPython",
"version": "3.9.15"
},
"platform": {
"release": "5.14.0-284.11.1.el9_2.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010116f",
"version": "23.2.0"
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "1010117f"
},
"urllib3": {
"version": "1.26.18"
},
"using_charset_normalizer": false,
"using_pyopenssl": 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/6646/reactions"
} | https://api.github.com/repos/psf/requests/issues/6646/timeline | null | null | null | null | false | [
"Hello @batterseapower \r\nI just pushed a PR to fix this issue. It is my first PR in this project. Let's wait for project mantainer to validate my fix.\r\n\r\nBest Regards",
"I wonder if `_parse_content_type_header` should be changed so that it ignores parameters with no equals after them. Or sets them to the empty string, or None. Setting parameter values to a `bool` is clearly wrong.\r\n[src/requests/utils.py#L533](https://github.com/psf/requests/blob/a3ce6f007597f14029e6b6f54676c34196aa050e/src/requests/utils.py#L533)\r\n\r\nI have checked RFC 2045, RFC 2616, RFC 7231, RFC 9110 and they all define a parameter as essentially `parameter = parameter-name \"=\" parameter-value`, so a parameter with no equals character is technically invalid (I think?).\r\n\r\nComparing what some other implementations do:\r\n[mimeparse](https://github.com/falconry/python-mimeparse) (their implementation is taken directly from deprecated/removed built-in [`cgi`](https://docs.python.org/3/library/cgi.html) module, so should match what built-in `cgi` module used to do):\r\n```python\r\n>>> from mimeparse import parse_mime_type\r\n>>> parse_mime_type(\"application/json; charset\")\r\n('application', 'json', {})\r\n```\r\nstdlib [`email.policy.EmailPolicy`](https://docs.python.org/3/library/email.policy.html) (tested using code from [this SO answer](https://stackoverflow.com/a/77225775)):\r\n```python\r\n>>> def parse_content_type(content_type):\r\n... from email.policy import EmailPolicy\r\n... header = EmailPolicy.header_factory('content-type', content_type)\r\n... return (header.content_type, dict(header.params))\r\n...\r\n>>> parse_content_type(\"application/json; charset\")\r\n('application/json', {'charset': ''})\r\n```\r\nstdlib [`email.message.Message`](https://docs.python.org/3/library/email.message.html) (tested using code from [this SO answer](https://stackoverflow.com/a/75727619)):\r\n```python\r\n>>> from email.message import Message\r\n>>>\r\n>>> _CONTENT_TYPE = \"content-type\"\r\n>>>\r\n>>> def parse_content_type(content_type: str) -> tuple[str, dict[str,str]]:\r\n... email = Message()\r\n... email[_CONTENT_TYPE] = content_type\r\n... params = email.get_params()\r\n... # The first param is the mime-type the later ones are the attributes like \"charset\"\r\n... return params[0][0], dict(params[1:])\r\n...\r\n>>> parse_content_type(\"application/json; charset\")\r\n('application/json', {'charset': ''})\r\n```\r\n\r\n(Also, checking those implementations, you can see that they are more correct about quoted strings -- matching quotes/unquoting -- but requests' simpler version of just splitting on \";\" and stripping any quote characters has been around for a long time and apparently not caused problems, so...)"
] |
https://api.github.com/repos/psf/requests/issues/6645 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6645/labels{/name} | https://api.github.com/repos/psf/requests/issues/6645/comments | https://api.github.com/repos/psf/requests/issues/6645/events | https://github.com/psf/requests/issues/6645 | 2,149,312,911 | I_kwDOABTKOs6AG-mP | 6,645 | ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) | {
"avatar_url": "https://avatars.githubusercontent.com/u/112388257?v=4",
"events_url": "https://api.github.com/users/rishav667/events{/privacy}",
"followers_url": "https://api.github.com/users/rishav667/followers",
"following_url": "https://api.github.com/users/rishav667/following{/other_user}",
"gists_url": "https://api.github.com/users/rishav667/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rishav667",
"id": 112388257,
"login": "rishav667",
"node_id": "U_kgDOBrLooQ",
"organizations_url": "https://api.github.com/users/rishav667/orgs",
"received_events_url": "https://api.github.com/users/rishav667/received_events",
"repos_url": "https://api.github.com/users/rishav667/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rishav667/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rishav667/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rishav667",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-02-22T15:19:13Z | 2024-02-22T15:49:34Z | 2024-02-22T15:49:33Z | NONE | null | can anyone help me with the below error
Error occurred ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
I am using requests==2.28.2 version and while logging into tableau server using rest api the error is coming.
As I am first creating the session and then doing the post request. | {
"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/6645/reactions"
} | https://api.github.com/repos/psf/requests/issues/6645/timeline | null | not_planned | 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/6644 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6644/labels{/name} | https://api.github.com/repos/psf/requests/issues/6644/comments | https://api.github.com/repos/psf/requests/issues/6644/events | https://github.com/psf/requests/pull/6644 | 2,147,980,383 | PR_kwDOABTKOs5nltTs | 6,644 | Trim excess leading path separators | {
"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"
} | [] | closed | 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"
} | [
{
"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"
},
{
"avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4",
"events_url": "https://api.github.com/users/sethmlarson/events{/privacy}",
"followers_url": "https://api.github.com/users/sethmlarson/followers",
"following_url": "https://api.github.com/users/sethmlarson/following{/other_user}",
"gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sethmlarson",
"id": 18519037,
"login": "sethmlarson",
"node_id": "MDQ6VXNlcjE4NTE5MDM3",
"organizations_url": "https://api.github.com/users/sethmlarson/orgs",
"received_events_url": "https://api.github.com/users/sethmlarson/received_events",
"repos_url": "https://api.github.com/users/sethmlarson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sethmlarson",
"user_view_type": "public"
}
] | {
"closed_at": null,
"closed_issues": 13,
"created_at": "2023-08-13T17:04:53Z",
"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/33",
"id": 9786066,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/33/labels",
"node_id": "MI_kwDOABTKOs4AlVLS",
"number": 33,
"open_issues": 0,
"state": "open",
"title": "2.32.0",
"updated_at": "2024-05-20T14:17:03Z",
"url": "https://api.github.com/repos/psf/requests/milestones/33"
} | 0 | 2024-02-22T01:11:15Z | 2024-02-23T00:49:49Z | 2024-02-23T00:49:42Z | CONTRIBUTOR | null | A URL with excess leading / (path-separator)s would cause urllib3 to attempt to reparse the request-uri as a full URI with a host and port. This bypasses that logic in ConnectionPool.urlopen by replacing these leading /s with just a single /.
Closes #6643 | {
"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/6644/reactions"
} | https://api.github.com/repos/psf/requests/issues/6644/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6644.diff",
"html_url": "https://github.com/psf/requests/pull/6644",
"merged_at": "2024-02-23T00:49:42Z",
"patch_url": "https://github.com/psf/requests/pull/6644.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6644"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6643 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6643/labels{/name} | https://api.github.com/repos/psf/requests/issues/6643/comments | https://api.github.com/repos/psf/requests/issues/6643/events | https://github.com/psf/requests/issues/6643 | 2,147,769,744 | I_kwDOABTKOs6ABF2Q | 6,643 | Leading slash in uri followed by column fails | {
"avatar_url": "https://avatars.githubusercontent.com/u/9471079?v=4",
"events_url": "https://api.github.com/users/pha6d/events{/privacy}",
"followers_url": "https://api.github.com/users/pha6d/followers",
"following_url": "https://api.github.com/users/pha6d/following{/other_user}",
"gists_url": "https://api.github.com/users/pha6d/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pha6d",
"id": 9471079,
"login": "pha6d",
"node_id": "MDQ6VXNlcjk0NzEwNzk=",
"organizations_url": "https://api.github.com/users/pha6d/orgs",
"received_events_url": "https://api.github.com/users/pha6d/received_events",
"repos_url": "https://api.github.com/users/pha6d/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pha6d/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pha6d/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pha6d",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 5 | 2024-02-21T21:47:35Z | 2024-02-23T00:49:43Z | 2024-02-23T00:49:43Z | NONE | null | Leading slash in uri followed by column fails.
## Expected Result
```python
requests.get('http://127.0.0.1:10000//v:h')
<Response [200]>
```
## Actual Result
```python
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/util/url.py", line 425, in parse_url
host, port = _HOST_PORT_RE.match(host_port).groups() # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'groups'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 711, in urlopen
parsed_url = parse_url(url)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/url.py", line 451, in parse_url
raise LocationParseError(source_url) from e
urllib3.exceptions.LocationParseError: Failed to parse: //v:h
```
## Reproduction Steps
```python
import requests
requests.get('http://127.0.0.1:10000//v:h')
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.6"
},
"implementation": {
"name": "CPython",
"version": "3.11.8"
},
"platform": {
"release": "5.10.209-198.812.amzn2.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "300000b0"
},
"urllib3": {
"version": "2.2.1"
},
"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/6643/reactions"
} | https://api.github.com/repos/psf/requests/issues/6643/timeline | null | completed | null | null | false | [
"I can reproduce this with\r\n\r\n```py\r\nimport urllib3\r\n\r\nurllib3.PoolManager().urlopen(method=\"GET\", url=\"http://127.0.0.1:10000//v:h\")\r\n```\r\n\r\ncc @sethmlarson @pquentin ",
"Ah I see the problem, both the PoolManager and requests are sending the path (`//v:h`) to `urlopen`: https://github.com/urllib3/urllib3/blob/d4ffa29ee1862b3d1afe584efb57d489a7659dac/src/urllib3/poolmanager.py#L444 https://github.com/psf/requests/blob/7a13c041dbef42f9f3feb14110f02626f6892e9a/src/requests/adapters.py#L487 and `urlopen` is now probably taking on too many responsibilities: https://github.com/urllib3/urllib3/blob/d4ffa29ee1862b3d1afe584efb57d489a7659dac/src/urllib3/connectionpool.py#L711-L712",
"Also, yes, I verified that RFC3986 allows `:` as a non-percent-encoded character in the path: https://datatracker.ietf.org/doc/html/rfc3986.html#section-3.3",
"And I think the problem is the `//` in the path which is tripping up the parsing as `//` is the delimiter for what should be host and port after that. So in reality nothing is wrong here. I wonder if we need some kind of pre-parsing of the URL before sending it to `urlopen` to trim this down. Something like `re.sub('^/+', '/')` would likely fix this in both Requests and urllib3.",
"Also reported this up to urllib3 https://github.com/urllib3/urllib3/issues/3352"
] |
https://api.github.com/repos/psf/requests/issues/6642 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6642/labels{/name} | https://api.github.com/repos/psf/requests/issues/6642/comments | https://api.github.com/repos/psf/requests/issues/6642/events | https://github.com/psf/requests/pull/6642 | 2,145,460,422 | PR_kwDOABTKOs5ndBIR | 6,642 | Drop support for CPython 3.7 | {
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
} | [] | closed | false | null | [] | {
"closed_at": null,
"closed_issues": 13,
"created_at": "2023-08-13T17:04:53Z",
"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/33",
"id": 9786066,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/33/labels",
"node_id": "MI_kwDOABTKOs4AlVLS",
"number": 33,
"open_issues": 0,
"state": "open",
"title": "2.32.0",
"updated_at": "2024-05-20T14:17:03Z",
"url": "https://api.github.com/repos/psf/requests/milestones/33"
} | 0 | 2024-02-20T23:26:18Z | 2024-05-15T20:21:04Z | 2024-02-20T23:44:43Z | MEMBER | null | Now that pip has dropped support for Python 3.7 in https://github.com/pypa/pip/pull/11944, we should be set to follow. This PR will remove support for Python 3.7 from requests starting in the next minor release 2.32.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"
} | {
"+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/6642/reactions"
} | https://api.github.com/repos/psf/requests/issues/6642/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6642.diff",
"html_url": "https://github.com/psf/requests/pull/6642",
"merged_at": "2024-02-20T23:44:43Z",
"patch_url": "https://github.com/psf/requests/pull/6642.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6642"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6641 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6641/labels{/name} | https://api.github.com/repos/psf/requests/issues/6641/comments | https://api.github.com/repos/psf/requests/issues/6641/events | https://github.com/psf/requests/pull/6641 | 2,145,428,672 | PR_kwDOABTKOs5nc6M4 | 6,641 | Fix 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 | false | null | [] | null | 2 | 2024-02-20T22:54:06Z | 2024-02-20T23:34:27Z | 2024-02-20T23:32:57Z | MEMBER | null | This PR will bring in a few changes to fix our CI suite. The release of `httpbin` 0.10.2 unblocks our test suite with Flask 3.0 which should fix the breakages in the last several months. In that window, our PyPy 3.8 build has broken on Windows due to https://github.com/pyca/cryptography/issues/10371. PyPy has dropped upstream support for both 3.7 and 3.8, so it seems more straight forward to follow them than try to patch around the cryptography issue.
We'll plan to deprecate both EoS PyPy runtimes with the next Requests release alongside CPython 3.7. | {
"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/6641/reactions"
} | https://api.github.com/repos/psf/requests/issues/6641/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6641.diff",
"html_url": "https://github.com/psf/requests/pull/6641",
"merged_at": "2024-02-20T23:32:57Z",
"patch_url": "https://github.com/psf/requests/pull/6641.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6641"
} | true | [
"Updated Sphinx to the latest release as well due to us no longer meeting the minimum required version for readthedocs to do our preview build. I'll spot check the docs once that finishes, they appear to render normally with a local build.",
"Docs appear to be in good shape: https://requests--6641.org.readthedocs.build/en/6641/"
] |
https://api.github.com/repos/psf/requests/issues/6640 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6640/labels{/name} | https://api.github.com/repos/psf/requests/issues/6640/comments | https://api.github.com/repos/psf/requests/issues/6640/events | https://github.com/psf/requests/pull/6640 | 2,145,171,444 | PR_kwDOABTKOs5ncBxB | 6,640 | Cleanup defunct links from community docs page | {
"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 | false | null | [] | null | 0 | 2024-02-20T20:03:41Z | 2024-02-20T20:04:39Z | 2024-02-20T20:04:33Z | MEMBER | null | Remove old links to early requests reference material that no longer function. | {
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6640/reactions"
} | https://api.github.com/repos/psf/requests/issues/6640/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6640.diff",
"html_url": "https://github.com/psf/requests/pull/6640",
"merged_at": "2024-02-20T20:04:33Z",
"patch_url": "https://github.com/psf/requests/pull/6640.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6640"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6639 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6639/labels{/name} | https://api.github.com/repos/psf/requests/issues/6639/comments | https://api.github.com/repos/psf/requests/issues/6639/events | https://github.com/psf/requests/issues/6639 | 2,135,327,971 | I_kwDOABTKOs5_RoTj | 6,639 | 2.31.0: pytest fails in `tests/test_requests.py::TestRequests::test_https_warnings` 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 | false | null | [] | null | 3 | 2024-02-14T22:45:59Z | 2024-02-14T23:25:34Z | 2024-02-14T23:22:05Z | NONE | null | I'm packaging 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`
- because I'm calling `build` with `--no-isolation` I'm using during all processes only locally installed modules
- install .whl file in </install/prefix> using 'installer` module
- run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
- build is performed in env which is *`cut off from access to the public network`* (pytest is executed with `-m "not network"`)
<details>
<summary>Here is pytest output:</summary>
```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.31.0-4.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.31.0-4.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' tests
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-8.0.0, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/requests-2.31.0
configfile: pyproject.toml
plugins: httpbin-2.0.0, mock-3.12.0
collected 596 items
tests/test_help.py ... [ 0%]
tests/test_hooks.py ... [ 1%]
tests/test_lowlevel.py .................... [ 4%]
tests/test_packages.py ... [ 4%]
tests/test_requests.py ................................................. [ 13%]
......................................................................Fpytest-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
. [ 25%]
........................................................................ [ 37%]
.....................................x.................................. [ 49%]
........................................................ [ 58%]
tests/test_structures.py .................... [ 62%]
tests/test_testserver.py ......s.... [ 63%]
tests/test_utils.py ..s................................................. [ 72%]
........................................................................ [ 84%]
........................................................................ [ 96%]
...sssssssssss..... [100%]
=================================== FAILURES ===================================
_______________________ TestRequests.test_https_warnings _______________________
self = <tests.test_requests.TestRequests object at 0x7f08b103a700>
nosan_server = ('localhost', 36135, '/tmp/pytest-of-tkloczko/pytest-145/certs0/ca.pem')
@pytest.mark.skipif(
SNIMissingWarning is None,
reason="urllib3 2.0 removed that warning and errors out instead",
)
def test_https_warnings(self, nosan_server):
"""warnings are emitted with requests.get"""
host, port, ca_bundle = nosan_server
if HAS_MODERN_SSL or HAS_PYOPENSSL:
warnings_expected = ("SubjectAltNameWarning",)
else:
warnings_expected = (
"SNIMissingWarning",
"InsecurePlatformWarning",
"SubjectAltNameWarning",
)
> with pytest.warns(None) as warning_records:
tests/test_requests.py:1014:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = WarningsChecker(record=True), expected_warning = None, match_expr = None
def __init__(
self,
expected_warning: Optional[
Union[Type[Warning], Tuple[Type[Warning], ...]]
] = Warning,
match_expr: Optional[Union[str, Pattern[str]]] = None,
*,
_ispytest: bool = False,
) -> None:
check_ispytest(_ispytest)
super().__init__(_ispytest=True)
msg = "exceptions must be derived from Warning, not %s"
if expected_warning is None:
> warnings.warn(WARNS_NONE_ARG, stacklevel=4)
E pytest.PytestRemovedIn8Warning: Passing None has been deprecated.
E See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.
/usr/lib/python3.8/site-packages/_pytest/recwarn.py:279: PytestRemovedIn8Warning
================================== XFAILURES ===================================
_______________ TestRequests.test_response_iter_lines_reentrant ________________
self = <tests.test_requests.TestRequests object at 0x7f08b0616460>
httpbin = <function prepare_url.<locals>.inner at 0x7f08b08c8ee0>
@pytest.mark.xfail
def test_response_iter_lines_reentrant(self, httpbin):
"""Response.iter_lines() is not reentrant safe"""
r = requests.get(httpbin("stream/4"), stream=True)
assert r.status_code == 200
next(r.iter_lines())
> assert len(list(r.iter_lines())) == 3
E assert 2 == 3
E + where 2 = len([b'"http://127.0.0.1:43743/stream/4", "args": {}, "headers": {"Host": "127.0.0.1:43743", "User-Agent": "python-request..."Accept-Encoding": "gzip, deflate, br", "Accept": "*/*", "Connection": "keep-alive"}, "origin": "127.0.0.1", "id": 3}'])
E + where [b'"http://127.0.0.1:43743/stream/4", "args": {}, "headers": {"Host": "127.0.0.1:43743", "User-Agent": "python-request..."Accept-Encoding": "gzip, deflate, br", "Accept": "*/*", "Connection": "keep-alive"}, "origin": "127.0.0.1", "id": 3}'] = list(<generator object Response.iter_lines at 0x7f08b08de190>)
E + where <generator object Response.iter_lines at 0x7f08b08de190> = <bound method Response.iter_lines of <Response [200]>>()
E + where <bound method Response.iter_lines of <Response [200]>> = <Response [200]>.iter_lines
tests/test_requests.py:2106: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [14/Feb/2024 21:46:02] "GET /stream/4 HTTP/1.1" 200 1008
=============================== warnings summary ===============================
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
/home/tkloczko/rpmbuild/BUILD/requests-2.31.0/requests/auth.py:36: DeprecationWarning: Non-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (42) to a string or bytes object in the near future to avoid problems.
warnings.warn(
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
tests/test_requests.py::TestRequests::test_set_basicauth[42-42]
/home/tkloczko/rpmbuild/BUILD/requests-2.31.0/requests/auth.py:46: DeprecationWarning: Non-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (<class 'int'>) to a string or bytes object in the near future to avoid problems.
warnings.warn(
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
/home/tkloczko/rpmbuild/BUILD/requests-2.31.0/requests/auth.py:36: DeprecationWarning: Non-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (None) to a string or bytes object in the near future to avoid problems.
warnings.warn(
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
tests/test_requests.py::TestRequests::test_set_basicauth[None-None]
/home/tkloczko/rpmbuild/BUILD/requests-2.31.0/requests/auth.py:46: DeprecationWarning: Non-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (<class 'NoneType'>) to a string or bytes object in the near future to avoid problems.
warnings.warn(
tests/test_utils.py::TestContentEncodingDetection::test_none
tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta charset="UTF-8">]
tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta http-equiv="Content-type" content="text/html;charset=UTF-8">]
tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />]
tests/test_utils.py::TestContentEncodingDetection::test_pragmas[<?xml version="1.0" encoding="UTF-8"?>]
tests/test_utils.py::TestContentEncodingDetection::test_precedence
/home/tkloczko/rpmbuild/BUILD/requests-2.31.0/requests/utils.py:493: DeprecationWarning: In requests 3.0, get_encodings_from_content will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
SKIPPED [1] tests/test_testserver.py:94: this fails non-deterministically under pytest-xdist
SKIPPED [1] tests/test_utils.py:49: condition: cStringIO is None
SKIPPED [10] tests/test_utils.py:814: Test only on Windows
SKIPPED [1] tests/test_utils.py:867: Test only on Windows
XFAIL tests/test_requests.py::TestRequests::test_response_iter_lines_reentrant
FAILED tests/test_requests.py::TestRequests::test_https_warnings - pytest.Pyt...
= 1 failed, 581 passed, 13 skipped, 1 xfailed, 14 warnings in 78.45s (0:01:18) =
127.0.0.1 - - [14/Feb/2024 21:45:55] "GET /get HTTP/1.1" 200 210
127.0.0.1 - - [14/Feb/2024 21:45:55] "GET /relative-redirect/20 HTTP/1.1" 302 0
127.0.0.1 - - [14/Feb/2024 21:45:56] "GET /get HTTP/1.1" 200 272
127.0.0.1 - - [14/Feb/2024 21:45:56] "GET /cookies HTTP/1.1" 200 40
127.0.0.1 - - [14/Feb/2024 21:45:56] "HEAD /get HTTP/1.1" 200 0
127.0.0.1 - - [14/Feb/2024 21:46:00] "GET /get HTTP/1.1" 200 313
127.0.0.1 - - [14/Feb/2024 21:46:00] "POST /post HTTP/1.1" 200 475
127.0.0.1 - - [14/Feb/2024 21:46:01] "GET /get?f%C3%B8%C3%B8=f%C3%B8%C3%B8 HTTP/1.1" 200 340
127.0.0.1 - - [14/Feb/2024 21:46:01] "GET /get?f%C3%B8%C3%B8=f%C3%B8%C3%B8 HTTP/1.1" 200 340
127.0.0.1 - - [14/Feb/2024 21:46:01] "GET /get?foo=foo HTTP/1.1" 200 300
127.0.0.1 - - [14/Feb/2024 21:46:01] "PUT /put HTTP/1.1" 200 447
127.0.0.1 - - [14/Feb/2024 21:46:02] "GET /get HTTP/1.1" 200 272
127.0.0.1 - - [14/Feb/2024 21:46:32] "GET /redirect-to?url=http%3A%2F%2Flocalhost%3A-1 HTTP/1.1" 302 0
```
</details>
<details>
<summary>List of installed modules in build env:</summary>
```console
Package Version
----------------------------- --------
alabaster 0.7.16
attrs 23.2.0
Babel 2.14.0
blinker 1.6.2
Brotli 1.1.0
build 1.0.3
cffi 1.16.0
chardet 5.2.0
charset-normalizer 3.3.2
click 8.1.7
cppclean 0.13
cryptography 42.0.2
decorator 5.1.1
distro 1.9.0
dnf 4.19.0
docutils 0.20.1
exceptiongroup 1.1.3
flasgger 0.9.7.1
Flask 3.0.2
gpg 1.23.2
greenlet 3.0.3
httpbin 0.10.1
idna 3.6
imagesize 1.4.1
importlib_metadata 7.0.1
importlib_resources 6.1.1
iniconfig 2.0.0
installer 0.7.0
itsdangerous 2.1.2
Jinja2 3.1.3
jsonschema 4.19.1
jsonschema-specifications 2023.7.1
libdnf 0.73.0
MarkupSafe 2.1.3
mistune 2.0.5
packaging 23.2
pkgutil_resolve_name 1.3.10
pluggy 1.3.0
ply 3.11
pycparser 2.21
Pygments 2.17.2
pyproject_hooks 1.0.0
PySocks 1.7.1
pytest 8.0.0
pytest-httpbin 2.0.0
pytest-mock 3.12.0
python-dateutil 2.8.2
pytz 2024.1
PyYAML 6.0.1
referencing 0.30.2
requests 2.31.0
rpds-py 0.18.0
setuptools 69.1.0
six 1.16.0
snowballstemmer 2.2.0
Sphinx 7.1.2
sphinxcontrib-applehelp 1.0.4
sphinxcontrib-devhelp 1.0.5
sphinxcontrib-htmlhelp 2.0.5
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.7
sphinxcontrib-serializinghtml 1.1.10
tomli 2.0.1
trustme 1.1.0
urllib3 1.26.18
Werkzeug 3.0.1
wheel 0.42.0
zipp 3.17.0
```
</details>
Please let me know if you need more details or want me to perform some diagnostics.
| {
"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/6639/reactions"
} | https://api.github.com/repos/psf/requests/issues/6639/timeline | null | completed | null | null | false | [
"I've tested as well 2.31.0 + current master (a5a0e4b5) and it fails as well\r\n<details>\r\n\r\n```console\r\n+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.31.0-4.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.31.0-4.fc35.x86_64/usr/lib/python3.8/site-packages\r\n+ /usr/bin/pytest -ra -m 'not network' tests\r\n============================= test session starts ==============================\r\nplatform linux -- Python 3.8.18, pytest-8.0.0, pluggy-1.3.0\r\nrootdir: /home/tkloczko/rpmbuild/BUILD/requests-2.31.0\r\nconfigfile: pyproject.toml\r\nplugins: httpbin-2.0.0, mock-3.12.0\r\ncollected 597 items\r\n\r\ntests/test_help.py ... [ 0%]\r\ntests/test_hooks.py ... [ 1%]\r\ntests/test_lowlevel.py .................... [ 4%]\r\ntests/test_packages.py ... [ 4%]\r\ntests/test_requests.py ................................................. [ 13%]\r\n......................................................................Fpytest-httpbin server hit an exception serving request: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1131)\r\nattempting to ignore so the rest of the tests can run\r\n. [ 25%]\r\n........................................................................ [ 37%]\r\n.....................................x.................................. [ 49%]\r\n......................................................... [ 58%]\r\ntests/test_structures.py .................... [ 62%]\r\ntests/test_testserver.py ......s.... [ 63%]\r\ntests/test_utils.py ..s................................................. [ 72%]\r\n...........................F............................................ [ 84%]\r\n........................................................................ [ 96%]\r\n...sssssssssss..... [100%]\r\n\r\n=================================== FAILURES ===================================\r\n_______________________ TestRequests.test_https_warnings _______________________\r\n\r\nself = <tests.test_requests.TestRequests object at 0x7fe947698190>\r\nnosan_server = ('localhost', 37739, '/tmp/pytest-of-tkloczko/pytest-152/certs0/ca.pem')\r\n\r\n @pytest.mark.skipif(\r\n SNIMissingWarning is None,\r\n reason=\"urllib3 2.0 removed that warning and errors out instead\",\r\n )\r\n def test_https_warnings(self, nosan_server):\r\n \"\"\"warnings are emitted with requests.get\"\"\"\r\n host, port, ca_bundle = nosan_server\r\n if HAS_MODERN_SSL or HAS_PYOPENSSL:\r\n warnings_expected = (\"SubjectAltNameWarning\",)\r\n else:\r\n warnings_expected = (\r\n \"SNIMissingWarning\",\r\n \"InsecurePlatformWarning\",\r\n \"SubjectAltNameWarning\",\r\n )\r\n\r\n> with pytest.warns(None) as warning_records:\r\n\r\ntests/test_requests.py:1004:\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n\r\nself = WarningsChecker(record=True), expected_warning = None, match_expr = None\r\n\r\n def __init__(\r\n self,\r\n expected_warning: Optional[\r\n Union[Type[Warning], Tuple[Type[Warning], ...]]\r\n ] = Warning,\r\n match_expr: Optional[Union[str, Pattern[str]]] = None,\r\n *,\r\n _ispytest: bool = False,\r\n ) -> None:\r\n check_ispytest(_ispytest)\r\n super().__init__(_ispytest=True)\r\n\r\n msg = \"exceptions must be derived from Warning, not %s\"\r\n if expected_warning is None:\r\n> warnings.warn(WARNS_NONE_ARG, stacklevel=4)\r\nE pytest.PytestRemovedIn8Warning: Passing None has been deprecated.\r\nE See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.\r\n\r\n/usr/lib/python3.8/site-packages/_pytest/recwarn.py:279: PytestRemovedIn8Warning\r\n______________ TestExtractZippedPaths.test_zipped_paths_extracted ______________\r\n\r\nself = <tests.test_utils.TestExtractZippedPaths object at 0x7fe947ef9940>\r\ntmpdir = local('/tmp/pytest-of-tkloczko/pytest-152/test_zipped_paths_extracted0')\r\n\r\n def test_zipped_paths_extracted(self, tmpdir):\r\n zipped_py = tmpdir.join(\"test.zip\")\r\n with zipfile.ZipFile(zipped_py.strpath, \"w\") as f:\r\n f.write(__file__)\r\n\r\n _, name = os.path.splitdrive(__file__)\r\n zipped_path = os.path.join(zipped_py.strpath, name.lstrip(r\"\\/\"))\r\n extracted_path = extract_zipped_paths(zipped_path)\r\n\r\n assert extracted_path != zipped_path\r\n assert os.path.exists(extracted_path)\r\n> assert filecmp.cmp(extracted_path, __file__)\r\nE AssertionError: assert False\r\nE + where False = <function cmp at 0x7fe947738940>('/tmp/test_utils.py', '/home/tkloczko/rpmbuild/BUILD/requests-2.31.0/tests/test_utils.py')\r\nE + where <function cmp at 0x7fe947738940> = filecmp.cmp\r\n\r\ntests/test_utils.py:337: AssertionError\r\n================================== XFAILURES ===================================\r\n_______________ TestRequests.test_response_iter_lines_reentrant ________________\r\n\r\nself = <tests.test_requests.TestRequests object at 0x7fe947797880>\r\nhttpbin = <function prepare_url.<locals>.inner at 0x7fe9478564c0>\r\n\r\n @pytest.mark.xfail\r\n def test_response_iter_lines_reentrant(self, httpbin):\r\n \"\"\"Response.iter_lines() is not reentrant safe\"\"\"\r\n r = requests.get(httpbin(\"stream/4\"), stream=True)\r\n assert r.status_code == 200\r\n\r\n next(r.iter_lines())\r\n> assert len(list(r.iter_lines())) == 3\r\nE assert 2 == 3\r\nE + where 2 = len([b'\"http://127.0.0.1:36813/stream/4\", \"args\": {}, \"headers\": {\"Host\": \"127.0.0.1:36813\", \"User-Agent\": \"python-request...\"Accept-Encoding\": \"gzip, deflate, br\", \"Accept\": \"*/*\", \"Connection\": \"keep-alive\"}, \"origin\": \"127.0.0.1\", \"id\": 3}'])\r\nE + where [b'\"http://127.0.0.1:36813/stream/4\", \"args\": {}, \"headers\": {\"Host\": \"127.0.0.1:36813\", \"User-Agent\": \"python-request...\"Accept-Encoding\": \"gzip, deflate, br\", \"Accept\": \"*/*\", \"Connection\": \"keep-alive\"}, \"origin\": \"127.0.0.1\", \"id\": 3}'] = list(<generator object Response.iter_lines at 0x7fe94788f040>)\r\nE + where <generator object Response.iter_lines at 0x7fe94788f040> = <bound method Response.iter_lines of <Response [200]>>()\r\nE + where <bound method Response.iter_lines of <Response [200]>> = <Response [200]>.iter_lines\r\n\r\ntests/test_requests.py:2093: AssertionError\r\n----------------------------- Captured stderr call -----------------------------\r\n127.0.0.1 - - [14/Feb/2024 22:52:05] \"GET /stream/4 HTTP/1.1\" 200 1008\r\n=============================== warnings summary ===============================\r\ntests/test_requests.py::TestRequests::test_set_basicauth[42-42]\r\ntests/test_requests.py::TestRequests::test_set_basicauth[42-42]\r\n /home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.31.0-4.fc35.x86_64/usr/lib/python3.8/site-packages/requests/auth.py:36: DeprecationWarning: Non-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (42) to a string or bytes object in the near future to avoid problems.\r\n warnings.warn(\r\n\r\ntests/test_requests.py::TestRequests::test_set_basicauth[42-42]\r\ntests/test_requests.py::TestRequests::test_set_basicauth[42-42]\r\n /home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.31.0-4.fc35.x86_64/usr/lib/python3.8/site-packages/requests/auth.py:46: DeprecationWarning: Non-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (<class 'int'>) to a string or bytes object in the near future to avoid problems.\r\n warnings.warn(\r\n\r\ntests/test_requests.py::TestRequests::test_set_basicauth[None-None]\r\ntests/test_requests.py::TestRequests::test_set_basicauth[None-None]\r\n /home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.31.0-4.fc35.x86_64/usr/lib/python3.8/site-packages/requests/auth.py:36: DeprecationWarning: Non-string usernames will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (None) to a string or bytes object in the near future to avoid problems.\r\n warnings.warn(\r\n\r\ntests/test_requests.py::TestRequests::test_set_basicauth[None-None]\r\ntests/test_requests.py::TestRequests::test_set_basicauth[None-None]\r\n /home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.31.0-4.fc35.x86_64/usr/lib/python3.8/site-packages/requests/auth.py:46: DeprecationWarning: Non-string passwords will no longer be supported in Requests 3.0.0. Please convert the object you've passed in (<class 'NoneType'>) to a string or bytes object in the near future to avoid problems.\r\n warnings.warn(\r\n\r\ntests/test_utils.py::TestContentEncodingDetection::test_none\r\ntests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta charset=\"UTF-8\">]\r\ntests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\">]\r\ntests/test_utils.py::TestContentEncodingDetection::test_pragmas[<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\" />]\r\ntests/test_utils.py::TestContentEncodingDetection::test_pragmas[<?xml version=\"1.0\" encoding=\"UTF-8\"?>]\r\ntests/test_utils.py::TestContentEncodingDetection::test_precedence\r\n /home/tkloczko/rpmbuild/BUILDROOT/python-requests-2.31.0-4.fc35.x86_64/usr/lib/python3.8/site-packages/requests/utils.py:489: DeprecationWarning: In requests 3.0, get_encodings_from_content will be removed. For more information, please see the discussion on issue #2266. (This warning should only appear once.)\r\n warnings.warn(\r\n\r\n-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html\r\n=========================== short test summary info ============================\r\nSKIPPED [1] tests/test_testserver.py:94: this fails non-deterministically under pytest-xdist\r\nSKIPPED [1] tests/test_utils.py:50: condition: cStringIO is None\r\nSKIPPED [10] tests/test_utils.py:815: Test only on Windows\r\nSKIPPED [1] tests/test_utils.py:868: Test only on Windows\r\nXFAIL tests/test_requests.py::TestRequests::test_response_iter_lines_reentrant\r\nFAILED tests/test_requests.py::TestRequests::test_https_warnings - pytest.Pyt...\r\nFAILED tests/test_utils.py::TestExtractZippedPaths::test_zipped_paths_extracted\r\n= 2 failed, 581 passed, 13 skipped, 1 xfailed, 14 warnings in 78.67s (0:01:18) =\r\n127.0.0.1 - - [14/Feb/2024 22:51:58] \"GET /relative-redirect/45 HTTP/1.1\" 302 0\r\n127.0.0.1 - - [14/Feb/2024 22:51:58] \"GET /cookies HTTP/1.1\" 200 40\r\n127.0.0.1 - - [14/Feb/2024 22:51:58] \"HEAD /get HTTP/1.1\" 200 0\r\n127.0.0.1 - - [14/Feb/2024 22:52:02] \"GET /get HTTP/1.1\" 200 313\r\n127.0.0.1 - - [14/Feb/2024 22:52:03] \"GET /get?f%C3%B8%C3%B8=f%C3%B8%C3%B8 HTTP/1.1\" 200 340\r\n127.0.0.1 - - [14/Feb/2024 22:52:03] \"GET /get?foo=foo HTTP/1.1\" 200 300\r\n127.0.0.1 - - [14/Feb/2024 22:52:04] \"GET /get HTTP/1.1\" 200 272\r\n127.0.0.1 - - [14/Feb/2024 22:52:05] \"GET /get HTTP/1.1\" 200 272\r\n```\r\n</details>\r\n",
"The issue is originating from your upgrading outside of our currently defined [testing infrastructure requirements](https://github.com/psf/requests/blob/main/requirements-dev.txt#L2C1-L2C22). We do not currently support pytest 8.0.0 which is the source of your test failures. Please run the tests with the prescribed requirements, otherwise this will be addressed when support for pytest 8.0 is added.",
"If it is issue related to use pytest 8.x IMO better would be keep this ticket opened with only renamed subject as sooner or later move to pytest 8 needs to be done."
] |
https://api.github.com/repos/psf/requests/issues/6638 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6638/labels{/name} | https://api.github.com/repos/psf/requests/issues/6638/comments | https://api.github.com/repos/psf/requests/issues/6638/events | https://github.com/psf/requests/issues/6638 | 2,129,849,732 | I_kwDOABTKOs5-8u2E | 6,638 | A | {
"avatar_url": "https://avatars.githubusercontent.com/u/159773733?v=4",
"events_url": "https://api.github.com/users/Attttar/events{/privacy}",
"followers_url": "https://api.github.com/users/Attttar/followers",
"following_url": "https://api.github.com/users/Attttar/following{/other_user}",
"gists_url": "https://api.github.com/users/Attttar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Attttar",
"id": 159773733,
"login": "Attttar",
"node_id": "U_kgDOCYX0JQ",
"organizations_url": "https://api.github.com/users/Attttar/orgs",
"received_events_url": "https://api.github.com/users/Attttar/received_events",
"repos_url": "https://api.github.com/users/Attttar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Attttar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Attttar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Attttar",
"user_view_type": "public"
} | [
{
"color": "d16014",
"default": false,
"description": "",
"id": 2392364523,
"name": "spam",
"node_id": "MDU6TGFiZWwyMzkyMzY0NTIz",
"url": "https://api.github.com/repos/psf/requests/labels/spam"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156042717,
"name": "actions/autoclose-qa",
"node_id": "LA_kwDOABTKOs8AAAABbu3B3Q",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-qa"
}
] | closed | true | null | [] | null | 1 | 2024-02-12T10:37:43Z | 2024-02-12T14:00:49Z | 2024-02-12T14:00:48Z | NONE | off-topic | <!-- 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/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6638/reactions"
} | https://api.github.com/repos/psf/requests/issues/6638/timeline | null | completed | null | null | false | [
"As described in the template, we won't be able to answer questions on this issue tracker. Please use [Stack Overflow](https://stackoverflow.com/)"
] |
https://api.github.com/repos/psf/requests/issues/6637 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6637/labels{/name} | https://api.github.com/repos/psf/requests/issues/6637/comments | https://api.github.com/repos/psf/requests/issues/6637/events | https://github.com/psf/requests/issues/6637 | 2,126,864,811 | I_kwDOABTKOs5-xWGr | 6,637 | [BUG] pytest error in python:3.8- (only work in 3.7) because httpbin uses deprecated werkzeug function 'parse_authorization_header' | {
"avatar_url": "https://avatars.githubusercontent.com/u/25452313?v=4",
"events_url": "https://api.github.com/users/bgb10/events{/privacy}",
"followers_url": "https://api.github.com/users/bgb10/followers",
"following_url": "https://api.github.com/users/bgb10/following{/other_user}",
"gists_url": "https://api.github.com/users/bgb10/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bgb10",
"id": 25452313,
"login": "bgb10",
"node_id": "MDQ6VXNlcjI1NDUyMzEz",
"organizations_url": "https://api.github.com/users/bgb10/orgs",
"received_events_url": "https://api.github.com/users/bgb10/received_events",
"repos_url": "https://api.github.com/users/bgb10/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bgb10/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bgb10/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bgb10",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 2 | 2024-02-09T10:32:47Z | 2024-02-09T10:57:49Z | 2024-02-09T10:48:50Z | NONE | null | # Summary
pytest error happens in python:3.8- (only work in 3.7) because httpbin uses **deprecated werkzeug function 'parse_authorization_header'**. Because of this, pytest don't work above python 3.8 version, and it could be a serious problem for requests.py contributers.
I'm new to open source contributing, so if you have any suggestions, I'd appreciate it :)
# How I found this error?
As python newcomer, I thought requests.py is the best library to learn about python, OOP, networking. So I cloned a code and ran pytest.
## Expected Result
I expected pytest working well, but the error occured.
## Actual Result

this is the error stacktrace I've got, and it says ImportError from 'httpbin' library when importing werkzeug.http 'parse_authorization_header' function.
# Problem Analysis
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "3.6"
},
"implementation": {
"name": "CPython",
"version": "3.10.7"
},
"platform": {
"release": "5.15.49-linuxkit",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "1010117f"
},
"urllib3": {
"version": "2.2.0"
},
"using_charset_normalizer": true,
"using_pyopenssl": false
}
```
## Installation
```bash
git clone https://github.com/psf/requests.git
cd requests
pip install .
pip install -r requirements-dev.txt
pytest
```
## Works in python:3.7 but higher versions are not
I used docker environment(not venv, but working same in venv!) to reproduce the problem, and I found only python:3.7 works but higher versions are not.
In python:3.7, pytest running well.

But in python:3.8 and 3.10, pytest errors ImportError!


## Reason of Error
'httpbin' is using 'werkzeug's parse_authorization_header from http.py. However, parse_authorization_header is deprecated since 3.0 and .Authorization.from_header should be used instead.
Requests.py uses Werkzeug 3.0.1 since python 3.8 and this is causing compatibility issues with httpbin
# How to solve it?
I think the best one is fixing httpbin source code so I'll upload an issue to them.
This error is not directly related with requests.py because the error cause is in another library, but I think error could be a problem for contributers, so I think a solution is needed.
**In my case, changing the werkzeug version to v2.2.3 solved it (flask throws a warning, but pytest in requests.py works fine).**
I would like contributors to be aware of the issues I mentioned. Thank you! | {
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6637/reactions"
} | https://api.github.com/repos/psf/requests/issues/6637/timeline | null | completed | null | null | false | [
"In the future, please search **closed and** open issues before creating new ones that are duplicates.",
"> In the future, please search **closed and** open issues before creating new ones that are duplicates.\r\n\r\nThank you for your response, I will be more careful."
] |
https://api.github.com/repos/psf/requests/issues/6636 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6636/labels{/name} | https://api.github.com/repos/psf/requests/issues/6636/comments | https://api.github.com/repos/psf/requests/issues/6636/events | https://github.com/psf/requests/issues/6636 | 2,123,685,318 | I_kwDOABTKOs5-lN3G | 6,636 | requests Session and pool timeout. | {
"avatar_url": "https://avatars.githubusercontent.com/u/17838524?v=4",
"events_url": "https://api.github.com/users/mat105/events{/privacy}",
"followers_url": "https://api.github.com/users/mat105/followers",
"following_url": "https://api.github.com/users/mat105/following{/other_user}",
"gists_url": "https://api.github.com/users/mat105/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mat105",
"id": 17838524,
"login": "mat105",
"node_id": "MDQ6VXNlcjE3ODM4NTI0",
"organizations_url": "https://api.github.com/users/mat105/orgs",
"received_events_url": "https://api.github.com/users/mat105/received_events",
"repos_url": "https://api.github.com/users/mat105/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mat105/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mat105/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mat105",
"user_view_type": "public"
} | [
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156042717,
"name": "actions/autoclose-qa",
"node_id": "LA_kwDOABTKOs8AAAABbu3B3Q",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-qa"
}
] | closed | true | null | [] | null | 1 | 2024-02-07T19:04:44Z | 2024-02-07T19:04:56Z | 2024-02-07T19:04:56Z | NONE | off-topic | Hi i want to know if it is possible for connections in session pool to have a timeout.
For example
```
import requests
import time
sess = requests.Session(pool_timeout=3)
sess.get("https://www.google.com")
time.sleep(4)
sess.get("https://www.google.com") # This creates a new connection and the previous is closed
```
I've found some answers that point to setting default_socket_options, but that doesn't seem to close sessions i always end up with this behaviour while logging.
```
import logging
logging.basicConfig(level=logging.DEBUG)
import requests
import time
import socket
from urllib3.connection import HTTPConnection
HTTPConnection.default_socket_options = ( HTTPConnection.default_socket_options + [
(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 1),
(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 1),
(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 1)
]
)
url = 'https://www.google.com'
sess = requests.Session()
for x in range(2):
data = sess.get(url)
print(data)
time.sleep(3)
```
This doesn't start a new https connection, nor it does tell me if any of the socket options above is doing anything.
```
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.google.com:443
DEBUG:urllib3.connectionpool:https://www.google.com:443 "GET / HTTP/1.1" 200 None
<Response [200]>
DEBUG:urllib3.connectionpool:https://www.google.com:443 "GET / HTTP/1.1" 200 None
<Response [200]>
```
Maybe i'm missing some concept, but those socket options do not say that after 1 second of not sending requests, the socket should be closed?
Thanks
| {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6636/reactions"
} | https://api.github.com/repos/psf/requests/issues/6636/timeline | null | completed | null | null | false | [
"As described in the template, we won't be able to answer questions on this issue tracker. Please use [Stack Overflow](https://stackoverflow.com/)"
] |
https://api.github.com/repos/psf/requests/issues/6635 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6635/labels{/name} | https://api.github.com/repos/psf/requests/issues/6635/comments | https://api.github.com/repos/psf/requests/issues/6635/events | https://github.com/psf/requests/issues/6635 | 2,121,880,817 | I_kwDOABTKOs5-eVTx | 6,635 | IPv6 address change for sequential gets | {
"avatar_url": "https://avatars.githubusercontent.com/u/31780740?v=4",
"events_url": "https://api.github.com/users/Gezzo42/events{/privacy}",
"followers_url": "https://api.github.com/users/Gezzo42/followers",
"following_url": "https://api.github.com/users/Gezzo42/following{/other_user}",
"gists_url": "https://api.github.com/users/Gezzo42/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Gezzo42",
"id": 31780740,
"login": "Gezzo42",
"node_id": "MDQ6VXNlcjMxNzgwNzQw",
"organizations_url": "https://api.github.com/users/Gezzo42/orgs",
"received_events_url": "https://api.github.com/users/Gezzo42/received_events",
"repos_url": "https://api.github.com/users/Gezzo42/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Gezzo42/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Gezzo42/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Gezzo42",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 2 | 2024-02-06T23:53:20Z | 2024-02-07T13:06:38Z | 2024-02-07T13:06:38Z | NONE | null | I'm not sure, if the following issue is caused by requests or one of the underlying libraries.
The library [python-fritzhome](https://github.com/hthiery/python-fritzhome/) uses requests to connect to the HTTP interface of a router called FRITZ!Box. During sequential get calls, the IPv6 address is switched.
I already opened an [issue](https://github.com/hthiery/python-fritzhome/issues/92) for the mentioned library, but got no solution.
## Expected Result
All connections of the same session object are made using the same IPv6 address.
## Actual Result
The third get request uses a different IPv6 address (extract of a tcpdump record):

## Reproduction Steps
```python
import requests
import time
s = requests.Session()
rsp = s.get('http://fritz.box/login_sid.lua')
rsp.raise_for_status()
time.sleep(0.5)
rsp = s.get('http://fritz.box/login_sid.lua')
rsp.raise_for_status()
time.sleep(0.5)
rsp = s.get('http://fritz.box/login_sid.lua')
rsp.raise_for_status()
print(rsp.text.strip())
```
## System Information
Hardware and OS: Raspberry Pi 5, Raspberry Pi OS Lite 64 based on Debian 12
$ python -m requests.help
```json
{
"chardet": {
"version": null
},
"charset_normalizer": {
"version": "3.3.2"
},
"cryptography": {
"version": "41.0.7"
},
"idna": {
"version": "3.6"
},
"implementation": {
"name": "CPython",
"version": "3.11.2"
},
"platform": {
"release": "6.1.0-rpi8-rpi-2712",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "30100040",
"version": "23.2.0"
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "300000b0"
},
"urllib3": {
"version": "2.1.0"
},
"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/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/6635/reactions"
} | https://api.github.com/repos/psf/requests/issues/6635/timeline | null | completed | null | null | false | [
"Removing the sleep calls did not change anything:\r\n",
"@Gezzo42 this is not a bug. It's not ideal that when looking up the DNS for a hostname we only ever use 1 address. It's also not clear why you consider this a bug. Even still, this can likely be reproduced with just `urllib3` and potentially even with _any_ http client in Python (aiohttp, httpx, etc.) If you want to pin to a given IP address, you will want to specify it yourself. These all seem to be local addresses.\r\n\r\nTo get the ideal behaviour, you likely want to ensure:\r\n* The library you're using isn't disabling keep-alive\r\n* The server you're communicating with supports keep-alive\r\n* Anything you have between you and the server isn't preventing keep-alive."
] |
https://api.github.com/repos/psf/requests/issues/6634 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6634/labels{/name} | https://api.github.com/repos/psf/requests/issues/6634/comments | https://api.github.com/repos/psf/requests/issues/6634/events | https://github.com/psf/requests/pull/6634 | 2,120,130,436 | PR_kwDOABTKOs5mG8to | 6,634 | feat: ability to custom `HTTPAdapter` instance variables while creating `Session` | {
"avatar_url": "https://avatars.githubusercontent.com/u/16933298?v=4",
"events_url": "https://api.github.com/users/scruel/events{/privacy}",
"followers_url": "https://api.github.com/users/scruel/followers",
"following_url": "https://api.github.com/users/scruel/following{/other_user}",
"gists_url": "https://api.github.com/users/scruel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/scruel",
"id": 16933298,
"login": "scruel",
"node_id": "MDQ6VXNlcjE2OTMzMjk4",
"organizations_url": "https://api.github.com/users/scruel/orgs",
"received_events_url": "https://api.github.com/users/scruel/received_events",
"repos_url": "https://api.github.com/users/scruel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/scruel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/scruel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/scruel",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 2 | 2024-02-06T07:26:21Z | 2024-02-06T11:33:11Z | 2024-02-06T11:24:30Z | NONE | null | Ability to custom `HTTPAdapter` instance variables while creating `Session`. | {
"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/6634/reactions"
} | https://api.github.com/repos/psf/requests/issues/6634/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6634.diff",
"html_url": "https://github.com/psf/requests/pull/6634",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6634.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6634"
} | true | [
"This project is under a feature freeze and it's not accepting changes like this. Thank you for thinking of us but we'll be closing this without merging ",
"Ok, that's fine, even I do think I will need this, I now have to apply temporary workarounds for this. If you change your mind, feel free to provide your feedback here."
] |
https://api.github.com/repos/psf/requests/issues/6633 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6633/labels{/name} | https://api.github.com/repos/psf/requests/issues/6633/comments | https://api.github.com/repos/psf/requests/issues/6633/events | https://github.com/psf/requests/issues/6633 | 2,119,382,441 | I_kwDOABTKOs5-UzWp | 6,633 | Getting warning while running databricks cli command in azure devops | {
"avatar_url": "https://avatars.githubusercontent.com/u/33160103?v=4",
"events_url": "https://api.github.com/users/AGpta/events{/privacy}",
"followers_url": "https://api.github.com/users/AGpta/followers",
"following_url": "https://api.github.com/users/AGpta/following{/other_user}",
"gists_url": "https://api.github.com/users/AGpta/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AGpta",
"id": 33160103,
"login": "AGpta",
"node_id": "MDQ6VXNlcjMzMTYwMTAz",
"organizations_url": "https://api.github.com/users/AGpta/orgs",
"received_events_url": "https://api.github.com/users/AGpta/received_events",
"repos_url": "https://api.github.com/users/AGpta/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AGpta/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AGpta/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AGpta",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2024-02-05T20:15:08Z | 2024-02-05T20:18:40Z | 2024-02-05T20:18:37Z | NONE | null | <!-- Summary. -->
Hello team,
i am using Databricks Cli for deployment of notebooks on azure and it is throwing below warning. Could you help me to resolve warning? Also i am using pip install --upgrade urllib3 chardet command to upgrade but still it is giving warning.
/usr/lib/python3/dist-packages/requests/__init__.py:87: RequestsDependencyWarning: urllib3 (2.2.0) or chardet (4.0.0) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
## Expected Result
I want to ignore/resolve the warning.
<!-- What you expected. -->
## Actual Result
It is throwing warning as below
/usr/lib/python3/dist-packages/requests/__init__.py:87: RequestsDependencyWarning: urllib3 (2.2.0) or chardet (4.0.0) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
| {
"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/6633/reactions"
} | https://api.github.com/repos/psf/requests/issues/6633/timeline | null | not_planned | 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/6632 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6632/labels{/name} | https://api.github.com/repos/psf/requests/issues/6632/comments | https://api.github.com/repos/psf/requests/issues/6632/events | https://github.com/psf/requests/pull/6632 | 2,118,982,215 | PR_kwDOABTKOs5mC_sD | 6,632 | Bump github/codeql-action from 3.23.0 to 3.24.0 | {
"avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4",
"events_url": "https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/dependabot%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/dependabot",
"id": 49699333,
"login": "dependabot[bot]",
"node_id": "MDM6Qm90NDk2OTkzMzM=",
"organizations_url": "https://api.github.com/users/dependabot%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/dependabot%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/dependabot%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dependabot%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/dependabot%5Bbot%5D",
"user_view_type": "public"
} | [
{
"color": "0366d6",
"default": false,
"description": "Pull requests that update a dependency file",
"id": 1868210094,
"name": "dependencies",
"node_id": "MDU6TGFiZWwxODY4MjEwMDk0",
"url": "https://api.github.com/repos/psf/requests/labels/dependencies"
},
{
"color": "000000",
"default": false,
"description": "Pull requests that update GitHub Actions code",
"id": 5838729011,
"name": "github_actions",
"node_id": "LA_kwDOABTKOs8AAAABXAPvMw",
"url": "https://api.github.com/repos/psf/requests/labels/github_actions"
}
] | closed | false | null | [] | null | 0 | 2024-02-05T16:38:02Z | 2024-02-06T02:54:28Z | 2024-02-06T02:54:27Z | CONTRIBUTOR | null | Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.23.0 to 3.24.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/github/codeql-action/blob/main/CHANGELOG.md">github/codeql-action's changelog</a>.</em></p>
<blockquote>
<h1>CodeQL Action Changelog</h1>
<p>See the <a href="https://github.com/github/codeql-action/releases">releases page</a> for the relevant changes to the CodeQL CLI and language packs.</p>
<p>Note that the only difference between <code>v2</code> and <code>v3</code> of the CodeQL Action is the node version they support, with <code>v3</code> running on node 20 while we continue to release <code>v2</code> to support running on node 16. For example <code>3.22.11</code> was the first <code>v3</code> release and is functionally identical to <code>2.22.11</code>. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.</p>
<h2>[UNRELEASED]</h2>
<p>No user facing changes.</p>
<h2>3.24.0 - 02 Feb 2024</h2>
<ul>
<li>CodeQL Python analysis will no longer install dependencies on GitHub Enterprise Server, as is already the case for GitHub.com. See <a href="https://github.com/github/codeql-action/blob/main/#3230---08-jan-2024">release notes for 3.23.0</a> for more details. <a href="https://redirect.github.com/github/codeql-action/pull/2106">#2106</a></li>
</ul>
<h2>3.23.2 - 26 Jan 2024</h2>
<ul>
<li>On Linux, the maximum possible value for the <code>--threads</code> option now respects the CPU count as specified in <code>cgroup</code> files to more accurately reflect the number of available cores when running in containers. <a href="https://redirect.github.com/github/codeql-action/pull/2083">#2083</a></li>
<li>Update default CodeQL bundle version to 2.16.1. <a href="https://redirect.github.com/github/codeql-action/pull/2096">#2096</a></li>
</ul>
<h2>3.23.1 - 17 Jan 2024</h2>
<ul>
<li>Update default CodeQL bundle version to 2.16.0. <a href="https://redirect.github.com/github/codeql-action/pull/2073">#2073</a></li>
<li>Change the retention period for uploaded debug artifacts to 7 days. Previously, this was whatever the repository default was. <a href="https://redirect.github.com/github/codeql-action/pull/2079">#2079</a></li>
</ul>
<h2>3.23.0 - 08 Jan 2024</h2>
<ul>
<li>We are rolling out a feature in January 2024 that will disable Python dependency installation by default for all users. This improves the speed of analysis while having only a very minor impact on results. You can override this behavior by setting <code>CODEQL_ACTION_DISABLE_PYTHON_DEPENDENCY_INSTALLATION=false</code> in your workflow, however we plan to remove this ability in future versions of the CodeQL Action. <a href="https://redirect.github.com/github/codeql-action/pull/2031">#2031</a></li>
<li>The CodeQL Action now requires CodeQL version 2.11.6 or later. For more information, see <a href="https://github.com/github/codeql-action/blob/main/#2227---16-nov-2023">the corresponding changelog entry for CodeQL Action version 2.22.7</a>. <a href="https://redirect.github.com/github/codeql-action/pull/2009">#2009</a></li>
</ul>
<h2>3.22.12 - 22 Dec 2023</h2>
<ul>
<li>Update default CodeQL bundle version to 2.15.5. <a href="https://redirect.github.com/github/codeql-action/pull/2047">#2047</a></li>
</ul>
<h2>3.22.11 - 13 Dec 2023</h2>
<ul>
<li>[v3+ only] The CodeQL Action now runs on Node.js v20. <a href="https://redirect.github.com/github/codeql-action/pull/2006">#2006</a></li>
</ul>
<h2>2.22.10 - 12 Dec 2023</h2>
<ul>
<li>Update default CodeQL bundle version to 2.15.4. <a href="https://redirect.github.com/github/codeql-action/pull/2016">#2016</a></li>
</ul>
<h2>2.22.9 - 07 Dec 2023</h2>
<p>No user facing changes.</p>
<h2>2.22.8 - 23 Nov 2023</h2>
<ul>
<li>Update default CodeQL bundle version to 2.15.3. <a href="https://redirect.github.com/github/codeql-action/pull/2001">#2001</a></li>
</ul>
<h2>2.22.7 - 16 Nov 2023</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/github/codeql-action/commit/e8893c57a1f3a2b659b6b55564fdfdbbd2982911"><code>e8893c5</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2113">#2113</a> from github/update-v3.24.0-2db032717</li>
<li><a href="https://github.com/github/codeql-action/commit/78d6c8e84d016cf4acb354a3303db8635054030f"><code>78d6c8e</code></a> Update changelog for v3.24.0</li>
<li><a href="https://github.com/github/codeql-action/commit/2db03271718eb704357b7bbf29ef6876a898f966"><code>2db0327</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2112">#2112</a> from github/henrymercer/status-report-handle-disk-fa...</li>
<li><a href="https://github.com/github/codeql-action/commit/f9dea84e297d93b380c8e1fbee3b726ae2f9a0d1"><code>f9dea84</code></a> Status report: Handle failures determining disk usage</li>
<li><a href="https://github.com/github/codeql-action/commit/81eb6b2bf41204db055248bd3f7a89f335b6e4d9"><code>81eb6b2</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2108">#2108</a> from github/henrymercer/build-mode-input</li>
<li><a href="https://github.com/github/codeql-action/commit/483bef1dab1b4345c7aaad6b5ab530b6296dc57e"><code>483bef1</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2106">#2106</a> from github/rasmuswl/default-no-dep-inst</li>
<li><a href="https://github.com/github/codeql-action/commit/b58c2f67a6ee7168ff2d21176f29c8e7a25f34f8"><code>b58c2f6</code></a> Detail requirements for different build modes</li>
<li><a href="https://github.com/github/codeql-action/commit/f7d53249e3ff1b2d2bc99288527e155561d1ba90"><code>f7d5324</code></a> Update wording for CHANGELOG.md</li>
<li><a href="https://github.com/github/codeql-action/commit/254b53d99969befd5b84fbe43df37bc8e9350bfc"><code>254b53d</code></a> Merge branch 'main' into henrymercer/build-mode-input</li>
<li><a href="https://github.com/github/codeql-action/commit/e34513334c80bc03203d626a9c14243c9bf67245"><code>e345133</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2107">#2107</a> from github/henrymercer/refactor-config</li>
<li>Additional commits viewable in <a href="https://github.com/github/codeql-action/compare/e5f05b81d5b6ff8cfa111c80c22c5fd02a384118...e8893c57a1f3a2b659b6b55564fdfdbbd2982911">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details> | {
"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/6632/reactions"
} | https://api.github.com/repos/psf/requests/issues/6632/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6632.diff",
"html_url": "https://github.com/psf/requests/pull/6632",
"merged_at": "2024-02-06T02:54:27Z",
"patch_url": "https://github.com/psf/requests/pull/6632.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6632"
} | true | [] |
https://api.github.com/repos/psf/requests/issues/6631 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6631/labels{/name} | https://api.github.com/repos/psf/requests/issues/6631/comments | https://api.github.com/repos/psf/requests/issues/6631/events | https://github.com/psf/requests/issues/6631 | 2,114,940,049 | I_kwDOABTKOs5-D2yR | 6,631 | `params` might be misnamed? | {
"avatar_url": "https://avatars.githubusercontent.com/u/5273302?v=4",
"events_url": "https://api.github.com/users/Matthew1471/events{/privacy}",
"followers_url": "https://api.github.com/users/Matthew1471/followers",
"following_url": "https://api.github.com/users/Matthew1471/following{/other_user}",
"gists_url": "https://api.github.com/users/Matthew1471/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Matthew1471",
"id": 5273302,
"login": "Matthew1471",
"node_id": "MDQ6VXNlcjUyNzMzMDI=",
"organizations_url": "https://api.github.com/users/Matthew1471/orgs",
"received_events_url": "https://api.github.com/users/Matthew1471/received_events",
"repos_url": "https://api.github.com/users/Matthew1471/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Matthew1471/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Matthew1471/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Matthew1471",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-02-02T13:29:53Z | 2024-02-03T10:11:54Z | 2024-02-03T10:11:54Z | NONE | null | <!-- Summary. -->
### Summary
Being a bit pedantic but isn't it that the `parameters` of a URL are a ";<parameters>" affair inside the path e.g. `https://example.com/document;language=english?documentID=5` ([RFC source](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3) and [summary](https://stackoverflow.com/a/39294675)) and what Requests calls `params` is actually the `query`.. which I long have been calling the "querystring" thanks to my days of Classic ASP programming referencing the "query string" (https://www.w3schools.com/asp/coll_querystring.asp and https://en.wikipedia.org/wiki/Query_string).
[Documentation calls them part of the query string too](https://requests.readthedocs.io/en/latest/user/quickstart/#passing-parameters-in-urls).
<!-- What you expected. -->
### What you expected
Good question, maybe the keyword to be `query`? But I highly doubt there will be any aspiration to start renaming the library's keywords at this late stage in a way that would cause a breaking change (unless both were accepted and one was mapped to the other). Validation I guess that I am right (or a correction if I am wrong)? | {
"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/6631/reactions"
} | https://api.github.com/repos/psf/requests/issues/6631/timeline | null | not_planned | null | null | false | [
"Parameters is another common name for the parsed (not encoded) pieces of the query string. `params` are meant to be passed as a native python object (e.g., dictionary of string to string, sequence of tuples of length 2, etc). So if you parsed a query string into parameters on the server side, the client side would take parameters and encode them into the query string \n\nEdit to add: \n\n- https://www.botify.com/learn/basics/what-are-url-parameters#:~:text=URL%20parameters%20(also%20known%20as,by%20the%20'%26'%20symbol.\n- https://rapidapi.com/blog/api-glossary/parameters/#:~:text=API%20parameters%20are%20the%20variable,present%20in%20the%20API%20endpoint.\n- https://support.google.com/google-ads/answer/6277564?hl=en\n- https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams\n- https://docs.oracle.com/en/cloud/saas/marketing/eloqua-develop/Developers/GettingStarted/APIRequests/URL-parameters.htm\n- https://sentry.io/answers/how-to-get-values-from-urls-in-javascript/\n- https://www.w3docs.com/snippets/javascript/how-to-get-url-parameters.html\n\nNone of this is to say you're wrong and we're right, just that it's not uncommon for the query string to be called query parameters or parameters for short "
] |
https://api.github.com/repos/psf/requests/issues/6630 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6630/labels{/name} | https://api.github.com/repos/psf/requests/issues/6630/comments | https://api.github.com/repos/psf/requests/issues/6630/events | https://github.com/psf/requests/issues/6630 | 2,113,256,716 | I_kwDOABTKOs599b0M | 6,630 | Multipart/form-data requests creates mismatched boundaries between request body and headers | {
"avatar_url": "https://avatars.githubusercontent.com/u/87405798?v=4",
"events_url": "https://api.github.com/users/p1gyy/events{/privacy}",
"followers_url": "https://api.github.com/users/p1gyy/followers",
"following_url": "https://api.github.com/users/p1gyy/following{/other_user}",
"gists_url": "https://api.github.com/users/p1gyy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/p1gyy",
"id": 87405798,
"login": "p1gyy",
"node_id": "MDQ6VXNlcjg3NDA1Nzk4",
"organizations_url": "https://api.github.com/users/p1gyy/orgs",
"received_events_url": "https://api.github.com/users/p1gyy/received_events",
"repos_url": "https://api.github.com/users/p1gyy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/p1gyy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/p1gyy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/p1gyy",
"user_view_type": "public"
} | [
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
}
] | closed | false | null | [] | null | 1 | 2024-02-01T19:04:24Z | 2024-02-03T12:27:10Z | 2024-02-03T12:26:40Z | NONE | null | <!-- Summary. -->
## Expected Result
multipart/form-data requests should have the same boundary in the request content-type headers and request body:
Content-Type header: `multipart/form-data; boundary=bb8517293e3e961b2e7dfbd4e303fe56`
Boundary for request body: `--bb8517293e3e961b2e7dfbd4e303fe56`
## Actual Result
multipart/form-data requests have different boundaries in the request content-type headers and request body:
Content-Type header: `multipart/form-data; boundary=bb8517293e3e961b2e7dfbd4e303fe56`
Boundary for request body: `--42fdbee1e9d775f1239dda28331699a7`
## Reproduction Steps
```python
import requests
session = requests.session()
data = {
"name": "test",
"description": "test",
}
files = {'upload_file': open("yourfile.txt", "rb")}
req = session.post("https://example.com", files=files, data=data)
print("Request Headers: " + str(req.request.headers))
print("Request Body: " + str(req.request.body))
print("Status Code: " + str(req.status_code))
print("Response Headers: " + str(req.headers))
print("Response Body: " + str(req.text))
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": "3.0.4"
},
"charset_normalizer": {
"version": "2.1.0"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.10"
},
"implementation": {
"name": "CPython",
"version": "3.10.7"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.31.0"
},
"system_ssl": {
"version": "1010111f"
},
"urllib3": {
"version": "1.26.11"
},
"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/6630/reactions"
} | https://api.github.com/repos/psf/requests/issues/6630/timeline | null | completed | null | null | false | [
"I cannot reproduce this at all. The only time the boundary tends to differ in the header from what's in the body is when the user overrides the Content-Type header manually.\r\n\r\nIn the future, please search **closed and** open issues before creating new ones that are duplicates."
] |
https://api.github.com/repos/psf/requests/issues/6629 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6629/labels{/name} | https://api.github.com/repos/psf/requests/issues/6629/comments | https://api.github.com/repos/psf/requests/issues/6629/events | https://github.com/psf/requests/pull/6629 | 2,110,464,310 | PR_kwDOABTKOs5llzHQ | 6,629 | Fix #6628 - JSONDecodeError are not deserializable | {
"avatar_url": "https://avatars.githubusercontent.com/u/8852408?v=4",
"events_url": "https://api.github.com/users/Tarty/events{/privacy}",
"followers_url": "https://api.github.com/users/Tarty/followers",
"following_url": "https://api.github.com/users/Tarty/following{/other_user}",
"gists_url": "https://api.github.com/users/Tarty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Tarty",
"id": 8852408,
"login": "Tarty",
"node_id": "MDQ6VXNlcjg4NTI0MDg=",
"organizations_url": "https://api.github.com/users/Tarty/orgs",
"received_events_url": "https://api.github.com/users/Tarty/received_events",
"repos_url": "https://api.github.com/users/Tarty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Tarty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Tarty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Tarty",
"user_view_type": "public"
} | [] | closed | false | null | [] | {
"closed_at": null,
"closed_issues": 13,
"created_at": "2023-08-13T17:04:53Z",
"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/33",
"id": 9786066,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/33/labels",
"node_id": "MI_kwDOABTKOs4AlVLS",
"number": 33,
"open_issues": 0,
"state": "open",
"title": "2.32.0",
"updated_at": "2024-05-20T14:17:03Z",
"url": "https://api.github.com/repos/psf/requests/milestones/33"
} | 4 | 2024-01-31T16:14:59Z | 2024-02-29T09:34:49Z | 2024-02-22T20:27:37Z | CONTRIBUTOR | null | See issue #6628 for full bug-report
-----
requests.exceptions.JSONDecodeError are not deserializable: calling `pickle.dumps` followed by `pickle.loads` will trigger an error.
This is particularly a problem in a process pool, as an attempt to decode json on an invalid json document will result in the entire process pool crashing.
This is due to the MRO of the `requests.exceptions.JSONDecodeError` class: the `__reduce__` method called when pickling an instance is not the one from the JSON library parent: two out of three args expected for instantiation will be dropped, and the instance can't be deserialised.
By specifying in the class which parent `__reduce__` method should be called, the bug is fixed as all args are carried over in the resulting pickled bytes. | {
"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/6629/reactions"
} | https://api.github.com/repos/psf/requests/issues/6629/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6629.diff",
"html_url": "https://github.com/psf/requests/pull/6629",
"merged_at": "2024-02-22T20:27:37Z",
"patch_url": "https://github.com/psf/requests/pull/6629.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6629"
} | true | [
"We need to fix the CI but this should be set to go once that's resolved.",
"closing and re-opening to trigger a new build",
"Looks like tests are passing now, I'll go ahead and merge. Thanks again, @Tarty!",
"Happy to contribute, thanks for merging the fix in!"
] |
https://api.github.com/repos/psf/requests/issues/6628 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6628/labels{/name} | https://api.github.com/repos/psf/requests/issues/6628/comments | https://api.github.com/repos/psf/requests/issues/6628/events | https://github.com/psf/requests/issues/6628 | 2,110,445,937 | I_kwDOABTKOs59ytlx | 6,628 | [BUG] JSONDecodeError can't be deserialized - invalid JSON raises a BrokenProcessPool and crashes the entire process pool | {
"avatar_url": "https://avatars.githubusercontent.com/u/8852408?v=4",
"events_url": "https://api.github.com/users/Tarty/events{/privacy}",
"followers_url": "https://api.github.com/users/Tarty/followers",
"following_url": "https://api.github.com/users/Tarty/following{/other_user}",
"gists_url": "https://api.github.com/users/Tarty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Tarty",
"id": 8852408,
"login": "Tarty",
"node_id": "MDQ6VXNlcjg4NTI0MDg=",
"organizations_url": "https://api.github.com/users/Tarty/orgs",
"received_events_url": "https://api.github.com/users/Tarty/received_events",
"repos_url": "https://api.github.com/users/Tarty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Tarty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Tarty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Tarty",
"user_view_type": "public"
} | [] | closed | false | null | [] | {
"closed_at": null,
"closed_issues": 13,
"created_at": "2023-08-13T17:04:53Z",
"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/33",
"id": 9786066,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/33/labels",
"node_id": "MI_kwDOABTKOs4AlVLS",
"number": 33,
"open_issues": 0,
"state": "open",
"title": "2.32.0",
"updated_at": "2024-05-20T14:17:03Z",
"url": "https://api.github.com/repos/psf/requests/milestones/33"
} | 1 | 2024-01-31T16:06:02Z | 2024-05-15T20:21:26Z | 2024-02-22T20:27:39Z | CONTRIBUTOR | null | Hi all,
I've stumbled upon a bug in the `requests` library, and have a proposal for a fix.
In short: I have a process pool running tasks in parallel, that are among other things doing queries to third-party APIs. One third-party returns an invalid JSON document as response in case of error.
However, instead of just having a JSONDecodeError as the result of my job, the entire process pool crashes due to a BrokenProcessPool error with the following stack trace:
```
Traceback (most recent call last):
File "/usr/local/lib/python3.11/concurrent/futures/process.py", line 424, in wait_result_broken_or_wakeup
result_item = result_reader.recv()
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/multiprocessing/connection.py", line 251, in recv
return _ForkingPickler.loads(buf.getbuffer())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/exceptions.py", line 41, in __init__
CompatJSONDecodeError.__init__(self, *args)
TypeError: JSONDecodeError.__init__() missing 2 required positional arguments: 'doc' and 'pos'
```
So I'm in a situation where receiving one invalid JSON as response is interrupting all my ongoing tasks because the entire process pool is crashing, and no more tasks can be submitted until the process pool recovered.
## Origin of the bug + Fix
After investigation, this is because the `requests.exception.JSONDecodeError` instances can't be deserialized once they've been serialized via `pickle`. So when the main process is trying to deserialize the error returned by the child process, the main process is crashing with to the error above.
I think this bug has been around for a while, I've found old tickets from different projects mentioning issues that are looking similar: https://github.com/celery/celery/issues/5712
I've pinpointed the bug to the following class: https://github.com/psf/requests/blob/main/src/requests/exceptions.py#L31
Basically, due the MRO/order of inheritance, the `__reduce__` method used will not be the one of `CompatJSONDecodeError`. Most of the args will therefore be ditched when pickling the instance and it can't be deserialised back because `CompatJSONDecodeError.__init__` does expect those args. MRO below:
```
In [1]: from requests.exceptions import JSONDecodeError
In [2]: JSONDecodeError.__mro__
Out[2]:
(requests.exceptions.JSONDecodeError,
requests.exceptions.InvalidJSONError,
requests.exceptions.RequestException,
OSError,
simplejson.errors.JSONDecodeError,
ValueError,
Exception,
BaseException,
object)
```
I think the fix could be quite simple and should have very little side-effects: to specify a `JSONDecodeError.__reduce__` method that will call the one from the correct parent class (it will be regardless that it is json/simplejson via the Compat class, their respective methods having different signatures).
I've taken the initiative to write a fix + a test and will raise a pull request to that effect 🙏
-----
## Expected Result
I've written a test for this case: the error can easily be reproduced by simply trying to `pickle.dumps()` then `pickle.loads()` on a error:
```python
json_decode_error = requests.exceptions.JSONDecodeError(
"Extra data",
'{"responseCode":["706"],"data":null}{"responseCode":["706"],"data":null}',
36,
)
deserialized_error = pickle.loads(pickle.dumps(json_decode_error))
assert repr(json_decode_error) == repr(deserialized_error)
```
This assertion should be true
## Actual Result
Currently, instead of passing it'll raise the following error:
```
> CompatJSONDecodeError.__init__(self, *args)
E TypeError: JSONDecodeError.__init__() missing 2 required positional arguments: 'doc' and 'pos'
```
## Reproduction Steps
As mentioned above, this bug is more impactful in a multi-process architecture as it'll break the entire process pool.
For something looking a bit more like a live-case, I've produced a little snippet with a really simple API returning an invalid JSON:
```python
# File api.py
from fastapi import FastAPI
from starlette.responses import PlainTextResponse
app = FastAPI()
@app.get("/")
async def root():
# An invalid json string returned by the endpoint that will trigger a JSONDecodeError when calling `res.json()`
s = '{"responseCode":["706"],"data":null}{"responseCode":["706"],"data":null}'
return PlainTextResponse(s, media_type="application/json", status_code=400)
# Run the API:
# $ uvicorn api:app --reload
#
# curl http://127.0.0.1:8000 will return the invalid json
```
and the following
```python
from concurrent.futures import ProcessPoolExecutor
from concurrent.futures.process import BrokenProcessPool
import requests
def my_task():
response = requests.get('http://127.0.0.1:8000/')
response.json()
def my_main_func():
with ProcessPoolExecutor(max_workers=4) as executor:
future = executor.submit(my_task)
for i in range(0, 5):
try:
future.result(timeout=100)
print(f"Attempt {i} ok")
except BrokenProcessPool:
print(f"Attempt {i} - the pool is broken")
except requests.JSONDecodeError:
print(f"Attempt {i} raises a request JSONDecodeError")
if __name__ == '__main__':
my_main_func()
```
Instead of getting the following output:
```
Attempt 0 raises a request JSONDecodeError
Attempt 1 raises a request JSONDecodeError
Attempt 2 raises a request JSONDecodeError
Attempt 3 raises a request JSONDecodeError
Attempt 4 raises a request JSONDecodeError
```
One would currently have:
```
Attempt 0 - the pool is broken
Attempt 1 - the pool is broken
Attempt 2 - the pool is broken
Attempt 3 - the pool is broken
Attempt 4 - the pool is broken
```
An invalid JSON is crashing the entire process pool and no job can be submitted anymore.
## System Information
Tested with:
- request==2.31.0
- Python==3.11.7
-----
Thanks a lot for taking the time to read this long bug report!! | {
"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/6628/reactions"
} | https://api.github.com/repos/psf/requests/issues/6628/timeline | null | completed | null | null | false | [
"As mentioned I've raised https://github.com/psf/requests/pull/6629, hopefully the proposal makes sense."
] |
https://api.github.com/repos/psf/requests/issues/6627 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6627/labels{/name} | https://api.github.com/repos/psf/requests/issues/6627/comments | https://api.github.com/repos/psf/requests/issues/6627/events | https://github.com/psf/requests/issues/6627 | 2,109,144,644 | I_kwDOABTKOs59tv5E | 6,627 | Kenneth Reitz, Take care of yourself. | {
"avatar_url": "https://avatars.githubusercontent.com/u/6748135?v=4",
"events_url": "https://api.github.com/users/hackware1993/events{/privacy}",
"followers_url": "https://api.github.com/users/hackware1993/followers",
"following_url": "https://api.github.com/users/hackware1993/following{/other_user}",
"gists_url": "https://api.github.com/users/hackware1993/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hackware1993",
"id": 6748135,
"login": "hackware1993",
"node_id": "MDQ6VXNlcjY3NDgxMzU=",
"organizations_url": "https://api.github.com/users/hackware1993/orgs",
"received_events_url": "https://api.github.com/users/hackware1993/received_events",
"repos_url": "https://api.github.com/users/hackware1993/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hackware1993/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hackware1993/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hackware1993",
"user_view_type": "public"
} | [] | closed | true | null | [] | null | 1 | 2024-01-31T02:10:27Z | 2024-01-31T02:40:14Z | 2024-01-31T02:16:26Z | NONE | null | I am also the author of a popular open-source library (MagicIndicator, 10K stars). Similarly, I have experienced manic depression (bipolar disorder), but I have overcome it and now lead a normal, positive life. I hope you recover soon too. Keep fighting! | {
"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/6627/reactions"
} | https://api.github.com/repos/psf/requests/issues/6627/timeline | null | completed | null | null | false | [
"Closing this issue as it's not an issue in Requests. Please consider avenues of messaging folks directly, opening GitHub issues pings thousands of unrelated people."
] |
https://api.github.com/repos/psf/requests/issues/6626 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6626/labels{/name} | https://api.github.com/repos/psf/requests/issues/6626/comments | https://api.github.com/repos/psf/requests/issues/6626/events | https://github.com/psf/requests/issues/6626 | 2,104,678,632 | I_kwDOABTKOs59ctjo | 6,626 | Unintended Leak Of Proxy-Authorization Header In Requests | {
"avatar_url": "https://avatars.githubusercontent.com/u/153487192?v=4",
"events_url": "https://api.github.com/users/ankitdn/events{/privacy}",
"followers_url": "https://api.github.com/users/ankitdn/followers",
"following_url": "https://api.github.com/users/ankitdn/following{/other_user}",
"gists_url": "https://api.github.com/users/ankitdn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ankitdn",
"id": 153487192,
"login": "ankitdn",
"node_id": "U_kgDOCSYHWA",
"organizations_url": "https://api.github.com/users/ankitdn/orgs",
"received_events_url": "https://api.github.com/users/ankitdn/received_events",
"repos_url": "https://api.github.com/users/ankitdn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ankitdn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ankitdn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ankitdn",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 0 | 2024-01-29T05:27:01Z | 2024-01-29T12:04:44Z | 2024-01-29T12:04:44Z | NONE | null | **Describe the bug**
While scanning my Django application's manifest file using Vulert for vulnerability checks, I identified an issue associated with your package.
**Reference**
Upon conducting a vulnerability scan, the following references were identified:
Vulert Scan Report: [Vulert Report](https://vulert.com/vuln-scan/list/a1524f3e-61e3-409c-8630-9134c5b84eea)
CVE Reference: [CVE-2023-32681](https://vulert.com/vuln-db/pypi-requests-70669) | {
"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/6626/reactions"
} | https://api.github.com/repos/psf/requests/issues/6626/timeline | null | completed | null | null | false | [] |
https://api.github.com/repos/psf/requests/issues/6625 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6625/labels{/name} | https://api.github.com/repos/psf/requests/issues/6625/comments | https://api.github.com/repos/psf/requests/issues/6625/events | https://github.com/psf/requests/issues/6625 | 2,096,300,901 | I_kwDOABTKOs588wNl | 6,625 | How to get IP address of connected host after getting the response? | {
"avatar_url": "https://avatars.githubusercontent.com/u/7078728?v=4",
"events_url": "https://api.github.com/users/drajvver/events{/privacy}",
"followers_url": "https://api.github.com/users/drajvver/followers",
"following_url": "https://api.github.com/users/drajvver/following{/other_user}",
"gists_url": "https://api.github.com/users/drajvver/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/drajvver",
"id": 7078728,
"login": "drajvver",
"node_id": "MDQ6VXNlcjcwNzg3Mjg=",
"organizations_url": "https://api.github.com/users/drajvver/orgs",
"received_events_url": "https://api.github.com/users/drajvver/received_events",
"repos_url": "https://api.github.com/users/drajvver/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/drajvver/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/drajvver/subscriptions",
"type": "User",
"url": "https://api.github.com/users/drajvver",
"user_view_type": "public"
} | [
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
},
{
"color": "000000",
"default": false,
"description": "Used for automation to auto-close an issue",
"id": 6156042717,
"name": "actions/autoclose-qa",
"node_id": "LA_kwDOABTKOs8AAAABbu3B3Q",
"url": "https://api.github.com/repos/psf/requests/labels/actions/autoclose-qa"
}
] | closed | true | null | [] | null | 1 | 2024-01-23T15:10:15Z | 2024-01-23T15:10:28Z | 2024-01-23T15:10:26Z | NONE | off-topic | Hello,
I'm trying to understand how I could access information about host that the request connected to. I have situation when behind a hostname, there is a multiple IP addresses that you can connect to, so for example `x.com` can route me to `1.2.3.4` or `2.3.4.5`. I need that information after receiving response from requests. I'm using python 3.10 if that matters.
My code is as follows:
```
retry_strategy = Retry(total=1,
backoff_factor=0.5,
status_forcelist=[400, 408, 429, 500, 501, 502, 503, 504],
raise_on_status=False)
self.adapter = HTTPAdapter(max_retries=retry_strategy)
# other, not important code
s = Session()
s.mount('https://', self.adapter)
response = s.get(url, headers=self.headers, stream=True, timeout=60)
```
Where (if anywhere?) should I look for that kind of information? I found something about `response.raw` but the connection there is declared as None. | {
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/github-actions",
"id": 41898282,
"login": "github-actions[bot]",
"node_id": "MDM6Qm90NDE4OTgyODI=",
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
"type": "Bot",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
"user_view_type": "public"
} | {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/6625/reactions"
} | https://api.github.com/repos/psf/requests/issues/6625/timeline | null | completed | null | null | false | [
"As described in the template, we won't be able to answer questions on this issue tracker. Please use [Stack Overflow](https://stackoverflow.com/)"
] |
https://api.github.com/repos/psf/requests/issues/6624 | https://api.github.com/repos/psf/requests | https://api.github.com/repos/psf/requests/issues/6624/labels{/name} | https://api.github.com/repos/psf/requests/issues/6624/comments | https://api.github.com/repos/psf/requests/issues/6624/events | https://github.com/psf/requests/pull/6624 | 2,095,765,349 | PR_kwDOABTKOs5k0dqA | 6,624 | Set verify=True by default as documented | {
"avatar_url": "https://avatars.githubusercontent.com/u/1461970?v=4",
"events_url": "https://api.github.com/users/RichieB2B/events{/privacy}",
"followers_url": "https://api.github.com/users/RichieB2B/followers",
"following_url": "https://api.github.com/users/RichieB2B/following{/other_user}",
"gists_url": "https://api.github.com/users/RichieB2B/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/RichieB2B",
"id": 1461970,
"login": "RichieB2B",
"node_id": "MDQ6VXNlcjE0NjE5NzA=",
"organizations_url": "https://api.github.com/users/RichieB2B/orgs",
"received_events_url": "https://api.github.com/users/RichieB2B/received_events",
"repos_url": "https://api.github.com/users/RichieB2B/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/RichieB2B/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/RichieB2B/subscriptions",
"type": "User",
"url": "https://api.github.com/users/RichieB2B",
"user_view_type": "public"
} | [] | closed | false | null | [] | null | 1 | 2024-01-23T10:34:50Z | 2024-01-23T18:22:42Z | 2024-01-23T14:35:35Z | CONTRIBUTOR | null | The [documentation](https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification) clearly states that the default for `verify` is `True`. Via [merge_environment_settings()](https://github.com/psf/requests/blob/96b22fa18c00831656ee4b286bf1c9062459b00a/src/requests/sessions.py#L766-L771) and [merge_settings()](https://github.com/psf/requests/blob/96b22fa18c00831656ee4b286bf1c9062459b00a/src/requests/sessions.py#L61-L71) the behaviour of `None` is made the same as `True` because `self.verify` is [initialized](https://github.com/psf/requests/blob/96b22fa18c00831656ee4b286bf1c9062459b00a/src/requests/sessions.py#L424) as `True` but this is rather non-intuitive. Let's make the actual default of request() function `True` as per the documentation. | {
"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/6624/reactions"
} | https://api.github.com/repos/psf/requests/issues/6624/timeline | null | null | false | {
"diff_url": "https://github.com/psf/requests/pull/6624.diff",
"html_url": "https://github.com/psf/requests/pull/6624",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/6624.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/6624"
} | true | [
"This is (as far as the library is concerned) semantically incorrect. None here is meant as a (poor) substitute for \"not specified explicitly by user\". Changing this means that the user ostensibly always wants verification on. The tests that are failing show how broken this change is. "
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.