url
stringlengths 50
53
| repository_url
stringclasses 1
value | labels_url
stringlengths 64
67
| comments_url
stringlengths 59
62
| events_url
stringlengths 57
60
| html_url
stringlengths 38
43
| id
int64 597k
2.65B
| node_id
stringlengths 18
32
| number
int64 1
6.83k
| title
stringlengths 1
296
| user
dict | labels
listlengths 0
5
| state
stringclasses 2
values | locked
bool 2
classes | assignee
dict | assignees
listlengths 0
4
| milestone
dict | comments
int64 0
211
| created_at
stringlengths 20
20
| updated_at
stringlengths 20
20
| closed_at
stringlengths 20
20
⌀ | author_association
stringclasses 3
values | active_lock_reason
stringclasses 4
values | body
stringlengths 0
65.6k
⌀ | closed_by
dict | reactions
dict | timeline_url
stringlengths 59
62
| performed_via_github_app
null | state_reason
stringclasses 3
values | draft
bool 2
classes | pull_request
dict | is_pull_request
bool 2
classes | issue_comments
listlengths 0
30
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://api.github.com/repos/psf/requests/issues/5497
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5497/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5497/comments
|
https://api.github.com/repos/psf/requests/issues/5497/events
|
https://github.com/psf/requests/pull/5497
| 639,576,052
|
MDExOlB1bGxSZXF1ZXN0NDM1MTQwNjkz
| 5,497
|
Call url.lower() once inside get_adapter
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1684354?v=4",
"events_url": "https://api.github.com/users/dbaxa/events{/privacy}",
"followers_url": "https://api.github.com/users/dbaxa/followers",
"following_url": "https://api.github.com/users/dbaxa/following{/other_user}",
"gists_url": "https://api.github.com/users/dbaxa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dbaxa",
"id": 1684354,
"login": "dbaxa",
"node_id": "MDQ6VXNlcjE2ODQzNTQ=",
"organizations_url": "https://api.github.com/users/dbaxa/orgs",
"received_events_url": "https://api.github.com/users/dbaxa/received_events",
"repos_url": "https://api.github.com/users/dbaxa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dbaxa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dbaxa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dbaxa",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-06-16T11:05:54Z
|
2021-09-09T05:36:16Z
|
2020-06-16T20:16:41Z
|
CONTRIBUTOR
|
resolved
|
{
"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/5497/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5497/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5497.diff",
"html_url": "https://github.com/psf/requests/pull/5497",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5497.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5497"
}
| true
|
[
"Hi @dbaxa,\r\n\r\nedit: Redacting my first statement, I read over the PR too quickly. I think this is a semi-reasonable optimization, but it's probably not entirely necessary given the number of adapters typically loaded. Given this isn't a high touch point, I'm not sure it's necessary right now. Thanks for the suggestion though!",
"@nateprewitt can we apply this PR then ...?",
"Re: [psf/requests] Call url.lower() once inside get_adapter (#5497)\n\n\n\nOn Thu, Jun 17, 2021, 4:45 PM David Black ***@***.***> wrote:\n\n> @nateprewitt <https://github.com/nateprewitt> can we apply this PR then\n> ...?\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/psf/requests/pull/5497#issuecomment-863629982>, or\n> unsubscribe\n> <https://github.com/notifications/unsubscribe-auth/AUCGM52V3IE5MAJWTE7LQNTTTKCKHANCNFSM4N7QHJTQ>\n> .\n>\n"
] |
|
https://api.github.com/repos/psf/requests/issues/5496
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5496/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5496/comments
|
https://api.github.com/repos/psf/requests/issues/5496/events
|
https://github.com/psf/requests/pull/5496
| 639,569,876
|
MDExOlB1bGxSZXF1ZXN0NDM1MTM1NDUz
| 5,496
|
Avoid an unnecessary computation of the length of data for non-stream requests (which determine content-length based upon body content).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1684354?v=4",
"events_url": "https://api.github.com/users/dbaxa/events{/privacy}",
"followers_url": "https://api.github.com/users/dbaxa/followers",
"following_url": "https://api.github.com/users/dbaxa/following{/other_user}",
"gists_url": "https://api.github.com/users/dbaxa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dbaxa",
"id": 1684354,
"login": "dbaxa",
"node_id": "MDQ6VXNlcjE2ODQzNTQ=",
"organizations_url": "https://api.github.com/users/dbaxa/orgs",
"received_events_url": "https://api.github.com/users/dbaxa/received_events",
"repos_url": "https://api.github.com/users/dbaxa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dbaxa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dbaxa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dbaxa",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2020-06-16T10:55:28Z
|
2021-08-28T00:06:28Z
|
2020-06-17T15:21:38Z
|
CONTRIBUTOR
|
resolved
|
{
"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/5496/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5496/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5496.diff",
"html_url": "https://github.com/psf/requests/pull/5496",
"merged_at": "2020-06-17T15:21:38Z",
"patch_url": "https://github.com/psf/requests/pull/5496.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5496"
}
| true
|
[
"@nateprewitt when profiling requests, it resulted in a reduction in execution time & it makes more sense to me.",
"@dbaxa the net gain of the change is pretty minor and we're just swapping memory usage for speed. Since it's not really part of what the PR was raised for let's consolidate this to just the super_len encapsulation and I think we'll be set.",
"@dbaxa so performance isn't the top concern for Requests. Further, evidence of improvements goes a long way towards convincing others",
"@sigmavirus24 I can provide some evidence / data if desired. To be honest some of the minor optimisations that can be made might not be suitable for requests to take. However, there are certainly *some* areas that requests could do with improvements with/to (e.g. the slowness of the code executed as part of obtaining proxy information inside of an already created session object for each/every generated request. I have a benchmark that shows that for one non-cached request & 9999 cached requests, using cachecontrol, ~10 seconds can be saved by setting `trust_env` to `False`. Although, arguably it should be possible for cachecontrol to be modified to offer a \"fast path\").\r\n\r\nAs an aside, is there a reason to prefer using a tuple instead of a set for the method check (other than the memory usage trade off) ?",
"> To be honest some of the minor optimisations that can be made might not be suitable for requests to take.\r\n\r\nAgreed.\r\n\r\n> I can provide some evidence / data if desired.\r\n\r\nI'm not a maintainer, but in the past PRs with no description of the changes without previously discussing them with the maintainers often feel like \"drive-by\" contributions with no context and no clear value. That makes them easy to dismiss, forget about, or just close outright. I'd find these to be a higher quality if you explained (in a couple sentences or less) how you found the problem, and the rough measured performance improvements (including OS, python versions tested, etc.).\r\n\r\n\r\n\r\n> However, there are certainly _some_ areas that requests could do with improvements with/to (e.g. the slowness of the code executed as part of obtaining proxy information inside of an already created session object for each/every generated request. I have a benchmark that shows that for one non-cached request & 9999 cached requests, using cachecontrol, ~10 seconds can be saved by setting `trust_env` to `False`.\r\n\r\nYes well `trust_env` is likely to stay set to `True for the foreseeable future. I don't recall why we decided it was prudent to reparse every-time but I feel like there was an argument made in that direction when we did it.\r\n\r\n> Although, arguably it should be possible for cachecontrol to be modified to offer a \"fast path\"\r\n\r\nI'm fairly certain cachecontrol is no longer maintained unfortunately\r\n\r\n\r\n> As an aside, is there a reason to prefer using a tuple instead of a set for the method check (other than the memory usage trade off) ?\r\n\r\n:shrug: ",
"> I'm not a maintainer, but in the past PRs with no description of the changes without previously discussing them with the maintainers often feel like \"drive-by\" contributions with no context and no clear value. That makes them easy to dismiss, forget about, or just close outright. I'd find these to be a higher quality if you explained (in a couple sentences or less) how you found the problem, and the rough measured performance improvements (including OS, python versions tested, etc.).\r\n\r\nSure, I'll try to provide some more context in future pull requests.\r\n\r\n> Yes well trust_env is likely to stay set to `True for the foreseeable future. I don't recall why we decided it was prudent to reparse every-time but I feel like there was an argument made in that direction when we did it.\r\n\r\nThat's fine as users who want not to hit the relative slowness encountered by `trust_env` can disable it - however we should also consider seeing what we can do to reduce the time that the code that executes when `trust_env` is enabled takes.\r\n\r\n>I'm fairly certain cachecontrol is no longer maintained unfortunately\r\n\r\nI am not sure. I have also yet to look into raising an improvement/suggestion for @ionrock 's `cachecontrol` to offer the ability to check if a request to a certain url would be cached or not without needing to create a request object (or use a mock request). It would be excellent to be able to make use of the logic that has already been implemented in `cachecontrol` in a way that would let user's have a \"fast path\" to obtaining cached responses/content."
] |
|
https://api.github.com/repos/psf/requests/issues/5495
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5495/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5495/comments
|
https://api.github.com/repos/psf/requests/issues/5495/events
|
https://github.com/psf/requests/pull/5495
| 639,013,166
|
MDExOlB1bGxSZXF1ZXN0NDM0NjcwODg2
| 5,495
|
Update number of dependents on requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13381361?v=4",
"events_url": "https://api.github.com/users/bharatr21/events{/privacy}",
"followers_url": "https://api.github.com/users/bharatr21/followers",
"following_url": "https://api.github.com/users/bharatr21/following{/other_user}",
"gists_url": "https://api.github.com/users/bharatr21/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bharatr21",
"id": 13381361,
"login": "bharatr21",
"node_id": "MDQ6VXNlcjEzMzgxMzYx",
"organizations_url": "https://api.github.com/users/bharatr21/orgs",
"received_events_url": "https://api.github.com/users/bharatr21/received_events",
"repos_url": "https://api.github.com/users/bharatr21/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bharatr21/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bharatr21/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bharatr21",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 0
|
2020-06-15T17:19:00Z
|
2021-08-28T00:06:29Z
|
2020-06-15T19:56:08Z
|
CONTRIBUTOR
|
resolved
|
Update number of repositories depending on 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/5495/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5495/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5495.diff",
"html_url": "https://github.com/psf/requests/pull/5495",
"merged_at": "2020-06-15T19:56:08Z",
"patch_url": "https://github.com/psf/requests/pull/5495.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5495"
}
| true
|
[] |
https://api.github.com/repos/psf/requests/issues/5494
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5494/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5494/comments
|
https://api.github.com/repos/psf/requests/issues/5494/events
|
https://github.com/psf/requests/issues/5494
| 638,884,478
|
MDU6SXNzdWU2Mzg4ODQ0Nzg=
| 5,494
|
POST request to a http:// which receives a HTTP 301 response redirecting to https:// is retried as GET instead
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48946947?v=4",
"events_url": "https://api.github.com/users/sanderland/events{/privacy}",
"followers_url": "https://api.github.com/users/sanderland/followers",
"following_url": "https://api.github.com/users/sanderland/following{/other_user}",
"gists_url": "https://api.github.com/users/sanderland/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sanderland",
"id": 48946947,
"login": "sanderland",
"node_id": "MDQ6VXNlcjQ4OTQ2OTQ3",
"organizations_url": "https://api.github.com/users/sanderland/orgs",
"received_events_url": "https://api.github.com/users/sanderland/received_events",
"repos_url": "https://api.github.com/users/sanderland/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sanderland/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sanderland/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sanderland",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-06-15T14:08:52Z
|
2021-08-30T00:06:24Z
|
2020-07-21T05:55:04Z
|
NONE
|
resolved
|
Summary.
When making a request to our API using POST to http, it responds with HTTP 301, which is considered best practice for upgrading users to https.
However, the requests library responds to this by ignoring the 'location' header and instead retries it using get, resulting in the user getting a very unexpected HTTP 405 invalid method.
## Expected Result
Either return the error 301 directly, or retry to the location specified.
## Actual Result
The HTTP 405 error from the (invalid) GET method is retured.
## Reproduction Steps
```python
from requests import Response, Session
from requests.adapters import HTTPAdapter
key = <api key from https://openindustrialdata.com>
session = Session()
adapter = HTTPAdapter()
session.mount("http://", adapter)
session.mount("https://", adapter)
res = session.request(method='POST',
url='http://api.cognitedata.com/api/v1/projects/publicdata/assets/list',
data='{"limit":25}',
headers={'api-key':key,"content-type":"application/json"})
print(res.request.method, res.status_code)
```
The result of running this is GET 405
## Source of the error
The relevant code is in sessions.py refering to issue #1704 is:
```
# Second, if a POST is responded to with a 301, turn it into a GET.
# This bizarre behaviour is explained in Issue 1704.
if response.status_code == codes.moved and method == 'POST':
method = 'GET'
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.6.1"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.3"
},
"platform": {
"release": "5.3.0-59-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010102f",
"version": "19.0.0"
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010102f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5494/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5494/timeline
| null |
completed
| null | null | false
|
[
"This is not a bug. All guidance around this is to not resend data or authentication (or the same method) when being redirected to a different scheme and authority. This is the correct and secure behaviour for this case.",
"> This is not a bug. All guidance around this is to not resend data or authentication (or the same method) when being redirected to a different scheme and authority. This is the correct and secure behaviour for this case.\r\n\r\nWhere is this supposed guidance for doing a **GET** request to a **HTTP** endpoint after being told that the POST request to a HTTP endpoint should go to HTTPS instead?",
"Hi @sanderland, this is standard practice for a lot of web tools and most browsers. The behavior is defined in [RFC 7231 § 6.4.2](https://tools.ietf.org/html/rfc7231#section-6.4.2).\r\n\r\nThere are a few previous issues like this one https://github.com/psf/requests/issues/3107#issuecomment-212296468 with context. Outside of a 307/308 redirect (which we respect), this is the expected behavior. If the web server MUST support this, they need to use the correct status code.",
"Thanks for the responses, I've raised the issue and we'll try to avoid using 301.\r\nNevertheless I found it hard to find out that the redirect was happening at all, a richer repr or something could make it clearer that a redirect happened.",
"@sanderland the quickstart has a whole section on redirection: https://requests.readthedocs.io/en/master/user/quickstart/#redirection-and-history\r\n\r\nI'm not sure why you found it hard to find that a redirect happened, but those docs should make it clearer how to do so correctly going forward. "
] |
https://api.github.com/repos/psf/requests/issues/5493
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5493/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5493/comments
|
https://api.github.com/repos/psf/requests/issues/5493/events
|
https://github.com/psf/requests/issues/5493
| 638,736,030
|
MDU6SXNzdWU2Mzg3MzYwMzA=
| 5,493
|
Instacrack termux bruteforce
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/66874656?v=4",
"events_url": "https://api.github.com/users/gehanshanaka/events{/privacy}",
"followers_url": "https://api.github.com/users/gehanshanaka/followers",
"following_url": "https://api.github.com/users/gehanshanaka/following{/other_user}",
"gists_url": "https://api.github.com/users/gehanshanaka/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gehanshanaka",
"id": 66874656,
"login": "gehanshanaka",
"node_id": "MDQ6VXNlcjY2ODc0NjU2",
"organizations_url": "https://api.github.com/users/gehanshanaka/orgs",
"received_events_url": "https://api.github.com/users/gehanshanaka/received_events",
"repos_url": "https://api.github.com/users/gehanshanaka/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gehanshanaka/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gehanshanaka/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gehanshanaka",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-06-15T10:27:04Z
|
2021-08-31T00:06:52Z
|
2020-06-15T14:47:46Z
|
NONE
|
resolved
|
Traceback (most recent call last):
File "crack.py", line 108, in <module> sess = instabrute.Login(password)
File "crack.py", line 83, in Login sess.headers.update({'X-CSRFToken' : r.cookies.get_dict()['csrftoken']})
KeyError: 'csrftoken'
|
{
"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/5493/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5493/timeline
| null |
completed
| null | null | false
|
[
"Any solution to fix this error",
"Don't access a key that isn't in the dictionary? There's no bug in this library based off of what very little information you've provided",
"> Don't access a key that isn't in the dictionary? There's no bug in this library based off of what very little information you've provided\r\n\r\nAny code for this error",
"Cupp.py\r\n",
"Hi @gehanshanaka, as Sigmavirus24 pointed out, the cookie your code is looking for doesn't exist in this case. This isn't a defect in Requests from what you've provided. You'll need to update the referenced code to be more fault tolerant."
] |
https://api.github.com/repos/psf/requests/issues/5492
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5492/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5492/comments
|
https://api.github.com/repos/psf/requests/issues/5492/events
|
https://github.com/psf/requests/pull/5492
| 638,727,503
|
MDExOlB1bGxSZXF1ZXN0NDM0NDM1OTgy
| 5,492
|
Remove what appears to be an un-needed call to self.resolve_redirects when not following redirects as part of creating a request's history.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1684354?v=4",
"events_url": "https://api.github.com/users/dbaxa/events{/privacy}",
"followers_url": "https://api.github.com/users/dbaxa/followers",
"following_url": "https://api.github.com/users/dbaxa/following{/other_user}",
"gists_url": "https://api.github.com/users/dbaxa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dbaxa",
"id": 1684354,
"login": "dbaxa",
"node_id": "MDQ6VXNlcjE2ODQzNTQ=",
"organizations_url": "https://api.github.com/users/dbaxa/orgs",
"received_events_url": "https://api.github.com/users/dbaxa/received_events",
"repos_url": "https://api.github.com/users/dbaxa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dbaxa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dbaxa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dbaxa",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-06-15T10:15:28Z
|
2021-08-28T00:06:30Z
|
2020-06-15T14:44:38Z
|
CONTRIBUTOR
|
resolved
|
{
"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/5492/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5492/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5492.diff",
"html_url": "https://github.com/psf/requests/pull/5492",
"merged_at": "2020-06-15T14:44:38Z",
"patch_url": "https://github.com/psf/requests/pull/5492.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5492"
}
| true
|
[
"At one point, `resolve_redirects` used to bail early if we weren't following redirects but I guess that changed. Now if there's a redirect to follow, we make the request but we don't use that response which is pretty bad.\r\n\r\nGood catch. @nateprewitt @sethmlarson this PR looks good",
"@sigmavirus24 let me know if you want me to fix up the source branch name and or commit message :-) .",
"I'm not a maintainer so not my call. 🙂"
] |
|
https://api.github.com/repos/psf/requests/issues/5491
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5491/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5491/comments
|
https://api.github.com/repos/psf/requests/issues/5491/events
|
https://github.com/psf/requests/pull/5491
| 638,164,915
|
MDExOlB1bGxSZXF1ZXN0NDM0MDA4Mzk2
| 5,491
|
Prefer Transfer-Encoding=chunked even if both Transfer-Encoding and Content-Length are set
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/166626?v=4",
"events_url": "https://api.github.com/users/ikalnytskyi/events{/privacy}",
"followers_url": "https://api.github.com/users/ikalnytskyi/followers",
"following_url": "https://api.github.com/users/ikalnytskyi/following{/other_user}",
"gists_url": "https://api.github.com/users/ikalnytskyi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ikalnytskyi",
"id": 166626,
"login": "ikalnytskyi",
"node_id": "MDQ6VXNlcjE2NjYyNg==",
"organizations_url": "https://api.github.com/users/ikalnytskyi/orgs",
"received_events_url": "https://api.github.com/users/ikalnytskyi/received_events",
"repos_url": "https://api.github.com/users/ikalnytskyi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ikalnytskyi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ikalnytskyi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ikalnytskyi",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-06-13T13:46:25Z
|
2021-08-28T00:06:20Z
|
2020-09-16T00:38:51Z
|
NONE
|
resolved
|
RFC 7230 says (see section [3.3.3 Message Body Length](https://tools.ietf.org/html/rfc7230#page-32)):
> If a message is received with both a `Transfer-Encoding` and a `Content-Length` header field, the `Transfer-Encoding` overrides the `Content-Length`.
Since HTTP servers MUST ignore `Content-Length` if `Transfer-Encoding` is sent, **python-requests** MUST follow the same logic and send payload using `chunked` approach if both are detected in among request headers.
Normally, `Content-Length` MUST NOT be sent in the same request with `Trasnfer-Encoding`, however, it may happened both intentionally (e.g. malicious intent) and accidentally (e.g. proxying a request downstream).
|
{
"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/5491/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5491/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5491.diff",
"html_url": "https://github.com/psf/requests/pull/5491",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5491.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5491"
}
| true
|
[
"Hi @ikalnytskyi, this was actually addressed in our 3.0.0 proposal branch with #3897. Instead of guessing, we would have explicitly prohibited the user from sending both. They need to make an explicit decision before the client will perform the request.\r\n\r\nThat said, it's unlikely this code will end up released anytime in the near future if ever. We're unable to make the change in a 2.x release due to it being breaking for existing users. In the event we ever release 3.0.0, we'll likely stick with the already merged PR. Thanks for the contribution though.",
"Hi @nateprewitt,\r\n\r\nThanks for stopping by and checking this.\r\n\r\n> We're unable to make the change in a 2.x release due to it being breaking for existing users.\r\n\r\nCan you please elaborate how it will break existing users? Whoever hit this bug is already broken. Receiving part does not understand what `requests` sends. That's how I found this in the first place: neither nginx nor uwsgi nor gunicorn are able to understand what was sent since once they see `Transfer-Encoding: chunked` they expect chunked data.\r\n\r\nI still think something should be done. If you don't like respecting `Transfer-Encoding: chunked` supplied by user, can we consider resetting its value before sending out a request? \r\n\r\n> In the event we ever release 3.0.0, we'll likely stick with the already merged PR. \r\n\r\nI agree that explicit approach is better then *guessing*. It's just we already have *guessing* in 2.x, and the *guess* condition is wrong."
] |
https://api.github.com/repos/psf/requests/issues/5490
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5490/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5490/comments
|
https://api.github.com/repos/psf/requests/issues/5490/events
|
https://github.com/psf/requests/issues/5490
| 637,670,824
|
MDU6SXNzdWU2Mzc2NzA4MjQ=
| 5,490
|
Open a stream from POST request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/34455993?v=4",
"events_url": "https://api.github.com/users/andreafresa/events{/privacy}",
"followers_url": "https://api.github.com/users/andreafresa/followers",
"following_url": "https://api.github.com/users/andreafresa/following{/other_user}",
"gists_url": "https://api.github.com/users/andreafresa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andreafresa",
"id": 34455993,
"login": "andreafresa",
"node_id": "MDQ6VXNlcjM0NDU1OTkz",
"organizations_url": "https://api.github.com/users/andreafresa/orgs",
"received_events_url": "https://api.github.com/users/andreafresa/received_events",
"repos_url": "https://api.github.com/users/andreafresa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andreafresa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andreafresa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andreafresa",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-06-12T11:00:28Z
|
2021-08-31T00:06:52Z
|
2020-06-15T14:47:56Z
|
NONE
|
resolved
|
Hello,
I am trying to open a stream from a POST request. The idea is to open the stream and to attach the response to an SSE client.
is this the correct way to do it?
`response= requests.post(url_request , stream= True)`
If it is true, why it seems like the client is closing the socket at a certain point?
|
{
"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/5490/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5490/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here."
] |
https://api.github.com/repos/psf/requests/issues/5489
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5489/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5489/comments
|
https://api.github.com/repos/psf/requests/issues/5489/events
|
https://github.com/psf/requests/issues/5489
| 637,324,721
|
MDU6SXNzdWU2MzczMjQ3MjE=
| 5,489
|
When redirected request header dictionary contains previous value of cookie
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4713622?v=4",
"events_url": "https://api.github.com/users/asifmallik/events{/privacy}",
"followers_url": "https://api.github.com/users/asifmallik/followers",
"following_url": "https://api.github.com/users/asifmallik/following{/other_user}",
"gists_url": "https://api.github.com/users/asifmallik/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/asifmallik",
"id": 4713622,
"login": "asifmallik",
"node_id": "MDQ6VXNlcjQ3MTM2MjI=",
"organizations_url": "https://api.github.com/users/asifmallik/orgs",
"received_events_url": "https://api.github.com/users/asifmallik/received_events",
"repos_url": "https://api.github.com/users/asifmallik/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/asifmallik/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/asifmallik/subscriptions",
"type": "User",
"url": "https://api.github.com/users/asifmallik",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2020-06-11T21:17:32Z
|
2021-08-31T00:06:52Z
|
2020-06-12T12:09:15Z
|
NONE
|
resolved
|
When you send a request which replaces an existing cookie value with a new one and also returns a redirect response, when the new request is made, its request header from `r.request.headers['Cookies']` shows both the old and the new cookie value. However, the actual request header only contains the new cookie value.
## Expected Result
What would be expected is that `r.request.headers['Cookies']` would only have the new replaced cookie value rather than the old
## Actual Result
Its request header from `r.request.headers['Cookies']` shows both the old and the new cookie value
## Reproduction Steps
```
python
import requests
r = requests.get('http://httpbin.org/cookies/set?FOO=BAZ', cookies={'FOO': 'BAR'})
print(r.json()) #{'cookies': {'FOO': 'BAZ'}}
print(r.request.headers['Cookie']) # FOO=BAR; FOO=BAZ
```
From what I understand, the latter should be just `FOO=BAZ` as I believe it should only reflect the request headers from the final request. I think what is going on is that the cookies from the previous requests are merged into this.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.6.9"
},
"platform": {
"release": "5.3.0-59-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010100f"
},
"urllib3": {
"version": "1.25.9"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4713622?v=4",
"events_url": "https://api.github.com/users/asifmallik/events{/privacy}",
"followers_url": "https://api.github.com/users/asifmallik/followers",
"following_url": "https://api.github.com/users/asifmallik/following{/other_user}",
"gists_url": "https://api.github.com/users/asifmallik/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/asifmallik",
"id": 4713622,
"login": "asifmallik",
"node_id": "MDQ6VXNlcjQ3MTM2MjI=",
"organizations_url": "https://api.github.com/users/asifmallik/orgs",
"received_events_url": "https://api.github.com/users/asifmallik/received_events",
"repos_url": "https://api.github.com/users/asifmallik/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/asifmallik/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/asifmallik/subscriptions",
"type": "User",
"url": "https://api.github.com/users/asifmallik",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5489/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5489/timeline
| null |
completed
| null | null | false
|
[
"The bug was originally found in [issue 662 from httpie](https://github.com/jakubroztocil/httpie/issues/662)",
"> When you send a request which replaces an existing cookie value with a new one and also returns a redirect response, when the new request is made, its request header from r.request.headers['Cookies'] shows both the old and the new cookie value. However, the actual request header only contains the new cookie value.\r\n\r\nThe initial cookie you specify with `cookies` isn't specified with a domain because you're not setting up and using a cookiejar appropriately.\r\n\r\nFurther, a cookie can be set with multiple values and that's totally allowed by the HTTP specification. See also https://stackoverflow.com/questions/5621775/cookie-is-set-twice-how-to-remove-the-duplicate\r\n\r\nFinally, HTTPBin is decent enough for quick reproductions but doesn't return cookies in the response correctly and is not a valid proof of a bug in this case, nor that the behaviour you're asserting to be correct is the way HTTP behaves in reality.",
"@sigmavirus24 thank you, I will look into those and see whether this still qualifies as a bug",
"@asifmallik try:\r\n\r\n```py\r\nimport requests\r\n\r\ns = requests.Session()\r\nr1 = s.get('http://httpbin.org/cookies/set?FOO=BAZ')\r\nr2 = s.get('http://httpbin.org/cookies/set?FOO=BAR')\r\n```\r\n\r\nAnd inspect the requests and responses to get a better understanding of how this works in a real scenario",
"@sigmavirus24 after trying that, this seems to arise from not using domain-specific cookies, the result when `Session` is used seems consistent. I will close this for now and see where the original bug comes. Thank you!",
"The cookies parameter should be avoided if you want the best cookie experience is the gist. But also even that behavior isn't against the specification"
] |
https://api.github.com/repos/psf/requests/issues/5488
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5488/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5488/comments
|
https://api.github.com/repos/psf/requests/issues/5488/events
|
https://github.com/psf/requests/pull/5488
| 637,020,419
|
MDExOlB1bGxSZXF1ZXN0NDMzMDgyOTI0
| 5,488
|
Allow further configuration of HTTPAdapter's PoolManager by passing pool_kwargs dict
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1549648?v=4",
"events_url": "https://api.github.com/users/dtheodor/events{/privacy}",
"followers_url": "https://api.github.com/users/dtheodor/followers",
"following_url": "https://api.github.com/users/dtheodor/following{/other_user}",
"gists_url": "https://api.github.com/users/dtheodor/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dtheodor",
"id": 1549648,
"login": "dtheodor",
"node_id": "MDQ6VXNlcjE1NDk2NDg=",
"organizations_url": "https://api.github.com/users/dtheodor/orgs",
"received_events_url": "https://api.github.com/users/dtheodor/received_events",
"repos_url": "https://api.github.com/users/dtheodor/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dtheodor/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dtheodor/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dtheodor",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-06-11T13:34:20Z
|
2021-08-28T00:06:26Z
|
2020-07-21T06:18:59Z
|
NONE
|
resolved
|
There are various useful configurations of underlying urllib3 PoolManager not supported by the existing HTTPAdapter, such as a global timeout, source_address, and many more https://github.com/urllib3/urllib3/blob/29b214a129883301f91ae4a74fd7ef2958cbf7b0/src/urllib3/poolmanager.py#L49-L75
It is trivial to support them directly. The construction of the HTTPAdapter's poolmanager at `HTTPAdapter.init_poolmanager(..., **pool_kwargs)` already contains this provision as the arbitrary `pool_kwargs` dict that is passed to the PoolManager constructor. All it takes is to also add this to the HTTPAdapter constructor, and pass it.
It also appears that this was the original intention that was somehow forgotten; this `**pool_kwargs` argument is not being passed by any caller of `init_poolmanager()`.
|
{
"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/5488/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5488/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5488.diff",
"html_url": "https://github.com/psf/requests/pull/5488",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5488.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5488"
}
| true
|
[
"This project isn't accepting new features. You can easily accomplish this by calling `init_poolmanager()` after creating your `HTTPAdapter` instance. It will replace the previous poolmanger with your newly configured poolmanager. Is it extra work? Yes. Does it get you where you need this pull request to merge to achieve your deepest darkest pool configuration dreams? No.",
"I'm inclined to agree with Sigmavirus24 on this one. This is increasing surface area on a more or less frozen API for the adapters and is pretty trivial to configure with `init_poolmanager`. I think we'll pass on this, but thanks for the proposal!"
] |
https://api.github.com/repos/psf/requests/issues/5487
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5487/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5487/comments
|
https://api.github.com/repos/psf/requests/issues/5487/events
|
https://github.com/psf/requests/issues/5487
| 636,938,063
|
MDU6SXNzdWU2MzY5MzgwNjM=
| 5,487
|
I need execute : curl -d "a=A&b=B&c=C1,C2",what should i do if use requests?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/14362799?v=4",
"events_url": "https://api.github.com/users/Hanfee/events{/privacy}",
"followers_url": "https://api.github.com/users/Hanfee/followers",
"following_url": "https://api.github.com/users/Hanfee/following{/other_user}",
"gists_url": "https://api.github.com/users/Hanfee/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Hanfee",
"id": 14362799,
"login": "Hanfee",
"node_id": "MDQ6VXNlcjE0MzYyNzk5",
"organizations_url": "https://api.github.com/users/Hanfee/orgs",
"received_events_url": "https://api.github.com/users/Hanfee/received_events",
"repos_url": "https://api.github.com/users/Hanfee/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Hanfee/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Hanfee/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Hanfee",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-06-11T11:28:21Z
|
2021-08-31T00:06:51Z
|
2020-06-15T14:48:05Z
|
NONE
|
resolved
|
Please refer to our [Stack Overflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance.
|
{
"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/5487/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5487/timeline
| null |
completed
| null | null | false
|
[
"Read your own issue description to find out how"
] |
https://api.github.com/repos/psf/requests/issues/5486
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5486/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5486/comments
|
https://api.github.com/repos/psf/requests/issues/5486/events
|
https://github.com/psf/requests/pull/5486
| 636,196,928
|
MDExOlB1bGxSZXF1ZXN0NDMyNDE0NzA3
| 5,486
|
Allow for autodection of encoding for scalar values
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22727090?v=4",
"events_url": "https://api.github.com/users/blenq/events{/privacy}",
"followers_url": "https://api.github.com/users/blenq/followers",
"following_url": "https://api.github.com/users/blenq/following{/other_user}",
"gists_url": "https://api.github.com/users/blenq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/blenq",
"id": 22727090,
"login": "blenq",
"node_id": "MDQ6VXNlcjIyNzI3MDkw",
"organizations_url": "https://api.github.com/users/blenq/orgs",
"received_events_url": "https://api.github.com/users/blenq/received_events",
"repos_url": "https://api.github.com/users/blenq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/blenq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/blenq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/blenq",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] | null | 0
|
2020-06-10T12:15:13Z
|
2022-01-03T15:26:36Z
| null |
NONE
| null |
Since JSON RFC 7158 (and also in 7159 and 8259) scalar values are also valid JSON texts. The json decoder from the Python standard libs also accepts such scalar values.
The JSON Unicode detection algorithm in "requests" assumes that the first two characters are always ASCII. That is not true anymore.
Therefore the current detection fails in at least these two edge cases
- A single digit in UTF-16 encoding
- A quoted string with the first character having a Unicode value higher than 255 in UTF-16 encoding
Also autodetection by chardet returns the wrong encoding.
This change detects the encoding in case of those two edge cases.
| 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/5486/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5486/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5486.diff",
"html_url": "https://github.com/psf/requests/pull/5486",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5486.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5486"
}
| true
|
[] |
https://api.github.com/repos/psf/requests/issues/5485
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5485/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5485/comments
|
https://api.github.com/repos/psf/requests/issues/5485/events
|
https://github.com/psf/requests/issues/5485
| 635,379,859
|
MDU6SXNzdWU2MzUzNzk4NTk=
| 5,485
|
Newly created Response object fails on boolean test
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2500830?v=4",
"events_url": "https://api.github.com/users/rtatishvili/events{/privacy}",
"followers_url": "https://api.github.com/users/rtatishvili/followers",
"following_url": "https://api.github.com/users/rtatishvili/following{/other_user}",
"gists_url": "https://api.github.com/users/rtatishvili/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rtatishvili",
"id": 2500830,
"login": "rtatishvili",
"node_id": "MDQ6VXNlcjI1MDA4MzA=",
"organizations_url": "https://api.github.com/users/rtatishvili/orgs",
"received_events_url": "https://api.github.com/users/rtatishvili/received_events",
"repos_url": "https://api.github.com/users/rtatishvili/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rtatishvili/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rtatishvili/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rtatishvili",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-06-09T12:17:47Z
|
2021-08-31T00:06:49Z
|
2020-06-15T15:03:10Z
|
NONE
|
resolved
|
A newly created `Response` object fails boolean test in if statement (when under the hood `__bool__` method is called). Based on conventions used in Python, I expect an empty response object to be resolved to `False`. Although it is a design decision to which value to resolve, throwing an exception in this trivial case is unexpected behavior.
## Expected Result
```
2.23.0
Response is empty
```
## Actual Result
```
2.23.0
Traceback (most recent call last):
File ".../local/reqeusts_error.py", line 6, in <module>
if not response:
File "/opt/miniconda/lib/python3.6/site-packages/requests/models.py", line 677, in __bool__
return self.ok
File "/opt/miniconda/lib/python3.6/site-packages/requests/models.py", line 703, in ok
self.raise_for_status()
File "/opt/miniconda/lib/python3.6/site-packages/requests/models.py", line 934, in raise_for_status
if 400 <= self.status_code < 500:
TypeError: '<=' not supported between instances of 'int' and 'NoneType'
Process finished with exit code 1
```
## Reproduction Steps
```python
import requests
print(requests.__version__)
response = requests.Response()
if not response:
print('Response is empty')
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.3.1"
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.6.0"
},
"platform": {
"release": "3.10.0-957.21.3.el7.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1000210f",
"version": "18.0.0"
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1000215f"
},
"urllib3": {
"version": "1.25.8"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5485/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5485/timeline
| null |
completed
| null | null | false
|
[
"No one uses the library this way in reality, so there's no harm in this behaviour",
"I agree with @sigmavirus24. Status code, headers, and some representation of a body (empty or otherwise) are all required parameters to successfully generate a Response in Requests. I don't think it's worth the time or verbosity to harden the code base against every possible mock when the state isn't reachable in production."
] |
https://api.github.com/repos/psf/requests/issues/5484
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5484/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5484/comments
|
https://api.github.com/repos/psf/requests/issues/5484/events
|
https://github.com/psf/requests/issues/5484
| 634,700,106
|
MDU6SXNzdWU2MzQ3MDAxMDY=
| 5,484
|
"407 Proxy Authentication Required" although it was provided in the request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/54762742?v=4",
"events_url": "https://api.github.com/users/raffaem/events{/privacy}",
"followers_url": "https://api.github.com/users/raffaem/followers",
"following_url": "https://api.github.com/users/raffaem/following{/other_user}",
"gists_url": "https://api.github.com/users/raffaem/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/raffaem",
"id": 54762742,
"login": "raffaem",
"node_id": "MDQ6VXNlcjU0NzYyNzQy",
"organizations_url": "https://api.github.com/users/raffaem/orgs",
"received_events_url": "https://api.github.com/users/raffaem/received_events",
"repos_url": "https://api.github.com/users/raffaem/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/raffaem/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/raffaem/subscriptions",
"type": "User",
"url": "https://api.github.com/users/raffaem",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-06-08T15:02:33Z
|
2021-08-31T00:06:51Z
|
2020-06-15T14:48:17Z
|
NONE
|
resolved
|
I tried to run the following code
import requests
```
s = requests.Session()
s.trust_env = False
url="https://api.elsevier.com/content/abstract/scopus_id/85082366258"
headers={'X-ELS-APIKey': 'MY_API_KEY',
'Accept': 'application/json',
'User-Agent': 'pybliometrics-v2.5.0'}
proxies={'https': 'https://USERNAME:PASSWORD@proxy.thing.com:8080/'}
params={'view': 'META_ABS'}
resp = s.get(url, headers=headers, proxies=proxies, params=params)
print(resp.text)
```
But I get the following error message:
`requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.elsevier.com', port=443): Max retries exceeded with url: /content/abstract/scopus_id/85082366258?view=META_ABS (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))`
My username and password are correct and don't contain any special characters, only alphanumeric ones.
What is going wrong?
|
{
"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/5484/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5484/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.",
"Hello\r\n\r\n@sigmavirus24 There was a button which said \"Ask for help\" or something like that when I reported the issue",
"If you had read the template, you'd see the it points you to stack overflow as well. https://www.github.com/psf/requests/tree/master/.github%2FISSUE_TEMPLATE%2FCustom.md"
] |
https://api.github.com/repos/psf/requests/issues/5483
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5483/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5483/comments
|
https://api.github.com/repos/psf/requests/issues/5483/events
|
https://github.com/psf/requests/issues/5483
| 634,524,019
|
MDU6SXNzdWU2MzQ1MjQwMTk=
| 5,483
|
One server fails ping -Max retries exceeded with url: /wsman (Caused by SSLError(SSLError(\"bad handshake: SysCallError(104, 'ECONNRESET')
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/66622032?v=4",
"events_url": "https://api.github.com/users/ruttrow/events{/privacy}",
"followers_url": "https://api.github.com/users/ruttrow/followers",
"following_url": "https://api.github.com/users/ruttrow/following{/other_user}",
"gists_url": "https://api.github.com/users/ruttrow/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ruttrow",
"id": 66622032,
"login": "ruttrow",
"node_id": "MDQ6VXNlcjY2NjIyMDMy",
"organizations_url": "https://api.github.com/users/ruttrow/orgs",
"received_events_url": "https://api.github.com/users/ruttrow/received_events",
"repos_url": "https://api.github.com/users/ruttrow/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ruttrow/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ruttrow/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ruttrow",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-06-08T11:22:58Z
|
2021-08-31T00:06:50Z
|
2020-06-15T14:48:53Z
|
NONE
|
resolved
|
New to Ansible, having trouble with one server failing ping:
"msg": "kerberos: HTTPSConnectionPool(host='xxxxxl', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLError(\"bad handshake: SysCallError(104, 'ECONNRESET')\",),)), ssl: HTTPSConnectionPool(host='xxxx', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLError(\"bad handshake: SysCallError(104, 'ECONNRESET')\",),))",
"unreachable": true,
"changed": false,
"skip_reason": "Host xxxx is unreachable"
}
I replaced host name with xxxx
We have several hundred servers, this is the only one giving this error.
I tried running the ConfigureRemotingForAnsible.ps1
Verified network settings
I can telnet to the host on port 5986 from another server
Verified IIScrypto has not disabled SSL's or TLS.
ran command - winrm e winrm/config/listener
which shows listener running on 5986
I am unable to open the URL of the server on port 5986
|
{
"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/5483/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5483/timeline
| null |
completed
| null | null | false
|
[
"There is no bug here. The server or an intermediary is resetting the connection during the TLS handshake.\r\n\r\n> I am unable to open the URL of the server on port 5986\r\n\r\nThis is unclear if you mean you're generally unable to open it (i.e., in a browser, curl, or requests) or if you're only unable to open it with Requests. Either way, the TLS configuration (besides on/off) could be a problem and you should know what version of requests/urllib3 you're using. ",
"We do ping sweeps on our servers. One server in question is part of a group that fails the ping test, the code above is the output.",
"> We do ping sweeps on our servers. One server in question is part of a group that fails the ping test, the code above is the output.\r\n\r\nThat doesn't answer anything and doesn't negate that there is no bug here. The server is resetting the connection during the TLS handshake",
"The server's clock it set to UTC, which shows four hours in the future than Eastern Time Zone. The above issue does not occur when Eastern is set. So this appears to be either a bug, or Anisble does not like the time difference.",
"> The server's clock it set to UTC, which shows four hours in the future than Eastern Time Zone. The above issue does not occur when Eastern is set. So this appears to be either a bug, or Anisble does not like the time difference.\r\n\r\nThis really isn't appropriate for this project. You've given no evidence as to the fact that there's a bug in Requests. And now you're involving at least 1400 people in your stream of consciousness debugging. It's really not what those people are likely watching the project for. Please debug this with StackOverflow or the Ansible community. This isn't a Requests issue"
] |
https://api.github.com/repos/psf/requests/issues/5482
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5482/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5482/comments
|
https://api.github.com/repos/psf/requests/issues/5482/events
|
https://github.com/psf/requests/issues/5482
| 634,282,483
|
MDU6SXNzdWU2MzQyODI0ODM=
| 5,482
|
response.status_code==200 when Bean is not found and status=404
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45629047?v=4",
"events_url": "https://api.github.com/users/ovierlinck/events{/privacy}",
"followers_url": "https://api.github.com/users/ovierlinck/followers",
"following_url": "https://api.github.com/users/ovierlinck/following{/other_user}",
"gists_url": "https://api.github.com/users/ovierlinck/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ovierlinck",
"id": 45629047,
"login": "ovierlinck",
"node_id": "MDQ6VXNlcjQ1NjI5MDQ3",
"organizations_url": "https://api.github.com/users/ovierlinck/orgs",
"received_events_url": "https://api.github.com/users/ovierlinck/received_events",
"repos_url": "https://api.github.com/users/ovierlinck/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ovierlinck/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ovierlinck/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ovierlinck",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2020-06-08T07:21:26Z
|
2021-08-31T00:06:53Z
|
2020-06-11T07:45:03Z
|
NONE
|
resolved
|
I experience some strange behavior about response.status_code.
If I do an invalid request (in this sample case, I put on purpose an incorrect Bean name), I still get response.status_code=200 while I expect some error code (such as 404)
Even more strange, in the JSON, there is indeed a status:404 (see sample code and outputs below)
## Expected Result
status should be 404 in such case
## Actual Result
I got a status==200, meaning 'no error'
## Reproduction Steps
How is it that this JSON info does not get to the response.status_code?
Here is the sample code:
req = baseUrl + "/exec/bean:name=AnInvalidBean/send([D,boolean,boolean)/1,2,3,4,0.5,0.6,13,10/True/True”
response = self.GET(req, 10)
test.log(" RESPONSE = " + str(response))
test.log(" JSON: " + str(response.json()))
test.log(" response.status_code: " + str(response.status_code))
test.log(" response.json().get(\"status\"): " + str(response.json().get("status")))
test.log(" response.ok: " + str(response.ok))
test.log(" response as a boolean: " + str(True if response else False))
And the corresponding log (re-formatted for readability):
REQUEST : http://127.0.0.1:5555/jolokia/exec/bean:name=NONExistingBean/send([D,boolean,boolean)/1,2,3,4,0.5,0.6,13,10/True/True
RESPONSE = <Response [200]>
JSON: {
'request':
{
'mbean': 'bean:name=NONExistingBean',
'arguments': ['1,2,3,4,0.5,0.6,13,10', 'True', 'True'],
'type': 'exec',
'operation': 'send([D,boolean,boolean)'
},
'stacktrace': 'javax.management.InstanceNotFoundException: bean:name=NONExistingBean\r\n\tat […TRUNCATED…] at java.base/java.lang.Thread.run(Thread.java:834)\r\n',
'error_type': 'javax.management.InstanceNotFoundException',
'error': 'javax.management.InstanceNotFoundException : bean:name=UsddderPositionSenderPanelTestFacade',
'status': 404
}
response.status_code: 200
response.json().get("status"): 404
response.ok: True
response as a boolean: True
How can we get these 2 ‘conflicting’ lines:
response.status_code: 200
response.json().get("status"): 404
How is it that despite the 'status': 404, the ‘stacktrace’ and ‘error’, I still get status_code: 200?
I’m using requests 2.22.0
## System Information
python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.4"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.22.0"
},
"system_ssl": {
"version": "1010103f"
},
"urllib3": {
"version": "1.25.8"
},
"using_pyopenssl": false
}
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45629047?v=4",
"events_url": "https://api.github.com/users/ovierlinck/events{/privacy}",
"followers_url": "https://api.github.com/users/ovierlinck/followers",
"following_url": "https://api.github.com/users/ovierlinck/following{/other_user}",
"gists_url": "https://api.github.com/users/ovierlinck/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ovierlinck",
"id": 45629047,
"login": "ovierlinck",
"node_id": "MDQ6VXNlcjQ1NjI5MDQ3",
"organizations_url": "https://api.github.com/users/ovierlinck/orgs",
"received_events_url": "https://api.github.com/users/ovierlinck/received_events",
"repos_url": "https://api.github.com/users/ovierlinck/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ovierlinck/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ovierlinck/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ovierlinck",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5482/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5482/timeline
| null |
completed
| null | null | false
|
[
"> How is it that despite the 'status': 404, the ‘stacktrace’ and ‘error’, I still get status_code: 200?\r\n\r\nYou're not actually setting the status of the response in the server but returning the 404 as part of the data. You need to read something that explains how HTTP works because there is no bug in this project. ",
"I don't think this is a problem with `requests`, however, it is a problem with the response given by the server due to it not actually returning a 404 HTTP response code. Read the docs of whatever webserver you are using.",
"Thanks you both for the hint. We don't write the server, we use Jolokia and indeed they make the difference between the HTTP level error code and the actual processing of the request.\r\nThis is even in their doc: https://jolokia.org/reference/html/protocol.html\r\nSorry for the annoyance and thanks for the great tool.",
"@ovierlinck no worries!"
] |
https://api.github.com/repos/psf/requests/issues/5481
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5481/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5481/comments
|
https://api.github.com/repos/psf/requests/issues/5481/events
|
https://github.com/psf/requests/pull/5481
| 633,604,612
|
MDExOlB1bGxSZXF1ZXN0NDMwMjM4MjQ3
| 5,481
|
Replace deprecated `setup.py test` with tox entry point
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"user_view_type": "public"
}
|
[
{
"color": "e102d8",
"default": false,
"description": null,
"id": 117745,
"name": "Planned",
"node_id": "MDU6TGFiZWwxMTc3NDU=",
"url": "https://api.github.com/repos/psf/requests/labels/Planned"
},
{
"color": "eb6420",
"default": false,
"description": null,
"id": 44501256,
"name": "Breaking API Change",
"node_id": "MDU6TGFiZWw0NDUwMTI1Ng==",
"url": "https://api.github.com/repos/psf/requests/labels/Breaking%20API%20Change"
}
] |
closed
| true
| null |
[] | null | 0
|
2020-06-07T17:35:17Z
|
2021-12-18T14:00:18Z
|
2021-09-19T13:43:56Z
|
CONTRIBUTOR
|
resolved
|
The seuptools test command has been formally deprecated since version
41.5.0 (27 Oct 2019). The project recommends replacing its use with tox
as a project level testing entrypoint.
Fixes the warning when running tests:
> WARNING: Testing via this command is deprecated and will be removed in
> a future version. Users looking for a generic test entry point
> independent of test runner are encouraged to use tox.
For more details, see the setuptools history:
https://setuptools.readthedocs.io/en/latest/history.html#v41-5-0
And the command's documentation:
https://setuptools.readthedocs.io/en/latest/setuptools.html#test-build-package-and-run-a-unittest-suite
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5481/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5481/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5481.diff",
"html_url": "https://github.com/psf/requests/pull/5481",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5481.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5481"
}
| true
|
[] |
https://api.github.com/repos/psf/requests/issues/5480
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5480/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5480/comments
|
https://api.github.com/repos/psf/requests/issues/5480/events
|
https://github.com/psf/requests/pull/5480
| 632,219,289
|
MDExOlB1bGxSZXF1ZXN0NDI4OTkxNjYy
| 5,480
|
Using range method to check status code
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12211926?v=4",
"events_url": "https://api.github.com/users/nikolasvargas/events{/privacy}",
"followers_url": "https://api.github.com/users/nikolasvargas/followers",
"following_url": "https://api.github.com/users/nikolasvargas/following{/other_user}",
"gists_url": "https://api.github.com/users/nikolasvargas/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nikolasvargas",
"id": 12211926,
"login": "nikolasvargas",
"node_id": "MDQ6VXNlcjEyMjExOTI2",
"organizations_url": "https://api.github.com/users/nikolasvargas/orgs",
"received_events_url": "https://api.github.com/users/nikolasvargas/received_events",
"repos_url": "https://api.github.com/users/nikolasvargas/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nikolasvargas/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nikolasvargas/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nikolasvargas",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-06-06T05:23:35Z
|
2021-08-28T00:06:27Z
|
2020-06-15T15:06:41Z
|
NONE
|
resolved
|
More readable
|
{
"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/5480/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5480/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5480.diff",
"html_url": "https://github.com/psf/requests/pull/5480",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5480.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5480"
}
| true
|
[
"But it's not",
"ok",
"Hi @nikolasvargas,\r\n\r\nThanks for the contribution! I don't know if I agree this is more readable though. It has the additional negative that we generate a bunch of additional numbers in the range we have to iterate but will never possibly use. The current implementation is pretty direct and common usage for comparison operators in Python.\r\n\r\nI think we'll leave this as is for now."
] |
https://api.github.com/repos/psf/requests/issues/5479
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5479/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5479/comments
|
https://api.github.com/repos/psf/requests/issues/5479/events
|
https://github.com/psf/requests/issues/5479
| 630,807,796
|
MDU6SXNzdWU2MzA4MDc3OTY=
| 5,479
|
module 'requests' has no attribute 'settings'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7999692?v=4",
"events_url": "https://api.github.com/users/OscarVanL/events{/privacy}",
"followers_url": "https://api.github.com/users/OscarVanL/followers",
"following_url": "https://api.github.com/users/OscarVanL/following{/other_user}",
"gists_url": "https://api.github.com/users/OscarVanL/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/OscarVanL",
"id": 7999692,
"login": "OscarVanL",
"node_id": "MDQ6VXNlcjc5OTk2OTI=",
"organizations_url": "https://api.github.com/users/OscarVanL/orgs",
"received_events_url": "https://api.github.com/users/OscarVanL/received_events",
"repos_url": "https://api.github.com/users/OscarVanL/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/OscarVanL/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/OscarVanL/subscriptions",
"type": "User",
"url": "https://api.github.com/users/OscarVanL",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-06-04T13:12:26Z
|
2021-01-20T19:57:28Z
|
2020-06-05T15:38:48Z
|
NONE
|
resolved
|
I want to print verbose logs from requests to see the headers and cookies in each request.
I followed [this page](https://requests.readthedocs.io/en/v0.6.6/user/advanced/), which says to run:
```
requests.settings.verbose = sys.stderr
````
I suspect this may be a case of outdated documentation, but I can't find anything more up to date.
## Expected Result
Verbose logging should be enabled.
## Actual Result
My IDE gives a warning about `settings not being a reference in __init__.pyi`. Running the program throws the exception `AttributeError: module 'requests' has no attribute 'settings'`
## Reproduction Steps
```python
import requests
requests.settings.verbose = sys.stderr
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.9.2"
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.8.3"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "1010107f",
"version": "19.1.0"
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010107f"
},
"urllib3": {
"version": "1.25.8"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7999692?v=4",
"events_url": "https://api.github.com/users/OscarVanL/events{/privacy}",
"followers_url": "https://api.github.com/users/OscarVanL/followers",
"following_url": "https://api.github.com/users/OscarVanL/following{/other_user}",
"gists_url": "https://api.github.com/users/OscarVanL/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/OscarVanL",
"id": 7999692,
"login": "OscarVanL",
"node_id": "MDQ6VXNlcjc5OTk2OTI=",
"organizations_url": "https://api.github.com/users/OscarVanL/orgs",
"received_events_url": "https://api.github.com/users/OscarVanL/received_events",
"repos_url": "https://api.github.com/users/OscarVanL/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/OscarVanL/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/OscarVanL/subscriptions",
"type": "User",
"url": "https://api.github.com/users/OscarVanL",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5479/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5479/timeline
| null |
completed
| null | null | false
|
[
"The page you followed is for requests version 0.6 and you're using 2.23. Please read the correct documentation",
"Oh my bad - I just googled requests verbose logging. I can't seem to find the same documentation for the new version. Do you know where I can find this?\r\n\r\nI just want to see the full HTTP POST/GET requests sent with the URL, headers and cookies used.",
"It doesn't exist. It was ripped out in v1. There's something to dump the request/response cycle in toolbelt.readthedocs.io though",
"For the other poor sods who run across this thread the same way I did. This is what I wanted to have found when I ran across this:\r\n\r\nYou want to use [requests_toolbelt](https://toolbelt.readthedocs.io/en/latest/)'s [dump](https://toolbelt.readthedocs.io/en/latest/dumputils.html) module.\r\n\r\nHere's a quick example showing how to dump the requests and responses.\r\n\r\n```\r\nimport requests\r\nfrom requests_toolbelt.utils import dump\r\n\r\nresp = requests.get('https://httpbin.org/redirect/5')\r\ndata = dump.dump_all(resp)\r\nprint(data.decode('utf-8'))\r\n```",
"100,000% thank you for posting this."
] |
https://api.github.com/repos/psf/requests/issues/5478
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5478/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5478/comments
|
https://api.github.com/repos/psf/requests/issues/5478/events
|
https://github.com/psf/requests/issues/5478
| 630,172,597
|
MDU6SXNzdWU2MzAxNzI1OTc=
| 5,478
|
Implicit JSON Content-Type is missing charset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1236420?v=4",
"events_url": "https://api.github.com/users/reinderien/events{/privacy}",
"followers_url": "https://api.github.com/users/reinderien/followers",
"following_url": "https://api.github.com/users/reinderien/following{/other_user}",
"gists_url": "https://api.github.com/users/reinderien/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/reinderien",
"id": 1236420,
"login": "reinderien",
"node_id": "MDQ6VXNlcjEyMzY0MjA=",
"organizations_url": "https://api.github.com/users/reinderien/orgs",
"received_events_url": "https://api.github.com/users/reinderien/received_events",
"repos_url": "https://api.github.com/users/reinderien/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/reinderien/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/reinderien/subscriptions",
"type": "User",
"url": "https://api.github.com/users/reinderien",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-06-03T17:11:15Z
|
2021-08-31T00:06:54Z
|
2020-06-03T19:03:03Z
|
NONE
|
resolved
|
This code in `requests/models.py`:
```python
content_type = 'application/json'
body = complexjson.dumps(json)
if not isinstance(body, bytes):
body = body.encode('utf-8')
# ...
# Add content-type if it wasn't explicitly provided.
if content_type and ('content-type' not in self.headers):
self.headers['Content-Type'] = content_type
```
has an incomplete `Content-Type`.
## Expected Result
That `Content-Type` be `application/json; charset=utf-8`
## Actual Result
`Content-Type` is only `application/json`
## Reproduction Steps
Make any request passing `json={}` and without explicitly setting any headers.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.8.3"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010106f"
},
"urllib3": {
"version": "1.25.9"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1236420?v=4",
"events_url": "https://api.github.com/users/reinderien/events{/privacy}",
"followers_url": "https://api.github.com/users/reinderien/followers",
"following_url": "https://api.github.com/users/reinderien/following{/other_user}",
"gists_url": "https://api.github.com/users/reinderien/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/reinderien",
"id": 1236420,
"login": "reinderien",
"node_id": "MDQ6VXNlcjEyMzY0MjA=",
"organizations_url": "https://api.github.com/users/reinderien/orgs",
"received_events_url": "https://api.github.com/users/reinderien/received_events",
"repos_url": "https://api.github.com/users/reinderien/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/reinderien/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/reinderien/subscriptions",
"type": "User",
"url": "https://api.github.com/users/reinderien",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5478/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5478/timeline
| null |
completed
| null | null | false
|
[
"To the best of my knowledge the charset is optional and not required when handling utf-8 thus this is perfectly fine.",
"Of course it's optional; the concern is that this leaves ambiguity that the far end needs to resolve. Requests even says that\r\n\r\n```\r\n # No encoding set. JSON RFC 4627 section 3 states we should expect\r\n # UTF-8, -16 or -32. Detect which one to use\r\n```\r\n\r\nSo if the far end doesn't know which encoding to use, it's forced to guess. UTF-8 is a safe guess, but a guess nonetheless.\r\n",
"Right, but the JSON spec does not define `charset` and thus specifying this ever is a violation of the RFC. In other words, the specification says \"It should always be Unicode\" and there are ways to distinguish where necessary, so this project should emphatically not specify a charset.",
"Further ammunition: https://stackoverflow.com/questions/4990095/json-specification-and-usage-of-bom-charset-encoding",
"Ah, that's what I was missing. Thank you."
] |
https://api.github.com/repos/psf/requests/issues/5477
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5477/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5477/comments
|
https://api.github.com/repos/psf/requests/issues/5477/events
|
https://github.com/psf/requests/pull/5477
| 627,575,380
|
MDExOlB1bGxSZXF1ZXN0NDI1MzU3Nzgx
| 5,477
|
Drop monkeypatching with pyopenssl
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/730811?v=4",
"events_url": "https://api.github.com/users/WhyNotHugo/events{/privacy}",
"followers_url": "https://api.github.com/users/WhyNotHugo/followers",
"following_url": "https://api.github.com/users/WhyNotHugo/following{/other_user}",
"gists_url": "https://api.github.com/users/WhyNotHugo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/WhyNotHugo",
"id": 730811,
"login": "WhyNotHugo",
"node_id": "MDQ6VXNlcjczMDgxMQ==",
"organizations_url": "https://api.github.com/users/WhyNotHugo/orgs",
"received_events_url": "https://api.github.com/users/WhyNotHugo/received_events",
"repos_url": "https://api.github.com/users/WhyNotHugo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/WhyNotHugo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/WhyNotHugo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/WhyNotHugo",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-05-29T22:19:22Z
|
2021-08-28T00:06:29Z
|
2020-06-15T15:11:07Z
|
CONTRIBUTOR
|
resolved
|
Monkey patching url3 with pyopenssl 3 is no longer a good idea nor even necessary, and actually has security drawbacks, as described in #5267.
This also undoes the changes I initially made in #1347, so I guess it means my previous contribution has completed its life cycle.
|
{
"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/5477/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5477/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5477.diff",
"html_url": "https://github.com/psf/requests/pull/5477",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5477.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5477"
}
| true
|
[
"Hi @WhyNotHugo,\r\n\r\nThis was already addressed in #5443 and left patching as a potential fallback for now for older versions of Python 2.7. This patch has some additional removals from our debugging helper function that I don't think we want to remove. I think we'll pass on this for now.",
"Oh, I was under the impression that Python2 was being dropped anyway."
] |
https://api.github.com/repos/psf/requests/issues/5476
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5476/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5476/comments
|
https://api.github.com/repos/psf/requests/issues/5476/events
|
https://github.com/psf/requests/issues/5476
| 627,300,152
|
MDU6SXNzdWU2MjczMDAxNTI=
| 5,476
|
urllib3.exceptions.LocationParseError: Failed to parse
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1606679?v=4",
"events_url": "https://api.github.com/users/nickwebha/events{/privacy}",
"followers_url": "https://api.github.com/users/nickwebha/followers",
"following_url": "https://api.github.com/users/nickwebha/following{/other_user}",
"gists_url": "https://api.github.com/users/nickwebha/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nickwebha",
"id": 1606679,
"login": "nickwebha",
"node_id": "MDQ6VXNlcjE2MDY2Nzk=",
"organizations_url": "https://api.github.com/users/nickwebha/orgs",
"received_events_url": "https://api.github.com/users/nickwebha/received_events",
"repos_url": "https://api.github.com/users/nickwebha/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nickwebha/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nickwebha/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nickwebha",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-05-29T14:11:30Z
|
2021-08-31T00:06:43Z
|
2020-06-11T16:21:23Z
|
NONE
|
resolved
|
`python3 -c "import requests; requests.get('https://google.com');"` produces error.
## Expected Result
`requests.get()` gets the URL in question.
## Actual Result
```
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/models.py", line 379, in prepare_url
scheme, auth, host, port, path, query, fragment = parse_url(url)
File "/usr/lib/python3/dist-packages/urllib3/util/url.py", line 392, in parse_url
return six.raise_from(LocationParseError(source_url), None)
File "<string>", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: https://google.com
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 519, in request
prep = self.prepare_request(req)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 452, in prepare_request
p.prepare(
File "/usr/lib/python3/dist-packages/requests/models.py", line 313, in prepare
self.prepare_url(url, params)
File "/usr/lib/python3/dist-packages/requests/models.py", line 381, in prepare_url
raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: https://google.com
```
## Reproduction Steps
`python3 -c "import requests; requests.get('https://google.com');"` on CLI.
## System Information
$ python3 -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.8"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.8.2"
},
"platform": {
"release": "5.4.0-33-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010104f",
"version": "19.0.0"
},
"requests": {
"version": "2.22.0"
},
"system_ssl": {
"version": "1010106f"
},
"urllib3": {
"version": "1.25.8"
},
"using_pyopenssl": true
}
```
## Other Information
When I try to hit that URL in my browser it works fine.
I am seeing the same thing with [Certbot](https://github.com/certbot/certbot) and [Emscripten](https://github.com/emscripten-core/emscripten).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1606679?v=4",
"events_url": "https://api.github.com/users/nickwebha/events{/privacy}",
"followers_url": "https://api.github.com/users/nickwebha/followers",
"following_url": "https://api.github.com/users/nickwebha/following{/other_user}",
"gists_url": "https://api.github.com/users/nickwebha/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nickwebha",
"id": 1606679,
"login": "nickwebha",
"node_id": "MDQ6VXNlcjE2MDY2Nzk=",
"organizations_url": "https://api.github.com/users/nickwebha/orgs",
"received_events_url": "https://api.github.com/users/nickwebha/received_events",
"repos_url": "https://api.github.com/users/nickwebha/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nickwebha/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nickwebha/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nickwebha",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5476/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5476/timeline
| null |
completed
| null | null | false
|
[
"> Reproduction Steps\r\n> ```python3 -c \"import requests; requests.get('https://google.com');\" on CLI.```\r\n\r\nI can't reproduce this on Linux (Debian), Mac (OS X Catalina), or Windows (10). Likely something wrong on your side.",
"I can reproduce this error.\r\nThis error ocurred in my installation because urllib3/util/url.py catches the following error and transforms it into InvalidURL:\r\n```\r\nmodule 'six' has no attribute 'ensure_str'\r\n```\r\n\r\nSomewhere in the dependency chain a not-recent-enough version of six is requested. In my case 1.14.0 was installed, but ensure_str seems to be available from 1.15.0. So this could help (it is a workaround of course):\r\n```\r\npip3 install six==1.15.0\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/5475
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5475/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5475/comments
|
https://api.github.com/repos/psf/requests/issues/5475/events
|
https://github.com/psf/requests/pull/5475
| 626,950,934
|
MDExOlB1bGxSZXF1ZXN0NDI0ODQ3NTk0
| 5,475
|
Google App Engine
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6678748?v=4",
"events_url": "https://api.github.com/users/KartikChugh/events{/privacy}",
"followers_url": "https://api.github.com/users/KartikChugh/followers",
"following_url": "https://api.github.com/users/KartikChugh/following{/other_user}",
"gists_url": "https://api.github.com/users/KartikChugh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/KartikChugh",
"id": 6678748,
"login": "KartikChugh",
"node_id": "MDQ6VXNlcjY2Nzg3NDg=",
"organizations_url": "https://api.github.com/users/KartikChugh/orgs",
"received_events_url": "https://api.github.com/users/KartikChugh/received_events",
"repos_url": "https://api.github.com/users/KartikChugh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/KartikChugh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/KartikChugh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/KartikChugh",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-05-29T02:23:52Z
|
2021-08-28T00:06:28Z
|
2020-06-17T20:09:35Z
|
CONTRIBUTOR
|
resolved
|
{
"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/5475/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5475/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5475.diff",
"html_url": "https://github.com/psf/requests/pull/5475",
"merged_at": "2020-06-17T20:09:35Z",
"patch_url": "https://github.com/psf/requests/pull/5475.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5475"
}
| true
|
[
"Would you mind squashing and rebasing onto the current master branch?"
] |
|
https://api.github.com/repos/psf/requests/issues/5474
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5474/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5474/comments
|
https://api.github.com/repos/psf/requests/issues/5474/events
|
https://github.com/psf/requests/issues/5474
| 625,758,756
|
MDU6SXNzdWU2MjU3NTg3NTY=
| 5,474
|
Malformed URL leads to unexpected UnicodeError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/502876?v=4",
"events_url": "https://api.github.com/users/musically-ut/events{/privacy}",
"followers_url": "https://api.github.com/users/musically-ut/followers",
"following_url": "https://api.github.com/users/musically-ut/following{/other_user}",
"gists_url": "https://api.github.com/users/musically-ut/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/musically-ut",
"id": 502876,
"login": "musically-ut",
"node_id": "MDQ6VXNlcjUwMjg3Ng==",
"organizations_url": "https://api.github.com/users/musically-ut/orgs",
"received_events_url": "https://api.github.com/users/musically-ut/received_events",
"repos_url": "https://api.github.com/users/musically-ut/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/musically-ut/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/musically-ut/subscriptions",
"type": "User",
"url": "https://api.github.com/users/musically-ut",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2020-05-27T14:43:26Z
|
2021-08-31T00:06:50Z
|
2020-06-15T14:49:40Z
|
NONE
|
resolved
|
Giving the malformed URL `http://.com` should lead to `InvalidURL` but results in a misleading `UnicodeError`.
## Expected Result
Should raise `InvalidURL`.
## Actual Result
Raises `UnicodeError`.
## Reproduction Steps
```python
import requests
requests.get("https://.com")
```
results in:
```
---------------------------------------------------------------------------
UnicodeError Traceback (most recent call last)
~/miniconda3/lib/python3.7/encodings/idna.py in encode(self, input, errors)
164 if not (0 < len(label) < 64):
--> 165 raise UnicodeError("label empty or too long")
166 if len(labels[-1]) >= 64:
UnicodeError: label empty or too long
The above exception was the direct cause of the following exception:
UnicodeError Traceback (most recent call last)
<ipython-input-33-45504cf090ae> in <module>
----> 1 requests.get('http://.com')
~/miniconda3/lib/python3.7/site-packages/requests/api.py in get(url, params, **kwargs)
73
74 kwargs.setdefault('allow_redirects', True)
---> 75 return request('get', url, params=params, **kwargs)
76
77
~/miniconda3/lib/python3.7/site-packages/requests/api.py in request(method, url, **kwargs)
58 # cases, and look like a memory leak in others.
59 with sessions.Session() as session:
---> 60 return session.request(method=method, url=url, **kwargs)
61
62
~/miniconda3/lib/python3.7/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
531 }
532 send_kwargs.update(settings)
--> 533 resp = self.send(prep, **send_kwargs)
534
535 return resp
~/miniconda3/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)
644
645 # Send the request
--> 646 r = adapter.send(request, **kwargs)
647
648 # Total elapsed time of the request (approximately)
~/miniconda3/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
447 decode_content=False,
448 retries=self.max_retries,
--> 449 timeout=timeout
450 )
451
~/miniconda3/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
598 timeout=timeout_obj,
599 body=body, headers=headers,
--> 600 chunked=chunked)
601
602 # If we're going to release the connection in ``finally:``, then
~/miniconda3/lib/python3.7/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
352 conn.request_chunked(method, url, **httplib_request_kw)
353 else:
--> 354 conn.request(method, url, **httplib_request_kw)
355
356 # Reset the timeout for the recv() on the socket
~/miniconda3/lib/python3.7/http/client.py in request(self, method, url, body, headers, encode_chunked)
1227 encode_chunked=False):
1228 """Send a complete request to the server."""
-> 1229 self._send_request(method, url, body, headers, encode_chunked)
1230
1231 def _send_request(self, method, url, body, headers, encode_chunked):
~/miniconda3/lib/python3.7/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
1273 # default charset of iso-8859-1.
1274 body = _encode(body, 'body')
-> 1275 self.endheaders(body, encode_chunked=encode_chunked)
1276
1277 def getresponse(self):
~/miniconda3/lib/python3.7/http/client.py in endheaders(self, message_body, encode_chunked)
1222 else:
1223 raise CannotSendHeader()
-> 1224 self._send_output(message_body, encode_chunked=encode_chunked)
1225
1226 def request(self, method, url, body=None, headers={}, *,
~/miniconda3/lib/python3.7/http/client.py in _send_output(self, message_body, encode_chunked)
1014 msg = b"\r\n".join(self._buffer)
1015 del self._buffer[:]
-> 1016 self.send(msg)
1017
1018 if message_body is not None:
~/miniconda3/lib/python3.7/http/client.py in send(self, data)
954 if self.sock is None:
955 if self.auto_open:
--> 956 self.connect()
957 else:
958 raise NotConnected()
~/miniconda3/lib/python3.7/site-packages/urllib3/connection.py in connect(self)
179
180 def connect(self):
--> 181 conn = self._new_conn()
182 self._prepare_conn(conn)
183
~/miniconda3/lib/python3.7/site-packages/urllib3/connection.py in _new_conn(self)
157 try:
158 conn = connection.create_connection(
--> 159 (self._dns_host, self.port), self.timeout, **extra_kw)
160
161 except SocketTimeout:
~/miniconda3/lib/python3.7/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
55 family = allowed_gai_family()
56
---> 57 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
58 af, socktype, proto, canonname, sa = res
59 sock = None
~/miniconda3/lib/python3.7/socket.py in getaddrinfo(host, port, family, type, proto, flags)
746 # and socket type values to enum constants.
747 addrlist = []
--> 748 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
749 af, socktype, proto, canonname, sa = res
750 addrlist.append((_intenum_converter(af, AddressFamily),
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
```
## System Information
$ python -m requests.help
```
➔ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.7"
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.7.3"
},
"platform": {
"release": "19.4.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "1010103f",
"version": "19.0.0"
},
"requests": {
"version": "2.20.1"
},
"system_ssl": {
"version": "1010103f"
},
"urllib3": {
"version": "1.24.3"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5474/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5474/timeline
| null |
completed
| null | null | false
|
[
"Try requests 2.23",
"I see the same error.\r\n\r\n```\r\nIn [3]: requests.__version__\r\nOut[3]: '2.23.0'\r\n\r\nIn [4]: requests.get('http://.com')\r\n---------------------------------------------------------------------------\r\nUnicodeError Traceback (most recent call last)\r\n~/miniconda3/lib/python3.7/encodings/idna.py in encode(self, input, errors)\r\n 164 if not (0 < len(label) < 64):\r\n--> 165 raise UnicodeError(\"label empty or too long\")\r\n 166 if len(labels[-1]) >= 64:\r\n\r\nUnicodeError: label empty or too long\r\n\r\nThe above exception was the direct cause of the following exception:\r\n[...]\r\n```",
"The fix probably involves adding another check here: https://github.com/psf/requests/blob/master/requests/models.py#L402 ?\r\n\r\nIf so, I can whip up a quick PR.",
"You're looking in the wrong place.",
"Duplicate of #5367",
"Resolving this as a duplicate."
] |
https://api.github.com/repos/psf/requests/issues/5473
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5473/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5473/comments
|
https://api.github.com/repos/psf/requests/issues/5473/events
|
https://github.com/psf/requests/pull/5473
| 624,474,328
|
MDExOlB1bGxSZXF1ZXN0NDIyODg4MzM3
| 5,473
|
Make chardet encoding auto-detect run once
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2045724?v=4",
"events_url": "https://api.github.com/users/tomer70/events{/privacy}",
"followers_url": "https://api.github.com/users/tomer70/followers",
"following_url": "https://api.github.com/users/tomer70/following{/other_user}",
"gists_url": "https://api.github.com/users/tomer70/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tomer70",
"id": 2045724,
"login": "tomer70",
"node_id": "MDQ6VXNlcjIwNDU3MjQ=",
"organizations_url": "https://api.github.com/users/tomer70/orgs",
"received_events_url": "https://api.github.com/users/tomer70/received_events",
"repos_url": "https://api.github.com/users/tomer70/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tomer70/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tomer70/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tomer70",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-05-25T20:32:35Z
|
2021-08-27T00:08:46Z
|
2021-02-20T14:48:20Z
|
NONE
|
resolved
|
When you are using reuqest.request to get large non-text files and you are trying to call r.text, it tries to auto-detect using chardet because there is no header defining the charset.
When chardet is running on large EXE/PDF files (and maybe other file types) it takes quite some time to get the answer, which is None.
Once None returns, self.encoding receives the None value. Therefore the next time you call r.text on the same content, it will try to auto-detect again as if you never tried to auto-detect it.
I know it doesn't make much sense to use r.text when requesting PDF/EXE files but sometimes websites do return EXE/PDF content and not HTML as you would expect.
I think it can also improve performance when doing multiple calls to r.text on text content that needs to be auto-detected as well.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5473/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5473/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5473.diff",
"html_url": "https://github.com/psf/requests/pull/5473",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5473.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5473"
}
| true
|
[
"Why prefer `r.text` over `r.content`? Why do you want binary data (exe, pdf) as unicode?",
"> Why prefer `r.text` over `r.content`? Why do you want binary data (exe, pdf) as unicode?\r\n\r\nThanks for the comment.\r\n\r\nIt is not a matter of preference as need. \r\nfor example I build a crawler and at some point it's doing some text searches I need to get the right encoding.\r\n\r\nAlso, if I give the user option to input a website, I saw cases a domain redirect you to download PDF and in that case because of this behavior he spends some time until the chardet auto-detect it's not textual content",
"So why not use the `Content-Type` header to detect what you're receiving from the website and be more intelligent about your usecase?",
"> So why not use the `Content-Type` header to detect what you're receiving from the website and be more intelligent about your usecase?\r\n\r\nIn general you are right.\r\nHowever, as much as I understand even in most cases it's true there are cases you won't get the Content-Type header.\r\n\r\nIf your comment is just about my usecase so again, you are right, I can count on the Content-Type header but I'll probably going to miss some data, moreover, the true story here I'm using another project that's doing that.\r\n\r\nIf your comment is about my pull-request I wasn't sure if this is something the maintainers here would like to do for the same reason I mention above.\r\n\r\nIn addition, I think it is a better practice even if the content is a textual file so the auto-detect won't get evaluated more than it should, once you have the result there is no reason to my opinion to auto-detect again.\r\nJust to clarify, personally I saw the slowness in non-textual formats but it is possible the auto-detect will take some time on textual content as well.\r\n\r\nTo me, it seems that the logical meaning of the None value of self.encoding supposed to indicate we don't know the encoding was mixed with the self.encoding becomes None in a case chardet return and \"decided\" the encoding is None",
"So, this pull request breaks the correct behaviour of `r.text`. In the case where `r.encoding` is None, the first call to `r.text` will return properly encoded data. The second call will return something wholly different because it won't store the `apparent_encoding` anywhere. It's the wrong fix. If you want to move forward with this, i'd suggest a different approach of caching the detected encoding somewhere in `apparent_encoding` so each time you call that after the first, it doesn't keep using chardet"
] |
https://api.github.com/repos/psf/requests/issues/5472
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5472/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5472/comments
|
https://api.github.com/repos/psf/requests/issues/5472/events
|
https://github.com/psf/requests/issues/5472
| 623,660,010
|
MDU6SXNzdWU2MjM2NjAwMTA=
| 5,472
|
Problem with python3.6
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25548515?v=4",
"events_url": "https://api.github.com/users/FathiHamed/events{/privacy}",
"followers_url": "https://api.github.com/users/FathiHamed/followers",
"following_url": "https://api.github.com/users/FathiHamed/following{/other_user}",
"gists_url": "https://api.github.com/users/FathiHamed/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/FathiHamed",
"id": 25548515,
"login": "FathiHamed",
"node_id": "MDQ6VXNlcjI1NTQ4NTE1",
"organizations_url": "https://api.github.com/users/FathiHamed/orgs",
"received_events_url": "https://api.github.com/users/FathiHamed/received_events",
"repos_url": "https://api.github.com/users/FathiHamed/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/FathiHamed/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/FathiHamed/subscriptions",
"type": "User",
"url": "https://api.github.com/users/FathiHamed",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-05-23T13:23:00Z
|
2021-08-31T00:06:56Z
|
2020-05-23T13:32:45Z
|
NONE
|
resolved
|
When I try to send a request via python3.6 to this url: "https://www.khaneyeshoma.ir/", it waits until Timeout exception is raised. But when I try the same request via python2.7 it is successfully completed with status code: 200. Can you help me?
Thanks!
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25548515?v=4",
"events_url": "https://api.github.com/users/FathiHamed/events{/privacy}",
"followers_url": "https://api.github.com/users/FathiHamed/followers",
"following_url": "https://api.github.com/users/FathiHamed/following{/other_user}",
"gists_url": "https://api.github.com/users/FathiHamed/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/FathiHamed",
"id": 25548515,
"login": "FathiHamed",
"node_id": "MDQ6VXNlcjI1NTQ4NTE1",
"organizations_url": "https://api.github.com/users/FathiHamed/orgs",
"received_events_url": "https://api.github.com/users/FathiHamed/received_events",
"repos_url": "https://api.github.com/users/FathiHamed/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/FathiHamed/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/FathiHamed/subscriptions",
"type": "User",
"url": "https://api.github.com/users/FathiHamed",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5472/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5472/timeline
| null |
completed
| null | null | false
|
[
"No. This is not a support forum. Go to stackoverflow.com. Provide the exact versions of python, your system dependencies, requests, etc. and the exact results you get."
] |
https://api.github.com/repos/psf/requests/issues/5471
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5471/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5471/comments
|
https://api.github.com/repos/psf/requests/issues/5471/events
|
https://github.com/psf/requests/issues/5471
| 623,634,261
|
MDU6SXNzdWU2MjM2MzQyNjE=
| 5,471
|
about session?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/15169452?v=4",
"events_url": "https://api.github.com/users/sjm1992st/events{/privacy}",
"followers_url": "https://api.github.com/users/sjm1992st/followers",
"following_url": "https://api.github.com/users/sjm1992st/following{/other_user}",
"gists_url": "https://api.github.com/users/sjm1992st/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sjm1992st",
"id": 15169452,
"login": "sjm1992st",
"node_id": "MDQ6VXNlcjE1MTY5NDUy",
"organizations_url": "https://api.github.com/users/sjm1992st/orgs",
"received_events_url": "https://api.github.com/users/sjm1992st/received_events",
"repos_url": "https://api.github.com/users/sjm1992st/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sjm1992st/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sjm1992st/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sjm1992st",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-05-23T10:57:54Z
|
2021-08-31T00:06:49Z
|
2020-06-17T20:18:30Z
|
NONE
|
resolved
|
If I generate a seesion for different domain names in the same program,
for example :
url1:
session1 = requests.session ()
url2:
session2 = requests.session ()
What's the difference with me only generating a session for url1 and url2?
Will there be any difference in performance?
thanks!
|
{
"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/5471/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5471/timeline
| null |
completed
| null | null | false
|
[
"### From the source code of request.sessions:\r\n>This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies).\r\n\r\nAn example of this is any cookies a request returns will be there whenever you call a request from that session you call the request from (if you made a session), however, if you didn't make a session (or used a different session, in your case) that different session would not have those cookies that were set.\r\n(Also, correct me if I'm wrong, but \"not making/using a session\" just makes a session, sends the request, then forgets about the session.)\r\n\r\n*I'm new to contributing to others' projects on GitHub, so PLEASE give me feedback or correct me if you can, thanks all :D*",
"Also, you should probably have asked this on a website like StackOverflow, as this isn't an issue with the library, rather a question on how it works.",
"Thanks for chiming in @ItzMeWilliam 😊\r\n\r\nIt looks like the initial question is covered so I'm going to resolve, and you're right these should usually be asked on Stackoverflow."
] |
https://api.github.com/repos/psf/requests/issues/5470
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5470/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5470/comments
|
https://api.github.com/repos/psf/requests/issues/5470/events
|
https://github.com/psf/requests/issues/5470
| 623,616,111
|
MDU6SXNzdWU2MjM2MTYxMTE=
| 5,470
|
for non-english response, may add apparent_text for convenient
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/32261870?v=4",
"events_url": "https://api.github.com/users/NewUserHa/events{/privacy}",
"followers_url": "https://api.github.com/users/NewUserHa/followers",
"following_url": "https://api.github.com/users/NewUserHa/following{/other_user}",
"gists_url": "https://api.github.com/users/NewUserHa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/NewUserHa",
"id": 32261870,
"login": "NewUserHa",
"node_id": "MDQ6VXNlcjMyMjYxODcw",
"organizations_url": "https://api.github.com/users/NewUserHa/orgs",
"received_events_url": "https://api.github.com/users/NewUserHa/received_events",
"repos_url": "https://api.github.com/users/NewUserHa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/NewUserHa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/NewUserHa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/NewUserHa",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-05-23T09:11:18Z
|
2021-08-30T00:06:24Z
|
2020-07-21T06:01:01Z
|
NONE
|
resolved
|
most non-English response has incorrect r.encoding so it need:
```
r.encoding = r.apparent_encoding
r.text
```
what about a new attribute like `r.apparent_text` or `r.text(chardect=True)`for the result?
Thanks!
|
{
"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/5470/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5470/timeline
| null |
completed
| null | null | false
|
[
"https://github.com/psf/requests/issues/5084\r\nhttps://github.com/psf/requests/issues/2086",
"New features are not being added",
"I have read that and I don't think this can count as a feature.",
"Adding new API surface area is a new feature. Further, if `r.encoding` is incorrect but `r.apparent_encoding` is correct that means the server is reporting the wrong thing and that's what the library is trying to use. In other words, there's a perfectly good work around here.",
"Hi @NewUserHa,\r\n\r\nsigmavirus24 is correct that we aren't adding any new features currently which this would fall under. If chardet is incorrectly detecting an encoding, I would suggest reaching out to the [library](https://github.com/chardet/chardet) to see if you can help identify the issue. Otherwise, setting the encoding when the server returns an incorrect response is the best option to get around this."
] |
https://api.github.com/repos/psf/requests/issues/5469
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5469/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5469/comments
|
https://api.github.com/repos/psf/requests/issues/5469/events
|
https://github.com/psf/requests/issues/5469
| 622,730,139
|
MDU6SXNzdWU2MjI3MzAxMzk=
| 5,469
|
Does `Response.content` decode the unicode character in JSON implictly?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13658574?v=4",
"events_url": "https://api.github.com/users/Phi-Li/events{/privacy}",
"followers_url": "https://api.github.com/users/Phi-Li/followers",
"following_url": "https://api.github.com/users/Phi-Li/following{/other_user}",
"gists_url": "https://api.github.com/users/Phi-Li/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Phi-Li",
"id": 13658574,
"login": "Phi-Li",
"node_id": "MDQ6VXNlcjEzNjU4NTc0",
"organizations_url": "https://api.github.com/users/Phi-Li/orgs",
"received_events_url": "https://api.github.com/users/Phi-Li/received_events",
"repos_url": "https://api.github.com/users/Phi-Li/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Phi-Li/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Phi-Li/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Phi-Li",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-05-21T19:29:42Z
|
2021-08-31T00:06:56Z
|
2020-05-21T20:37:24Z
|
NONE
|
resolved
|
Python 3.8.2, requests 2.23.0
Code for reproduce:
```python
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0'
}
resp = requests.get('https://api.bgm.tv/subject/12', headers=headers)
print(resp.content)
```
Expect `resp.content` to be bytes containing the original payload bytes (https://requests.readthedocs.io/en/master/user/quickstart/#binary-response-content), but unicode character in the JSON is decoded as unicode representation with a prefix `\u`.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13658574?v=4",
"events_url": "https://api.github.com/users/Phi-Li/events{/privacy}",
"followers_url": "https://api.github.com/users/Phi-Li/followers",
"following_url": "https://api.github.com/users/Phi-Li/following{/other_user}",
"gists_url": "https://api.github.com/users/Phi-Li/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Phi-Li",
"id": 13658574,
"login": "Phi-Li",
"node_id": "MDQ6VXNlcjEzNjU4NTc0",
"organizations_url": "https://api.github.com/users/Phi-Li/orgs",
"received_events_url": "https://api.github.com/users/Phi-Li/received_events",
"repos_url": "https://api.github.com/users/Phi-Li/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Phi-Li/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Phi-Li/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Phi-Li",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5469/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5469/timeline
| null |
completed
| null | null | false
|
[
"No, resp.content is bytes and resp.text is the decoded unicode text.",
"> No, resp.content is bytes and resp.text is the decoded unicode text.\r\n\r\nThanks for the reply. I decompressed the raw response body and figured out the `\\uxxxx` transformation was made on the server side, so the issue has nothing to do with Requests."
] |
https://api.github.com/repos/psf/requests/issues/5468
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5468/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5468/comments
|
https://api.github.com/repos/psf/requests/issues/5468/events
|
https://github.com/psf/requests/pull/5468
| 622,508,933
|
MDExOlB1bGxSZXF1ZXN0NDIxMzYwMDQ4
| 5,468
|
Fix typo in README
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/947110?v=4",
"events_url": "https://api.github.com/users/kkirsche/events{/privacy}",
"followers_url": "https://api.github.com/users/kkirsche/followers",
"following_url": "https://api.github.com/users/kkirsche/following{/other_user}",
"gists_url": "https://api.github.com/users/kkirsche/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kkirsche",
"id": 947110,
"login": "kkirsche",
"node_id": "MDQ6VXNlcjk0NzExMA==",
"organizations_url": "https://api.github.com/users/kkirsche/orgs",
"received_events_url": "https://api.github.com/users/kkirsche/received_events",
"repos_url": "https://api.github.com/users/kkirsche/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kkirsche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kkirsche/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kkirsche",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 0
|
2020-05-21T13:44:07Z
|
2021-08-28T00:06:29Z
|
2020-06-15T15:23:17Z
|
CONTRIBUTOR
|
resolved
|
Fix typo in README related to installation guidelines
|
{
"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/5468/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5468/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5468.diff",
"html_url": "https://github.com/psf/requests/pull/5468",
"merged_at": "2020-06-15T15:23:17Z",
"patch_url": "https://github.com/psf/requests/pull/5468.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5468"
}
| true
|
[] |
https://api.github.com/repos/psf/requests/issues/5467
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5467/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5467/comments
|
https://api.github.com/repos/psf/requests/issues/5467/events
|
https://github.com/psf/requests/issues/5467
| 622,152,527
|
MDU6SXNzdWU2MjIxNTI1Mjc=
| 5,467
|
Stale requests2 package on pypi
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/412019?v=4",
"events_url": "https://api.github.com/users/ccope/events{/privacy}",
"followers_url": "https://api.github.com/users/ccope/followers",
"following_url": "https://api.github.com/users/ccope/following{/other_user}",
"gists_url": "https://api.github.com/users/ccope/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ccope",
"id": 412019,
"login": "ccope",
"node_id": "MDQ6VXNlcjQxMjAxOQ==",
"organizations_url": "https://api.github.com/users/ccope/orgs",
"received_events_url": "https://api.github.com/users/ccope/received_events",
"repos_url": "https://api.github.com/users/ccope/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ccope/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ccope/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ccope",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2020-05-20T23:48:15Z
|
2021-08-30T00:06:23Z
|
2020-07-21T06:02:47Z
|
NONE
|
resolved
|
I'm not totally sure where the right place to report this is, but there is a confusing stale copy of requests on pypi, called requests2: https://pypi.org/project/requests2/
It is:
* 3 years old
* uploaded by the original maintainer
* showing a README with some healthy-looking badges
* listed as Development Status: 5 - Production/Stable in pypi
* getting used accidentally in new projects: https://libraries.io/pypi/requests2/usage
* easy to find when searching for requests:

I believe it should be [yanked](https://www.python.org/dev/peps/pep-0592/) and/or [replaced with a redirect](https://www.dampfkraft.com/code/how-to-deprecate-a-pypi-package.html#provide-a-redirect).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5467/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5467/timeline
| null |
completed
| null | null | false
|
[
"The pepole who own that project don't work on this project. You'll need to report this to PyPI",
"I'm not sure what you mean. I am not very familiar with the history of ownership/maintenance of requests, but it seems that over time it has been transferred from kennethreitz to the Python Software Foundation. If none of the current maintainers have access to the requests2 pypi package, I believe the correct method is to follow https://www.python.org/dev/peps/pep-0541/#how-to-request-a-name-transfer",
"@ccope Kenneth doesn't work on this project and isn't affiliated.",
"That may be the case, but the `requests2` package on pypi is an **exact**\\* copy of this project at that version, so I don't believe it should be considered a separate project. I agree that there is a process to follow with pypi, but I believe it needs to be initiated by the current maintainers of this package, as they are the ones who should receive control over it.\r\n\r\n\\*: With the exception of a couple of metadata files which specify `requests2` instead of `requests`.",
"@ccope people are allowed to fork projects and re-upload them to PyPI. Entire companies do this by prefixing the names of dependencies they want exact-ish copies with their company name. You can't expect those maintainers to update those forks as well, somehow, can you? No. You can't expect these maintainers to attempt to maintain two packages, 1 of which isn't owned by anyone on the maintenance team.",
"Yeah, there's nothing we can really do about this. We don't own that package and names through at least Request5 are currently being squatted. The plan for the foreseeable to future is to keep the project (regardless of version) under just `requests`. Anything else should be treated as unrelated at this time."
] |
https://api.github.com/repos/psf/requests/issues/5466
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5466/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5466/comments
|
https://api.github.com/repos/psf/requests/issues/5466/events
|
https://github.com/psf/requests/issues/5466
| 622,074,757
|
MDU6SXNzdWU2MjIwNzQ3NTc=
| 5,466
|
`.json()` degrades `stream=True`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1236420?v=4",
"events_url": "https://api.github.com/users/reinderien/events{/privacy}",
"followers_url": "https://api.github.com/users/reinderien/followers",
"following_url": "https://api.github.com/users/reinderien/following{/other_user}",
"gists_url": "https://api.github.com/users/reinderien/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/reinderien",
"id": 1236420,
"login": "reinderien",
"node_id": "MDQ6VXNlcjEyMzY0MjA=",
"organizations_url": "https://api.github.com/users/reinderien/orgs",
"received_events_url": "https://api.github.com/users/reinderien/received_events",
"repos_url": "https://api.github.com/users/reinderien/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/reinderien/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/reinderien/subscriptions",
"type": "User",
"url": "https://api.github.com/users/reinderien",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-05-20T20:48:01Z
|
2021-08-28T00:06:01Z
|
2020-12-22T13:39:41Z
|
NONE
|
resolved
|
The current logic in `.json()` forces a load of `self.content`, removing any advantage from `stream=True`. For large JSON payloads this creates memory problems. The memory footprint could be halved(ish) by:
- Using `Content-Length` instead of `len(self.content)`
- Using `json.load(raw)` rather than `loads`, also avoiding `content.decode()`
## Expected Result
That the memory footprint of `.json()` be O(1) against input length, not counting the output object.
## Actual Result
The memory footprint is O(n) in input length due to reliance on `.content`.
## Reproduction Steps
Call `requests.get('something-large.json', stream=True).json()`
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.7.2"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "101000af"
},
"urllib3": {
"version": "1.25.9"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5466/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5466/timeline
| null |
completed
| null | null | false
|
[
"> * Using `Content-Length` instead of `len(self.content)`\r\n\r\n`Content-Length` only works if the content hasn't been encoded and had to be decoded, e.g., gzip compressed. It's not an accurate representation of what the JSON content length might be\r\n\r\n> Using `json.load(raw)` rather than `loads`, also avoiding `content.decode()`\r\n\r\nThat might be an enhancement, if the project were accepting them.",
"This doesn't really matter. [`json.loads()` is defined](https://github.com/python/cpython/blob/b3c77ecbbe0ad3e3cc6dbd885792203e9e6ec858/Lib/json/__init__.py#L274-L296) as (paraphrased here)\r\n\r\n```python\r\ndef load(fp, **kw):\r\n return loads(fp.read(), **kw)\r\n```\r\n\r\nso attempting to be fancy in `requests` wouldn't help at all. You would also need a streaming-supporting JSON parser."
] |
https://api.github.com/repos/psf/requests/issues/5465
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5465/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5465/comments
|
https://api.github.com/repos/psf/requests/issues/5465/events
|
https://github.com/psf/requests/pull/5465
| 622,014,991
|
MDExOlB1bGxSZXF1ZXN0NDIwOTYyMTc0
| 5,465
|
Handle space-separated values in NO_PROXY
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/573017?v=4",
"events_url": "https://api.github.com/users/michael-o/events{/privacy}",
"followers_url": "https://api.github.com/users/michael-o/followers",
"following_url": "https://api.github.com/users/michael-o/following{/other_user}",
"gists_url": "https://api.github.com/users/michael-o/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/michael-o",
"id": 573017,
"login": "michael-o",
"node_id": "MDQ6VXNlcjU3MzAxNw==",
"organizations_url": "https://api.github.com/users/michael-o/orgs",
"received_events_url": "https://api.github.com/users/michael-o/received_events",
"repos_url": "https://api.github.com/users/michael-o/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/michael-o/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/michael-o/subscriptions",
"type": "User",
"url": "https://api.github.com/users/michael-o",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 6
|
2020-05-20T19:01:12Z
|
2021-08-27T00:08:53Z
|
2021-01-04T23:47:23Z
|
NONE
|
resolved
|
Since there is no standard for the NO_PROXY environment variable allow values
to be comma- and space-separated values.
|
{
"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/5465/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5465/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5465.diff",
"html_url": "https://github.com/psf/requests/pull/5465",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5465.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5465"
}
| true
|
[
"Hi @michael-o, I did a bit of digging. While `NO_PROXY` has no formal spec, the majority of tools seem to be in agreement on its usage. I've been unable to find documentation for any common web tool that uses space-delimited lists for NO_PROXY. Curl, which we usually use as our model in situations like this, [calls it out](https://curl.haxx.se/docs/manpage.html) specifically as a \"comma-separated list of hosts/domains\".\r\n\r\nWas there a reason you needed spaces introduced here?",
"@nateprewitt, yes flexibility in some degree: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247947. Since curl works, I see no reason that py-requests shouldn't. I see no apparent harm by merging this.",
"@nateprewitt Do you see any change to have this merged? I will happily rebase if required.",
"Ping...",
"Curl documents as a comma separated list, I dont think we should do any different. Going to close this. ",
"Well, a decision at least. Although my change is non-invasive. I would also concur your statement:\r\n1. Have a look at this: https://github.com/curl/curl/blob/648712eec1eedb05965b9b4d6dd457bda5d70481/lib/url.c#L2136-L2145\r\n2. This works for me with curl: `NO_PROXY=localhost .siemens.net .siemens.com .siemens.de`\r\n\r\nAs it seems the space is happily accepted:\r\n```\r\nosipovmi@deblndw011x:~\r\n$ curl -I --verbose https://github.com\r\n* Uses proxy env variable NO_PROXY == 'localhost .siemens.net .siemens.com .siemens.de'\r\n* Uses proxy env variable HTTPS_PROXY == 'http://194.145.60.1:9400'\r\n* Trying 194.145.60.1:9400...\r\n* Connected to 194.145.60.1 (194.145.60.1) port 9400 (#0)\r\n* allocate connect buffer!\r\n* Establish HTTP proxy tunnel to github.com:443\r\n> CONNECT github.com:443 HTTP/1.1\r\n> Host: github.com:443\r\n> User-Agent: curl/7.74.0\r\n> Proxy-Connection: Keep-Alive\r\n>\r\n< HTTP/1.1 200 Connection Established\r\nHTTP/1.1 200 Connection Established\r\n< Proxy-Agent: Zscaler/6.0\r\nProxy-Agent: Zscaler/6.0\r\n<\r\n\r\n* Proxy replied 200 to CONNECT request\r\n* CONNECT phase completed!\r\n* ALPN, offering h2\r\n* ALPN, offering http/1.1\r\n* successfully set certificate verify locations:\r\n* CAfile: none\r\n* CApath: /etc/ssl/certs/\r\n* TLSv1.3 (OUT), TLS handshake, Client hello (1):\r\n* CONNECT phase completed!\r\n* CONNECT phase completed!\r\n* TLSv1.3 (IN), TLS handshake, Server hello (2):\r\n* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):\r\n* TLSv1.3 (IN), TLS handshake, Certificate (11):\r\n* TLSv1.3 (IN), TLS handshake, CERT verify (15):\r\n* TLSv1.3 (IN), TLS handshake, Finished (20):\r\n* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):\r\n* TLSv1.3 (OUT), TLS handshake, Finished (20):\r\n* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256\r\n* ALPN, server accepted to use http/1.1\r\n* Server certificate:\r\n* subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com\r\n* start date: May 5 00:00:00 2020 GMT\r\n* expire date: May 10 12:00:00 2022 GMT\r\n* subjectAltName: host \"github.com\" matched cert's \"github.com\"\r\n* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA\r\n* SSL certificate verify ok.\r\n> HEAD / HTTP/1.1\r\n> Host: github.com\r\n> User-Agent: curl/7.74.0\r\n> Accept: */*\r\n>\r\n* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):\r\n* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):\r\n* old SSL session ID is stale, removing\r\n* Mark bundle as not supporting multiuse\r\n< HTTP/1.1 200 OK\r\nHTTP/1.1 200 OK\r\n< date: Tue, 05 Jan 2021 08:48:22 GMT\r\ndate: Tue, 05 Jan 2021 08:48:22 GMT\r\n< content-type: text/html; charset=utf-8\r\ncontent-type: text/html; charset=utf-8\r\n< server: GitHub.com\r\nserver: GitHub.com\r\n< status: 200 OK\r\nstatus: 200 OK\r\n```\r\n\r\nIs that sufficient to change your mind?"
] |
https://api.github.com/repos/psf/requests/issues/5464
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5464/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5464/comments
|
https://api.github.com/repos/psf/requests/issues/5464/events
|
https://github.com/psf/requests/pull/5464
| 621,354,329
|
MDExOlB1bGxSZXF1ZXN0NDIwNDIzMTI5
| 5,464
|
Allow semicolon in the href of Link header
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/65147?v=4",
"events_url": "https://api.github.com/users/ibnesayeed/events{/privacy}",
"followers_url": "https://api.github.com/users/ibnesayeed/followers",
"following_url": "https://api.github.com/users/ibnesayeed/following{/other_user}",
"gists_url": "https://api.github.com/users/ibnesayeed/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ibnesayeed",
"id": 65147,
"login": "ibnesayeed",
"node_id": "MDQ6VXNlcjY1MTQ3",
"organizations_url": "https://api.github.com/users/ibnesayeed/orgs",
"received_events_url": "https://api.github.com/users/ibnesayeed/received_events",
"repos_url": "https://api.github.com/users/ibnesayeed/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ibnesayeed/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ibnesayeed/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ibnesayeed",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] | null | 1
|
2020-05-19T23:41:45Z
|
2022-01-03T15:26:44Z
| null |
NONE
| null |
Semicolons are valid characters in URIs, splitting them while parsing the `Link` header results in unexpected token and wrong `url` attribute (notice `;oldid=934259284` portion the below example).
```
<https://en.wikipedia.org/w/index.php?title=COVID-19_pandemic&oldid=934259284>; rel="original", <https://web.archive.org/web/timemap/link/https://en.wikipedia.org/w/index.php?title=COVID-19_pandemic&oldid=934259284>; rel="timemap"; type="application/link-format"
```
This PR attempts to fix current parsing issue and also renames a variable to better reflect the purpose of it.
I would note here that this parser still is far from perfect and can be better implemented using state machine.
| null |
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/5464/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5464/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5464.diff",
"html_url": "https://github.com/psf/requests/pull/5464",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5464.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5464"
}
| true
|
[
"@nateprewitt is there anything we can to do to get it merged?"
] |
https://api.github.com/repos/psf/requests/issues/5463
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5463/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5463/comments
|
https://api.github.com/repos/psf/requests/issues/5463/events
|
https://github.com/psf/requests/issues/5463
| 620,984,402
|
MDU6SXNzdWU2MjA5ODQ0MDI=
| 5,463
|
response header has encoding error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25432800?v=4",
"events_url": "https://api.github.com/users/MineEric64/events{/privacy}",
"followers_url": "https://api.github.com/users/MineEric64/followers",
"following_url": "https://api.github.com/users/MineEric64/following{/other_user}",
"gists_url": "https://api.github.com/users/MineEric64/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MineEric64",
"id": 25432800,
"login": "MineEric64",
"node_id": "MDQ6VXNlcjI1NDMyODAw",
"organizations_url": "https://api.github.com/users/MineEric64/orgs",
"received_events_url": "https://api.github.com/users/MineEric64/received_events",
"repos_url": "https://api.github.com/users/MineEric64/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MineEric64/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MineEric64/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MineEric64",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-05-19T13:37:23Z
|
2021-08-31T00:06:58Z
|
2020-05-20T05:22:54Z
|
NONE
|
resolved
|
Summary. some http response header without English (using utf-8) has encoding error.
original text (2. 핵심정보를 담은 발표 형성평가 5월 19일) I uploaded this text on server.
and I responded to server with get function. (`requests.get()`)
but I got this text (2. íµì¬ì 보를 ë´ì ë°í íì±íê° 5ì 19ì¼) from http response header.
I converted the text has encoding error to ascii to utf8 converter. It converts successfully.
maybe requests package gets http response header with ascii encoding.
**EDIT** I tried this code `req.encoding = 'utf-8'` but this code didn't work.
code:
```
headers = {
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7',
'Content-type': 'text/plain; charset=utf-8'
}
req = requests.get(link, headers=headers, allow_redirects=True)
req.encoding = 'utf-8'
print(req.headers['Content-Disposition']) # this code prints the text has encoding error
```
## Expected Result
핵심정보를 담은 발표 형성평가 5월 19일
## Actual Result
íµì¬ì 보를 ë´ì ë°í íì±íê° 5ì 19ì¼
## Reproduction Steps
```python
import requests
```
## System Information
$ python -m requests.help
I am using python 3.7.3, requests latest version (v2.23.0)
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.7.3"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "101000af"
},
"urllib3": {
"version": "1.25.9"
},
"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).
thank you.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25432800?v=4",
"events_url": "https://api.github.com/users/MineEric64/events{/privacy}",
"followers_url": "https://api.github.com/users/MineEric64/followers",
"following_url": "https://api.github.com/users/MineEric64/following{/other_user}",
"gists_url": "https://api.github.com/users/MineEric64/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MineEric64",
"id": 25432800,
"login": "MineEric64",
"node_id": "MDQ6VXNlcjI1NDMyODAw",
"organizations_url": "https://api.github.com/users/MineEric64/orgs",
"received_events_url": "https://api.github.com/users/MineEric64/received_events",
"repos_url": "https://api.github.com/users/MineEric64/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MineEric64/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MineEric64/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MineEric64",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5463/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5463/timeline
| null |
completed
| null | null | false
|
[
"I fixed with code `req.headers['Content-Disposition'].encode(\"ISO-8859-1\").decode(\"utf-8\")`."
] |
https://api.github.com/repos/psf/requests/issues/5462
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5462/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5462/comments
|
https://api.github.com/repos/psf/requests/issues/5462/events
|
https://github.com/psf/requests/issues/5462
| 620,276,105
|
MDU6SXNzdWU2MjAyNzYxMDU=
| 5,462
|
Python Requests normalizes the URL
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2718385?v=4",
"events_url": "https://api.github.com/users/hopkinskong/events{/privacy}",
"followers_url": "https://api.github.com/users/hopkinskong/followers",
"following_url": "https://api.github.com/users/hopkinskong/following{/other_user}",
"gists_url": "https://api.github.com/users/hopkinskong/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hopkinskong",
"id": 2718385,
"login": "hopkinskong",
"node_id": "MDQ6VXNlcjI3MTgzODU=",
"organizations_url": "https://api.github.com/users/hopkinskong/orgs",
"received_events_url": "https://api.github.com/users/hopkinskong/received_events",
"repos_url": "https://api.github.com/users/hopkinskong/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hopkinskong/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hopkinskong/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hopkinskong",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-05-18T14:54:33Z
|
2021-08-31T00:06:57Z
|
2020-05-20T16:31:15Z
|
NONE
|
resolved
|
When requesting a URL (get/post), Requests normalizes the URL.
For example:
```
r = requests.get("http://123.123.123.123/../../../../../../test")
print(str(r.status_code))
```
## Expected Result
```
GET /../../../../../../test HTTP/1.1
Host: 123.123.123.123
Connection: close
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.22.0
```
## Actual Result
```
GET /test HTTP/1.1
Host: 123.123.123.123
Connection: close
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.22.0
```
## Reproduction Steps
```python
import requests
r = requests.get("http://123.123.123.123/../../../../../../test")
print(str(r.status_code))
```
## System Information
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.8"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "2.7.17"
},
"platform": {
"release": "5.3.0-51-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010104f",
"version": "17.5.0"
},
"requests": {
"version": "2.22.0"
},
"system_ssl": {
"version": "1010100f"
},
"urllib3": {
"version": "1.25.6"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2718385?v=4",
"events_url": "https://api.github.com/users/hopkinskong/events{/privacy}",
"followers_url": "https://api.github.com/users/hopkinskong/followers",
"following_url": "https://api.github.com/users/hopkinskong/following{/other_user}",
"gists_url": "https://api.github.com/users/hopkinskong/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hopkinskong",
"id": 2718385,
"login": "hopkinskong",
"node_id": "MDQ6VXNlcjI3MTgzODU=",
"organizations_url": "https://api.github.com/users/hopkinskong/orgs",
"received_events_url": "https://api.github.com/users/hopkinskong/received_events",
"repos_url": "https://api.github.com/users/hopkinskong/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hopkinskong/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hopkinskong/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hopkinskong",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5462/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5462/timeline
| null |
completed
| null | null | false
|
[
"Duplicate of #5289",
"Thanks."
] |
https://api.github.com/repos/psf/requests/issues/5461
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5461/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5461/comments
|
https://api.github.com/repos/psf/requests/issues/5461/events
|
https://github.com/psf/requests/issues/5461
| 619,752,546
|
MDU6SXNzdWU2MTk3NTI1NDY=
| 5,461
|
Treat invalid percent encoding consistently
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/30379553?v=4",
"events_url": "https://api.github.com/users/openandclose/events{/privacy}",
"followers_url": "https://api.github.com/users/openandclose/followers",
"following_url": "https://api.github.com/users/openandclose/following{/other_user}",
"gists_url": "https://api.github.com/users/openandclose/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/openandclose",
"id": 30379553,
"login": "openandclose",
"node_id": "MDQ6VXNlcjMwMzc5NTUz",
"organizations_url": "https://api.github.com/users/openandclose/orgs",
"received_events_url": "https://api.github.com/users/openandclose/received_events",
"repos_url": "https://api.github.com/users/openandclose/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/openandclose/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/openandclose/subscriptions",
"type": "User",
"url": "https://api.github.com/users/openandclose",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] | null | 10
|
2020-05-17T17:02:35Z
|
2020-05-21T17:01:48Z
| null |
NONE
| null |
The present form of ``requote_uri`` unnecessarily divides invalid cases.
When alpha-numeric, '%' is quoted to '%25'.
E.g. ``%pp`` to ``%25pp``.
When not alpha-numeric, '%' is kept as is.
E.g. ``%--`` to ``%--``.
(Note these two examples are in the tests,
and the latter is for ``unquote_unreserved``,
but the result is the same.)
Or ``%<<`` to ``%%3C%3C``.
but I think '%' should be quoted in all invalid cases.
(Or to put it differently, isolated '%' must be quoted.)
| 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/5461/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5461/timeline
| null | null | null | null | false
|
[
"I can not find the rational in the code history.\r\n\r\n(0) The original implementation\r\n(1) Added 'isalnum'\r\n(2) Added try clause and error message.\r\n(3) Added more try clause and one of the present test.\r\n(4) Added another of the present test.\r\n\r\n(0)\r\n**URI cleanup of non-path components**\r\nhttps://github.com/psf/requests/commits?author=mgiuca\r\nhttps://github.com/psf/requests/compare/12f9aa36..690426ac\r\n\r\n(1)\r\n**fix for #630 - unquote_unreserved raising ValueError on invalid URI-escape sequences**\r\nhttps://github.com/psf/requests/pull/641\r\nhttps://github.com/psf/requests/commit/cb15310d6aacd1c1e3b3345b6096d24ea2b79d49\r\n\r\n(2)\r\n**Better percent-escape exception**\r\nhttps://github.com/psf/requests/pull/1514\r\n\r\n(3)\r\n**Attempt to quote anyway if unquoting fails**\r\nhttps://github.com/psf/requests/pull/2393\r\n\r\n(4)\r\n**Added unit tests for utils module**\r\nhttps://github.com/psf/requests/pull/3024",
"@mgiuca himself recently changed his mind.\r\nhttps://github.com/whatwg/url/issues/369#issuecomment-359336557\r\n\r\n(the point of that particular comment is to make '%s -> %s' a special case,\r\nand it may be better to take this into consideration here (later),\r\nbut he agrees on the baseline ('%' -> '%25'))",
"Hello,\r\n\r\nI haven't dug deeply into the issue (but please note that my previous interaction with this project was in 2012, so it's entirely possible I made a mistake or changed my mind since then!) Also note that the entire URL standard has been rewritten since then, the [URL standard](https://url.spec.whatwg.org/) that I'm commenting on in the above quote didn't exist in 2012.\r\n\r\nBased on your above description, I agree that it doesn't make sense to treat `%xx` differently depending on whether `x` is alphanumeric. The best thing to do is probably say \"if xx are both _hex digits_, keep it as-is, otherwise, expand \"%\" to \"%25\". But as you noted, then you will transform \"%s\" into \"%25s\", which breaks URLs that are designed to have things substituted into them later.",
"> But as you noted, then you will transform \"%s\" into \"%25s\", which breaks URLs that are designed to have things substituted into them later.\r\n\r\nExcept that once passed to an HTTP client, nothing will be substituting anything into them later. And if this is being returned as part of a redirect in the Location header then that means that the user will want to handle redirects themselves, otherwise the re-quoting is most likely valid.",
"> if this is being returned as part of a redirect in the Location header\r\n\r\nIs it possible at all, in case of registerProtocolHandler's '%s' url?",
"What are you talking about `registerProtocolHandler`? Are you looking at the right project?",
"It is the only case url parser has to specially handle ``'%' + <single character>``.\r\n\r\nThat's why in the above comment link, mgiuca was considering:\r\n\r\n> \"%s\" -> \"%s\" (with validation error)\r\n> \"%6%3D\" -> \"%6%3D\" (with validation error)\r\n\r\nIn any other cases, my proposal in the first comment should be OK.",
"And it is the concern for *general* url parsers.\r\nI'm not sure, but A HTTP client may not need wholly embrace this.",
"> And it is the concern for _general_ url parsers.\r\n\r\nQuick note that the strings accepted by `registerProtocolHandler` are _not_ technically URLs (after all, they unambiguously are invalid, since you can't follow a `%` with an `s` in URL syntax). They are template strings that, when substituted, form a URL.\r\n\r\nA generic URL parser does not need to be able to handle `%s` properly. It's a question for the authors of a given URL parser whether it's useful to be able to handle `%s` without double-quoting it.",
"@mgiuca thank you!"
] |
https://api.github.com/repos/psf/requests/issues/5460
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5460/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5460/comments
|
https://api.github.com/repos/psf/requests/issues/5460/events
|
https://github.com/psf/requests/issues/5460
| 619,681,679
|
MDU6SXNzdWU2MTk2ODE2Nzk=
| 5,460
|
Make content-type be multi-part without being given files
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19555626?v=4",
"events_url": "https://api.github.com/users/dasyad00/events{/privacy}",
"followers_url": "https://api.github.com/users/dasyad00/followers",
"following_url": "https://api.github.com/users/dasyad00/following{/other_user}",
"gists_url": "https://api.github.com/users/dasyad00/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dasyad00",
"id": 19555626,
"login": "dasyad00",
"node_id": "MDQ6VXNlcjE5NTU1NjI2",
"organizations_url": "https://api.github.com/users/dasyad00/orgs",
"received_events_url": "https://api.github.com/users/dasyad00/received_events",
"repos_url": "https://api.github.com/users/dasyad00/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dasyad00/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dasyad00/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dasyad00",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 12
|
2020-05-17T11:47:05Z
|
2021-08-31T00:06:59Z
|
2020-05-17T12:49:46Z
|
NONE
|
resolved
|
Currently, to post a multipart/form-data with boundaries, you either need to give a File or make the data File-like. This feature aims to allow uploading of data without uploading files.
I am working on a fix with @Marti2203
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/19555626?v=4",
"events_url": "https://api.github.com/users/dasyad00/events{/privacy}",
"followers_url": "https://api.github.com/users/dasyad00/followers",
"following_url": "https://api.github.com/users/dasyad00/following{/other_user}",
"gists_url": "https://api.github.com/users/dasyad00/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dasyad00",
"id": 19555626,
"login": "dasyad00",
"node_id": "MDQ6VXNlcjE5NTU1NjI2",
"organizations_url": "https://api.github.com/users/dasyad00/orgs",
"received_events_url": "https://api.github.com/users/dasyad00/received_events",
"repos_url": "https://api.github.com/users/dasyad00/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dasyad00/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dasyad00/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dasyad00",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5460/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5460/timeline
| null |
completed
| null | null | false
|
[
"When you want to send a form without a file but the form has to be of type 'multipart/form-data' we need to write down the explicit boundary in the content-type header, but this is generated by urllib3 and we cannot predict it or pregenerate it as it is supposed to be random, so we have to \"spoof\" the API by sending the data as a file.",
"There are other libraries that provide you a way to do this without changing the core functionality that millions of people rely on.",
"Here is example code that uses this \"functionality\".\r\n```\r\nimport requests\r\nurl = \"foo.bar\"\r\npayload = {'thing: (None,\"\"\"{'blah': 0 }\"\"\")}\r\nresponse = requests.post(url, files = payload)\r\n```\r\nWhen inspecting [the logic for making a PreparedRequest](https://github.com/psf/requests/blob/9ed5db8ed28e816b597dafd328b342ec95466afa/requests/models.py#L502), it can be seen that if the user gives a content type, it will be placed, but to reach a proper multipart/form-data we need to know the boundary beforehand as the previous comment mentioned. We will make a pull request with a simple fix that changes the logic such that this issue is overcomed.",
"@sigmavirus24 We saw http.client and requests and requests is more simple. I just saw your comment",
"@Marti2203 there are already existing libraries you can use and should be using instead of trying to make this work in Requests core functionality. The project is basically in security-fix-only mode at this point",
"https://toolbelt.readthedocs.io/en/latest/uploading-data.html#streaming-multipart-data-encoder will allow you to do this (since you haven't looked very far on Google it seems)",
"Okay, that I had not known about the \"security-fix-only mode\"",
"Yeah, we have not looked too much into it because we needed something simple and postman recommended requests and http.client",
"\"Requests has support for multipart uploads, but the API means that using that functionality to build exactly the Multipart upload you want can be difficult or impossible.\"(that speaks a lot about some parts of the elegance of the library)",
"@sigmavirus24 Apologies for not taking the time to Google very far. We weren't aware of [requests_toolbelt](https://toolbelt.readthedocs.io/en/latest/index.html) and assumed that all functionalities involved with making requests would be available in one package. Apparently, this wasn't the case and now we see why.",
"@sigmavirus24 On a separate note, it would be nice to have a reference from the **official repository** to [requests_toolbelt](https://pypi.org/project/requests-toolbelt/)",
"There was one once upon a time. I'm not a maintainer here though"
] |
https://api.github.com/repos/psf/requests/issues/5459
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5459/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5459/comments
|
https://api.github.com/repos/psf/requests/issues/5459/events
|
https://github.com/psf/requests/pull/5459
| 618,941,243
|
MDExOlB1bGxSZXF1ZXN0NDE4NTcxNDcx
| 5,459
|
Revert PR 1440, do not modify cookie value
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12461110?v=4",
"events_url": "https://api.github.com/users/yanxurui/events{/privacy}",
"followers_url": "https://api.github.com/users/yanxurui/followers",
"following_url": "https://api.github.com/users/yanxurui/following{/other_user}",
"gists_url": "https://api.github.com/users/yanxurui/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yanxurui",
"id": 12461110,
"login": "yanxurui",
"node_id": "MDQ6VXNlcjEyNDYxMTEw",
"organizations_url": "https://api.github.com/users/yanxurui/orgs",
"received_events_url": "https://api.github.com/users/yanxurui/received_events",
"repos_url": "https://api.github.com/users/yanxurui/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yanxurui/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yanxurui/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yanxurui",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-05-15T12:45:27Z
|
2021-08-28T00:06:25Z
|
2020-07-21T06:29:19Z
|
NONE
|
resolved
|
Revert PR #1440 as discussed in issue #3759
It does not make sense to modify the cookie value arbitrarily.
|
{
"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/5459/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5459/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5459.diff",
"html_url": "https://github.com/psf/requests/pull/5459",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5459.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5459"
}
| true
|
[
"At this point the behaviour is too ingrained to be reverted arbitrarily and would need to wait for a major version release which is not planned to the best of my knowledge",
"This functionality has been in the library for 7 years now, so we can't pull it out without breaking users. If we were to ever put another major version up, this could possibly be looked at, but I don't think we can merge this in 2.x. Thanks for the suggestion!"
] |
https://api.github.com/repos/psf/requests/issues/5458
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5458/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5458/comments
|
https://api.github.com/repos/psf/requests/issues/5458/events
|
https://github.com/psf/requests/issues/5458
| 617,604,293
|
MDU6SXNzdWU2MTc2MDQyOTM=
| 5,458
|
All requests to www.scoutbook.com result in 404s
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/46465633?v=4",
"events_url": "https://api.github.com/users/thatcomputerguy0101/events{/privacy}",
"followers_url": "https://api.github.com/users/thatcomputerguy0101/followers",
"following_url": "https://api.github.com/users/thatcomputerguy0101/following{/other_user}",
"gists_url": "https://api.github.com/users/thatcomputerguy0101/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/thatcomputerguy0101",
"id": 46465633,
"login": "thatcomputerguy0101",
"node_id": "MDQ6VXNlcjQ2NDY1NjMz",
"organizations_url": "https://api.github.com/users/thatcomputerguy0101/orgs",
"received_events_url": "https://api.github.com/users/thatcomputerguy0101/received_events",
"repos_url": "https://api.github.com/users/thatcomputerguy0101/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/thatcomputerguy0101/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/thatcomputerguy0101/subscriptions",
"type": "User",
"url": "https://api.github.com/users/thatcomputerguy0101",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-05-13T16:53:08Z
|
2021-08-31T00:07:00Z
|
2020-05-13T18:02:44Z
|
NONE
|
resolved
|
Any requests to https://www.scoutbook.com and subdirectories result in 404 Not Found errors. Requests using the http library, the urllib library, curl, the Node.JS https library, and a web browser all work and return a 200 status code for the exact same URL.
## Reproduction Steps
```python
import requests
requests.get("https://www.scoutbook.com/") # returns a Response object with 404 status code
```
## Expected Result
A 200 response with the body returned by the following code:
```python
import urllib
urllib.request.urlopen("https://www.scoutbook.com/").read()
```
## Actual Result
A 404 response with the following body:
```html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Requested URL cannot be found</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> td { font-family: verdana, arial, sans-serif; } td { font-size: 12px; } table { margin-left: 50px; } a.al:link {color: #0000ff; text-decoration: none;} a.al:visited {color: #0000ff;text-decoration: none;} a.al:hover {color: #0000ff;text-decoration: underline;} p {line-height: 20px; margin-bottom: 15px;} p.ec {color: red;} p.lid {} </style> <script type="text/javascript"> function timed_redirect(seconds, url) { document.getElementById('countdown').innerHTML = seconds; if (seconds <= 0) window.location = url; else setTimeout('timed_redirect(' + --seconds + ', "' + url + '")', 1000); } </script> </head> <body> <table align="left" width="50%" cellpadding="0" cellspacing="0"> <tr> <td align="left"> <p> </p> <h2>Requested URL cannot be found</h2> <p>We are sorry, but the page you are looking for cannot be found. The page has either been removed, renamed or is temporarily unavailable.</p> <p class="ec">404 Not Found</p><p class="lid">Reference ID: f0106a6c-9538-11ea-af75-126f438b3e33</p> <hr> <p><a href="javascript:history.back(1)">Back to previous page</a> | <a href="/">Proceed to homepage</a></p> </td> </tr> <tr> <td> <p> </p> </td> </tr> </table> </body> </html>
```
## System Information
$ python -m requests.help
```json
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.2"
},
"platform": {
"release": "19.4.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "101000af"
},
"urllib3": {
"version": "1.25.9"
},
"using_pyopenssl": false
}
```
Python 3.7.2, requests installed through pip
|
{
"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/5458/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5458/timeline
| null |
completed
| null | null | false
|
[
"Doing some more testing, it appears as if Scoutbook has just blocked the requests user-agent. When I changed it to something else (even just removing the s from the end of requests), it worked as expected. What confuses me is why they would block the user-agent for this library but not the one for the built-in python libraries.",
"@thatcomputerguy0101 this is very common, you’ll find dozens of other issues with the same problem. They’re intending to stop crawling in the common case which is to just blacklist the most common user agent.\n\nThis isn’t a bug in Requests though and I would consider reaching out to the site on their intent before circumventing their blocking strategy."
] |
https://api.github.com/repos/psf/requests/issues/5457
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5457/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5457/comments
|
https://api.github.com/repos/psf/requests/issues/5457/events
|
https://github.com/psf/requests/issues/5457
| 617,592,048
|
MDU6SXNzdWU2MTc1OTIwNDg=
| 5,457
|
Possible bug or incorrect usage (on my end)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12190639?v=4",
"events_url": "https://api.github.com/users/liquidoshin/events{/privacy}",
"followers_url": "https://api.github.com/users/liquidoshin/followers",
"following_url": "https://api.github.com/users/liquidoshin/following{/other_user}",
"gists_url": "https://api.github.com/users/liquidoshin/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/liquidoshin",
"id": 12190639,
"login": "liquidoshin",
"node_id": "MDQ6VXNlcjEyMTkwNjM5",
"organizations_url": "https://api.github.com/users/liquidoshin/orgs",
"received_events_url": "https://api.github.com/users/liquidoshin/received_events",
"repos_url": "https://api.github.com/users/liquidoshin/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/liquidoshin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/liquidoshin/subscriptions",
"type": "User",
"url": "https://api.github.com/users/liquidoshin",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-05-13T16:34:19Z
|
2021-08-31T00:06:50Z
|
2020-06-15T14:56:34Z
|
NONE
|
resolved
|
Hi so I'm using your requests module and everything was working fine when I was using it with python2. However, now that I'm on Mac OS Catalina and there's only python3 I've had to revise my code a little and now I'm getting some errors. So I have a little bit of code as follows:
response = requests.get(resource,
headers={
"Authorization": "Basic " + base64.b64encode(
self.username + ":" + self.passwd
),
"Accept": datatype
},
proxies={"https": None,
"http": None})
And when I run my script it gives me an error:
File "/Users/dwalker/Documents/workspace/jamfapi/jamfapi_src/jamfapi/jss/JSSRestIface.py", line 48, in jamfApiCall
self.username + ":" + self.passwd
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/base64.py", line 58, in b64encode
encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not 'str'
Now I had issues similar to this in another project when we converted from py2 to py3 and we resolved it by running .decode("utf-8") with the output object we were getting back from a command being run. However, I'm not sure if this is the same issue. Any ideas on what I'm doing wrong here or how I'm using requests incorrectly?
Thank you.
|
{
"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/5457/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5457/timeline
| null |
completed
| null | null | false
|
[
"In Python3, the default encoding for strings changed. I believe if you want a Python2 style string, you need to prefix it with b as in `b\"Byte text\"`. Your issue is probably related to the distinction between string objects and bytes objects. Using decode, you can convert from bytes to string, and encode will convert from string to bytes. The docs probably have better information, with [strings documented here](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str) and [bytes documented here](https://docs.python.org/3/library/stdtypes.html#binary-sequence-types-bytes-bytearray-memoryview).",
"This is your incorrect usage. Also you don't need t oencode that yourself since `auth=(self.username, self.passwd)` would do the trick. You could also use `requests.auth.BasicAuth`.",
"sigmavirus24 so where would I use the auth=(self.username, self.passwd)? I'm a little confused.\r\n",
"First page of the docs demonstrates this https://requests.readthedocs.io/en/master/",
"Resolving since this seems to be addressed. \r\n\r\nDirect link to [auth docs](https://requests.readthedocs.io/en/master/user/authentication/#basic-authentication) for future readers."
] |
https://api.github.com/repos/psf/requests/issues/5456
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5456/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5456/comments
|
https://api.github.com/repos/psf/requests/issues/5456/events
|
https://github.com/psf/requests/issues/5456
| 617,424,468
|
MDU6SXNzdWU2MTc0MjQ0Njg=
| 5,456
|
ValueError: Timeout value connect was Timeout
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3234964?v=4",
"events_url": "https://api.github.com/users/sithara/events{/privacy}",
"followers_url": "https://api.github.com/users/sithara/followers",
"following_url": "https://api.github.com/users/sithara/following{/other_user}",
"gists_url": "https://api.github.com/users/sithara/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sithara",
"id": 3234964,
"login": "sithara",
"node_id": "MDQ6VXNlcjMyMzQ5NjQ=",
"organizations_url": "https://api.github.com/users/sithara/orgs",
"received_events_url": "https://api.github.com/users/sithara/received_events",
"repos_url": "https://api.github.com/users/sithara/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sithara/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sithara/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sithara",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-05-13T12:54:47Z
|
2021-08-31T00:06:59Z
|
2020-05-14T13:34:05Z
|
NONE
|
resolved
|
We have been using docker-compose for running multiple containers. All of a sudden started receiving the below error. There were no updates performed on the server box:
```
[app]# docker-compose ps
Traceback (most recent call last):
File "/bin/docker-compose", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 68, in main
command()
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 118, in perf orm_command
handler(command, command_options)
File "/usr/lib/python2.7/site-packages/compose/cli/main.py", line 601, in ps
self.project.containers(service_names=options['SERVICE'], stopped=True) +
File "/usr/lib/python2.7/site-packages/compose/project.py", line 498, in conta iners
containers = self._labeled_containers(stopped, one_off)
File "/usr/lib/python2.7/site-packages/compose/project.py", line 489, in _labe led_containers
filters={'label': self.labels(one_off=one_off)})])
File "/usr/lib/python2.7/site-packages/docker/api/container.py", line 189, in containers
res = self._result(self._get(u, params=params), True)
File "/usr/lib/python2.7/site-packages/docker/utils/decorators.py", line 47, i n inner
return f(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 183, in _ge t
return self.get(url, **self._set_request_timeout(kwargs))
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 498, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 486, in req uest
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 598, in sen d
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 370, in sen d
timeout=timeout
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpoo l.py", line 582, in urlopen
timeout_obj = self._get_timeout(timeout)
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpoo l.py", line 309, in _get_timeout
return Timeout.from_float(timeout)
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout. py", line 154, in from_float
return Timeout(read=timeout, connect=timeout)
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout. py", line 97, in __init__
self._connect = self._validate_timeout(connect, 'connect')
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/timeout. py", line 127, in _validate_timeout
"int or float." % (name, value))
ValueError: Timeout value connect was Timeout(connect=60, read=60, total=None), but it must be an int or float.
```
Here's my `pip list`
```
pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
awscli (1.11.92)
backports.ssl-match-hostname (3.5.0.1)
botocore (1.5.55)
cached-property (1.3.0)
cffi (1.6.0)
chardet (2.2.1)
colorama (0.3.7)
configobj (4.7.2)
configshell-fb (1.1.25)
cryptography (1.7.2)
custodia (0.3.1)
decorator (3.4.0)
dnspython (1.12.0)
docker (2.3.0)
docker-compose (1.13.0)
docker-pycreds (0.2.1)
dockerpty (0.4.1)
docopt (0.6.2)
docutils (0.13.1)
enum34 (1.0.4)
ethtool (0.8)
functools32 (3.2.3-2)
futures (3.1.1)
gssapi (1.2.0)
idna (2.4)
iniparse (0.4)
iotop (0.6)
ipaclient (4.6.5)
ipaddress (1.0.16)
ipalib (4.6.5)
ipaplatform (4.6.5)
ipapython (4.6.5)
IPy (0.75)
javapackages (1.0.0)
jmespath (0.9.2)
jsonschema (2.6.0)
jwcrypto (0.4.2)
kitchen (1.1.1)
kmod (0.1)
langtable (0.0.31)
lxml (3.2.1)
Magic-file-extensions (0.2)
MySQL-python (1.2.5)
netaddr (0.7.5)
netifaces (0.10.4)
nose (1.3.7)
numpy (1.7.1)
pcp (4.1)
perf (0.1)
pip (9.0.1)
ply (3.4)
policycoreutils-default-encoding (0.1)
psycopg2 (2.5.1)
pyasn1 (0.1.9)
pyasn1-modules (0.0.8)
pycparser (2.14)
pycurl (7.19.0)
pygobject (3.22.0)
pygpgme (0.3)
pyinotify (0.9.4)
pyliblzma (0.5.3)
pyOpenSSL (0.13.1)
pyparsing (1.5.6)
python-augeas (0.5.0)
python-dateutil (2.6.0)
python-dmidecode (3.10.13)
python-ldap (2.4.15)
python-linux-procfs (0.4.9)
python-nss (0.16.0)
python-yubico (1.2.3)
pyudev (0.15)
pyusb (1.0.0b1)
pyxattr (0.5.1)
PyYAML (3.12)
qrcode (5.0.1)
requests (2.11.1)
rsa (3.4.2)
rtslib-fb (2.1.69)
s3transfer (0.1.10)
schedutils (0.4)
seobject (0.1)
sepolicy (1.1)
setuptools (0.9.8)
six (1.9.0)
slip (0.4.0)
slip.dbus (0.4.0)
SSSDConfig (1.16.4)
subscription-manager (1.24.13)
syspurpose (1.24.13)
targetcli-fb (2.1.fb49)
texttable (0.8.8)
urlgrabber (3.10)
urllib3 (1.10.2)
urwid (1.1.1)
virtualenv (15.1.0)
websocket-client (0.40.0)
wheel (0.29.0)
yum-langpacks (0.4.2)
yum-metadata-parser (1.1.4)
You are using pip version 9.0.1, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
```
Kindly request help on fixing this
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3234964?v=4",
"events_url": "https://api.github.com/users/sithara/events{/privacy}",
"followers_url": "https://api.github.com/users/sithara/followers",
"following_url": "https://api.github.com/users/sithara/following{/other_user}",
"gists_url": "https://api.github.com/users/sithara/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sithara",
"id": 3234964,
"login": "sithara",
"node_id": "MDQ6VXNlcjMyMzQ5NjQ=",
"organizations_url": "https://api.github.com/users/sithara/orgs",
"received_events_url": "https://api.github.com/users/sithara/received_events",
"repos_url": "https://api.github.com/users/sithara/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sithara/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sithara/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sithara",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5456/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5456/timeline
| null |
completed
| null | null | false
|
[
"This project don't maintain docker compose where the bug is actually originating and you have Request 2.11.1 installed which is _ancient_ and unsupported. You're also using a vulnerable version of urllib3 in your project so you really need to reconsider your dependency versions. This is not a bug here.",
"Will consider upgrading . Thanks"
] |
https://api.github.com/repos/psf/requests/issues/5455
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5455/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5455/comments
|
https://api.github.com/repos/psf/requests/issues/5455/events
|
https://github.com/psf/requests/issues/5455
| 617,307,432
|
MDU6SXNzdWU2MTczMDc0MzI=
| 5,455
|
please support HTTP/2 and HTTP/3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18223385?v=4",
"events_url": "https://api.github.com/users/hktalent/events{/privacy}",
"followers_url": "https://api.github.com/users/hktalent/followers",
"following_url": "https://api.github.com/users/hktalent/following{/other_user}",
"gists_url": "https://api.github.com/users/hktalent/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hktalent",
"id": 18223385,
"login": "hktalent",
"node_id": "MDQ6VXNlcjE4MjIzMzg1",
"organizations_url": "https://api.github.com/users/hktalent/orgs",
"received_events_url": "https://api.github.com/users/hktalent/received_events",
"repos_url": "https://api.github.com/users/hktalent/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hktalent/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hktalent/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hktalent",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-05-13T09:49:04Z
|
2021-08-31T00:07:00Z
|
2020-05-13T18:05:43Z
|
NONE
|
resolved
|
please support HTTP/2 and HTTP/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"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5455/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5455/timeline
| null |
completed
| null | null | false
|
[
"Hi @hktalent, we don’t have immediate plans to support http/2 or http/3. You can find alternatives for http/2 in the python-hyper project which *I believe* should allow you to use the Requests API as a wrapper around that library."
] |
https://api.github.com/repos/psf/requests/issues/5454
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5454/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5454/comments
|
https://api.github.com/repos/psf/requests/issues/5454/events
|
https://github.com/psf/requests/pull/5454
| 617,006,435
|
MDExOlB1bGxSZXF1ZXN0NDE3MDA4MTc5
| 5,454
|
doc: Include rmax github username
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26015?v=4",
"events_url": "https://api.github.com/users/rmax/events{/privacy}",
"followers_url": "https://api.github.com/users/rmax/followers",
"following_url": "https://api.github.com/users/rmax/following{/other_user}",
"gists_url": "https://api.github.com/users/rmax/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rmax",
"id": 26015,
"login": "rmax",
"node_id": "MDQ6VXNlcjI2MDE1",
"organizations_url": "https://api.github.com/users/rmax/orgs",
"received_events_url": "https://api.github.com/users/rmax/received_events",
"repos_url": "https://api.github.com/users/rmax/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rmax/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rmax/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rmax",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 0
|
2020-05-12T22:33:05Z
|
2021-11-26T05:00:36Z
|
2021-08-28T04:23:46Z
|
CONTRIBUTOR
|
resolved
|
{
"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/5454/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5454/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5454.diff",
"html_url": "https://github.com/psf/requests/pull/5454",
"merged_at": "2021-08-28T04:23:46Z",
"patch_url": "https://github.com/psf/requests/pull/5454.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5454"
}
| true
|
[] |
|
https://api.github.com/repos/psf/requests/issues/5453
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5453/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5453/comments
|
https://api.github.com/repos/psf/requests/issues/5453/events
|
https://github.com/psf/requests/pull/5453
| 616,485,897
|
MDExOlB1bGxSZXF1ZXN0NDE2NTg3MjA0
| 5,453
|
Update Travis syntax
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21086024?v=4",
"events_url": "https://api.github.com/users/edumco/events{/privacy}",
"followers_url": "https://api.github.com/users/edumco/followers",
"following_url": "https://api.github.com/users/edumco/following{/other_user}",
"gists_url": "https://api.github.com/users/edumco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/edumco",
"id": 21086024,
"login": "edumco",
"node_id": "MDQ6VXNlcjIxMDg2MDI0",
"organizations_url": "https://api.github.com/users/edumco/orgs",
"received_events_url": "https://api.github.com/users/edumco/received_events",
"repos_url": "https://api.github.com/users/edumco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/edumco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/edumco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/edumco",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-05-12T09:01:04Z
|
2021-08-28T00:06:30Z
|
2020-05-14T17:37:05Z
|
NONE
|
resolved
|
### This pull request brings the following changes:
- Ordered the commands to follow Travis CI execution order: <https://docs.travis-ci.com/user/job-lifecycle/#the-job-lifecycle>
- Adds explicit os and dist commands protecting from changes on Travis default distro
- Forces the build to use the latest minor version of each python release so build become fully reproducible
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21086024?v=4",
"events_url": "https://api.github.com/users/edumco/events{/privacy}",
"followers_url": "https://api.github.com/users/edumco/followers",
"following_url": "https://api.github.com/users/edumco/following{/other_user}",
"gists_url": "https://api.github.com/users/edumco/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/edumco",
"id": 21086024,
"login": "edumco",
"node_id": "MDQ6VXNlcjIxMDg2MDI0",
"organizations_url": "https://api.github.com/users/edumco/orgs",
"received_events_url": "https://api.github.com/users/edumco/received_events",
"repos_url": "https://api.github.com/users/edumco/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/edumco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/edumco/subscriptions",
"type": "User",
"url": "https://api.github.com/users/edumco",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5453/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5453/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5453.diff",
"html_url": "https://github.com/psf/requests/pull/5453",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5453.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5453"
}
| true
|
[
"We don't want to pin to a minor version. Travis is supposed to auto-upgrade those for us",
"> supposed to auto-upgrade those for us\r\n\r\nI cant revert that, what do you think about the other changes?",
"They're churn, functionally unnecessary, and in some cases useless (see apt caching)"
] |
https://api.github.com/repos/psf/requests/issues/5452
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5452/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5452/comments
|
https://api.github.com/repos/psf/requests/issues/5452/events
|
https://github.com/psf/requests/pull/5452
| 615,306,209
|
MDExOlB1bGxSZXF1ZXN0NDE1NjYxODI5
| 5,452
|
add a dot in end of doc
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/36840497?v=4",
"events_url": "https://api.github.com/users/bestgopher/events{/privacy}",
"followers_url": "https://api.github.com/users/bestgopher/followers",
"following_url": "https://api.github.com/users/bestgopher/following{/other_user}",
"gists_url": "https://api.github.com/users/bestgopher/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bestgopher",
"id": 36840497,
"login": "bestgopher",
"node_id": "MDQ6VXNlcjM2ODQwNDk3",
"organizations_url": "https://api.github.com/users/bestgopher/orgs",
"received_events_url": "https://api.github.com/users/bestgopher/received_events",
"repos_url": "https://api.github.com/users/bestgopher/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bestgopher/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bestgopher/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bestgopher",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-05-10T03:16:48Z
|
2022-02-26T15:00:32Z
|
2021-11-28T14:11:45Z
|
NONE
|
resolved
|
add a dot.
|
{
"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/5452/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5452/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5452.diff",
"html_url": "https://github.com/psf/requests/pull/5452",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5452.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5452"
}
| true
|
[
"Closing this PR, in the future please only open a PR if there is something \"wrong\" with a docstring."
] |
https://api.github.com/repos/psf/requests/issues/5451
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5451/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5451/comments
|
https://api.github.com/repos/psf/requests/issues/5451/events
|
https://github.com/psf/requests/pull/5451
| 615,260,969
|
MDExOlB1bGxSZXF1ZXN0NDE1NjMxMjEx
| 5,451
|
Update supported python version in doc
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4190959?v=4",
"events_url": "https://api.github.com/users/jacty/events{/privacy}",
"followers_url": "https://api.github.com/users/jacty/followers",
"following_url": "https://api.github.com/users/jacty/following{/other_user}",
"gists_url": "https://api.github.com/users/jacty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jacty",
"id": 4190959,
"login": "jacty",
"node_id": "MDQ6VXNlcjQxOTA5NTk=",
"organizations_url": "https://api.github.com/users/jacty/orgs",
"received_events_url": "https://api.github.com/users/jacty/received_events",
"repos_url": "https://api.github.com/users/jacty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jacty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jacty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jacty",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-05-09T21:12:38Z
|
2021-08-28T00:06:15Z
|
2020-11-17T01:49:54Z
|
NONE
|
resolved
|
I think python 3.8 is supported now after I checked some other places in this rep.
|
{
"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/5451/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5451/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5451.diff",
"html_url": "https://github.com/psf/requests/pull/5451",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5451.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5451"
}
| true
|
[
"I think this ended up getting resolved in a more generic way with #5567. Resolving since the issue is addressed. Thanks for the PR @jacty!"
] |
https://api.github.com/repos/psf/requests/issues/5450
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5450/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5450/comments
|
https://api.github.com/repos/psf/requests/issues/5450/events
|
https://github.com/psf/requests/issues/5450
| 615,249,244
|
MDU6SXNzdWU2MTUyNDkyNDQ=
| 5,450
|
timeout 2x as long as parameter
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3632883?v=4",
"events_url": "https://api.github.com/users/minusf/events{/privacy}",
"followers_url": "https://api.github.com/users/minusf/followers",
"following_url": "https://api.github.com/users/minusf/following{/other_user}",
"gists_url": "https://api.github.com/users/minusf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/minusf",
"id": 3632883,
"login": "minusf",
"node_id": "MDQ6VXNlcjM2MzI4ODM=",
"organizations_url": "https://api.github.com/users/minusf/orgs",
"received_events_url": "https://api.github.com/users/minusf/received_events",
"repos_url": "https://api.github.com/users/minusf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/minusf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/minusf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/minusf",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 9
|
2020-05-09T19:58:06Z
|
2021-09-01T00:11:20Z
|
2020-05-10T14:51:52Z
|
NONE
|
resolved
|
It seems that when I set a `timeout`, the exception is raised after `2 * timeout` seconds.
## Expected Result
log message shows up after `timout` seconds.
## Actual Result
```
2020-05-09 21:53:10,148 DEBUG: before get
2020-05-09 21:53:30,167 ERROR: timeout
```
## Reproduction Steps
```python
import requests
logger.debug("before get")
try:
resp = requests.get(some_url, headers=some_headers, timeout=10)
except requests.Timeout:
logger.error("timeout")
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.7.7"
},
"platform": {
"release": "19.4.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010107f"
},
"urllib3": {
"version": "1.25.9"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3632883?v=4",
"events_url": "https://api.github.com/users/minusf/events{/privacy}",
"followers_url": "https://api.github.com/users/minusf/followers",
"following_url": "https://api.github.com/users/minusf/following{/other_user}",
"gists_url": "https://api.github.com/users/minusf/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/minusf",
"id": 3632883,
"login": "minusf",
"node_id": "MDQ6VXNlcjM2MzI4ODM=",
"organizations_url": "https://api.github.com/users/minusf/orgs",
"received_events_url": "https://api.github.com/users/minusf/received_events",
"repos_url": "https://api.github.com/users/minusf/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/minusf/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/minusf/subscriptions",
"type": "User",
"url": "https://api.github.com/users/minusf",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5450/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5450/timeline
| null |
completed
| null | null | false
|
[
"Search past issues. Timeout is not a wall clock timeout. It could be that it took 9.9s for the connection to be made and another 10+s for the read to timeout. Also timeouts are never exact to the nanosecond in any programming language ever.",
"i had a quick look at past issues before posting but nothing jumped out at me. do you have any links?\r\n\r\ni also tried setting `timeout=(10, 0.1)` and the connection timeout still happened after 20s... i'd find it strange to have a read timeout when there is no connection to read from...\r\n\r\ni dont expect nanosecond precision. but 10s and 20s is quite a difference.",
"You're catching `Timeout` as opposed to `ConnectTimeout` or `ReadTimeout`. That means this exception might not be due to a connection timeout as you seem to be assuming. The `ReadTimeout` doesn't timeout on time to first byte, but instead a timeout between bytes received. So if you're _actually_ getting a `ReadTimeout` then 0.1 may be just enough for you to continue to see this.",
"that is a valid point. but it is a `ConnectTimeout`. here is the full stack trace. please note that the next log line shows up more or less after `20` seconds. i guess that would make sense if urrlib3 retried at least another time, but AFAIK that is not the case without overriding it.\r\n\r\n```\r\n2020-05-10 14:21:36,986 DEBUG: before get\r\n2020-05-10 14:21:57,016 ERROR: timeout\r\nTraceback (most recent call last):\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/connection.py\", line 160, in _new_conn\r\n (self._dns_host, self.port), self.timeout, **extra_kw\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/util/connection.py\", line 84, in create_connection\r\n raise err\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/util/connection.py\", line 74, in create_connection\r\n sock.connect(sa)\r\nsocket.timeout: timed out\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/connectionpool.py\", line 677, in urlopen\r\n chunked=chunked,\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/connectionpool.py\", line 381, in _make_request\r\n self._validate_conn(conn)\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/connectionpool.py\", line 976, in _validate_conn\r\n conn.connect()\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/connection.py\", line 308, in connect\r\n conn = self._new_conn()\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/connection.py\", line 167, in _new_conn\r\n % (self.host, self.timeout),\r\nurllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x11043ef10>, 'Connection to some_url timed out. (connect timeout=10)')\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/some_project/venv/lib/python3.7/site-packages/requests/adapters.py\", line 449, in send\r\n timeout=timeout\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/connectionpool.py\", line 725, in urlopen\r\n method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]\r\n File \"/some_project/venv/lib/python3.7/site-packages/urllib3/util/retry.py\", line 439, in increment\r\n raise MaxRetryError(_pool, url, error or ResponseError(cause))\r\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='some_host', port=443): Max retries exceeded with url: /some_url (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x11043ef10>, 'Connection to some_url timed out. (connect timeout=10)'))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/some_project/test.py\", line ...\r\n timeout=10,\r\n File \"/some_project/venv/lib/python3.7/site-packages/requests/api.py\", line 76, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"/some_project/venv/lib/python3.7/site-packages/requests/api.py\", line 61, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/some_project/venv/lib/python3.7/site-packages/requests/sessions.py\", line 530, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/some_project/venv/lib/python3.7/site-packages/requests/sessions.py\", line 643, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/some_project/venv/lib/python3.7/site-packages/requests/adapters.py\", line 504, in send\r\n raise ConnectTimeout(e, request=request)\r\nrequests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='some_host', port=443): Max retries exceeded with url: some_url (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x11043ef10>, 'Connection to some_host timed out. (connect timeout=10)'))\r\n```\r\n",
"in my understanding read timeouts are possible only after a successful connection is made. which is not the case.",
"So the other problem is likely that there are a lot of DNS entries that are slow/unresponsive and we try _all_ of them. I know I've also covered this in closed issues in the past. Since you're not sharing the URL, there's nothing else I can do to help you debug this. \r\n\r\nI guarantee if you tried this with a sane URL (e.g., httpbin.org) then you're likely find that things work as expected. (I say this because very little has changed in this project in the last 3 years, especially not the timeout work.)",
"ah, now this has pointed me in the correct direction, thanks. the url is internal behind a VPN, so no point sharing it. however it is a `CNAME` to a load balanced application with both ipv4 and ipv6 addresses. so urllib3 is either trying the resolved `CNAME` again, or it's the ipv4/6 part.\r\n\r\nnow i need to find out how to stop cold after the first 10s and stop trying the other stuff...\r\n\r\nthank you very much for the clue stick. i guess this is a urllib3 issue and not requests. feel free to close.",
"> now i need to find out how to stop cold after the first 10s and stop trying the other stuff...\r\n\r\nYou want a wall clock timeout. That's not implementable in requests or urllib3. Please go read those issues.\r\n\r\n> i guess this is a urllib3 issue and not requests. feel free to close\r\n\r\nI am not a maintainer here. ",
"i think what i want is ipv4 only but thanks for the help! :D"
] |
https://api.github.com/repos/psf/requests/issues/5449
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5449/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5449/comments
|
https://api.github.com/repos/psf/requests/issues/5449/events
|
https://github.com/psf/requests/issues/5449
| 614,907,671
|
MDU6SXNzdWU2MTQ5MDc2NzE=
| 5,449
|
How to propagate cookie policies through posts?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/51006466?v=4",
"events_url": "https://api.github.com/users/karres-illinois/events{/privacy}",
"followers_url": "https://api.github.com/users/karres-illinois/followers",
"following_url": "https://api.github.com/users/karres-illinois/following{/other_user}",
"gists_url": "https://api.github.com/users/karres-illinois/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/karres-illinois",
"id": 51006466,
"login": "karres-illinois",
"node_id": "MDQ6VXNlcjUxMDA2NDY2",
"organizations_url": "https://api.github.com/users/karres-illinois/orgs",
"received_events_url": "https://api.github.com/users/karres-illinois/received_events",
"repos_url": "https://api.github.com/users/karres-illinois/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/karres-illinois/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/karres-illinois/subscriptions",
"type": "User",
"url": "https://api.github.com/users/karres-illinois",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] | null | 5
|
2020-05-08T18:29:00Z
|
2020-05-11T14:25:09Z
| null |
NONE
| null |
Hi,
I am using Python 3.8 and the latest pip updates of everything mentioned below.
I am trying to consume a very old, but active SOAP resource. I am using Zeep for the SOAP part. The SOAP service is so old that I need to set a special cookie policy to handle the fact that the old SOAP service returns obsolete `set-cookie2` headers. I am new to this so there could be better ways but the first few executable lines of my code sample (at the bottom) create a dummy cookie to establish a cookie policy that *should* pull in the obsolete cookies.
THe dummy cookie is attached to the session and the SOAP "login" method is called. I have stepped through the execution path (most recent on top). Everything above the "transports" lines is in the your domain I think.
```
merge_cookies, cookies.py:549
prepare_request, sessions.py:441
request, sessions.py:516
post, sessions.py:578
post, transports.py:61
post_xml, transports.py:107
send, soap.py:122
__call__, proxy.py:40
<module>, zeep_test.py:31
```
I have modified Zeep's code to send the session cookies to your "post" method in the "kwargs".
```
response = self.session.post(
address, data=message, headers=headers,
timeout=self.operation_timeout,
cookies=self.session.cookies
)
```
"post" calls "request" calls "prepare_request" calls "merge_cookies". That code is:
```
# Merge with session cookies
merged_cookies = merge_cookies(
merge_cookies(RequestsCookieJar(), self.cookies), cookies)
```
In my case the passed in cookie is a "cookielib.CookieJar". The line:
```
try:
cookiejar.update(cookies)
```
is executed but the "cookielib.CookieJar" policies are NOT copied over. I don't know what to do about that. Is there a better way to set a global cookie policy?
A relevant portion of my code is:
```
import requests
from requests import Session, cookies
from zeep import Client, Settings
from zeep.cache import SqliteCache
from zeep.transports import Transport
from http.cookiejar import CookieJar, DefaultCookiePolicy
policy = DefaultCookiePolicy(rfc2965=True)
cj = CookieJar(policy)
cj.set_cookie(requests.cookies.create_cookie(name="dummy", value="dummy"))
my_session = Session()
my_session.cookies = cj
my_settings = Settings(strict=False)
my_cache = SqliteCache()
my_url = 'https://lists.mycompany.com/lists/wsdl'
client = Client(
my_url,
transport=Transport(
session=my_session,
cache=my_cache
),
settings=my_settings
)
response = client.service.login(email="Me",
password="mememe")
```
| null |
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/5449/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5449/timeline
| null | null | null | null | false
|
[
"Hi @karres-illinois,\r\n\r\nThanks for bringing this up! We've known about this issue for a good while now and there's been a lot of debate about whether people actually use the Python cookie policies in their code. There's a PR from some time ago #3463 that was intended to address this that never got merged.\r\n\r\nGiven we've seen a few comments around this over the last 6 months, it may be time to revisit. I'll try to spin back up that old patch rebased onto current Requests and see if it's still an option.",
"@nateprewitt it's basically a nightmare to do correctly without breaking a bunch of nonsense in the midst of it. I'm happy to pair on it at some point if you'd like.",
"I dig that there is debate about this and that I may have a corner case. Is there any workaround you can suggest? ",
"> I dig that there is debate about this and that I may have a corner case. Is there any workaround you can suggest?\r\n\r\nTo be clear @karres-illinois, there's no debate that you're correct about this being a thing the library should do. It's more about wiring it into the library which already does some bizarre things to act like an art project. There's a fair amount of monkey-patching that you'd have to do. It also requires the Cookie Jar class that is in this library be _completely_ rewritten if I remember correctly.\r\n\r\nAll of that is to say \"I don't recall if there's a good way to achieve what you want\"",
"Ah, thanks. I'll keep an interested eye on this over time. good luck."
] |
https://api.github.com/repos/psf/requests/issues/5448
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5448/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5448/comments
|
https://api.github.com/repos/psf/requests/issues/5448/events
|
https://github.com/psf/requests/issues/5448
| 613,383,513
|
MDU6SXNzdWU2MTMzODM1MTM=
| 5,448
|
urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/64898062?v=4",
"events_url": "https://api.github.com/users/ShunTono/events{/privacy}",
"followers_url": "https://api.github.com/users/ShunTono/followers",
"following_url": "https://api.github.com/users/ShunTono/following{/other_user}",
"gists_url": "https://api.github.com/users/ShunTono/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ShunTono",
"id": 64898062,
"login": "ShunTono",
"node_id": "MDQ6VXNlcjY0ODk4MDYy",
"organizations_url": "https://api.github.com/users/ShunTono/orgs",
"received_events_url": "https://api.github.com/users/ShunTono/received_events",
"repos_url": "https://api.github.com/users/ShunTono/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ShunTono/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ShunTono/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ShunTono",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2020-05-06T14:52:45Z
|
2021-09-01T00:11:22Z
|
2020-05-06T22:41:58Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/64898062?v=4",
"events_url": "https://api.github.com/users/ShunTono/events{/privacy}",
"followers_url": "https://api.github.com/users/ShunTono/followers",
"following_url": "https://api.github.com/users/ShunTono/following{/other_user}",
"gists_url": "https://api.github.com/users/ShunTono/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ShunTono",
"id": 64898062,
"login": "ShunTono",
"node_id": "MDQ6VXNlcjY0ODk4MDYy",
"organizations_url": "https://api.github.com/users/ShunTono/orgs",
"received_events_url": "https://api.github.com/users/ShunTono/received_events",
"repos_url": "https://api.github.com/users/ShunTono/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ShunTono/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ShunTono/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ShunTono",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5448/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5448/timeline
| null |
completed
| null | null | false
|
[
"What do your proxy settings look like? I suspect this is an error in how you're configuring them just like the issue you commented on and referenced",
"Yes. I have no clue what the right values would be for you though. This is not a bug in requests. Please close it. ",
"Then ask on StackOverflow for help learning how to use proxy servers. This isn't a tech support forum to help you, it's a defect tracker for this project and it's been identified that there is no defect in this report",
"Sorry, I misunderstood. I will delete this issue page."
] |
|
https://api.github.com/repos/psf/requests/issues/5447
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5447/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5447/comments
|
https://api.github.com/repos/psf/requests/issues/5447/events
|
https://github.com/psf/requests/issues/5447
| 612,483,449
|
MDU6SXNzdWU2MTI0ODM0NDk=
| 5,447
|
How to set an effective useragent for Session?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/58616477?v=4",
"events_url": "https://api.github.com/users/raisoon/events{/privacy}",
"followers_url": "https://api.github.com/users/raisoon/followers",
"following_url": "https://api.github.com/users/raisoon/following{/other_user}",
"gists_url": "https://api.github.com/users/raisoon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/raisoon",
"id": 58616477,
"login": "raisoon",
"node_id": "MDQ6VXNlcjU4NjE2NDc3",
"organizations_url": "https://api.github.com/users/raisoon/orgs",
"received_events_url": "https://api.github.com/users/raisoon/received_events",
"repos_url": "https://api.github.com/users/raisoon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/raisoon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/raisoon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/raisoon",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-05-05T10:02:24Z
|
2021-08-31T00:06:48Z
|
2020-06-17T20:21:02Z
|
NONE
|
resolved
|
I have set a useragent for the requests session:
session = requests.session()
headers = {}
headers['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36'
resp = session.get('http://www.gov.cn',headers=headers)
print(session.headers)
but in the result, the user-agent is 'python-requests/2.22.0'.
{'User-Agent': 'python-requests/2.22.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
how can i set an effective useragent?
|
{
"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/5447/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5447/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.",
"@raisoon the `headers=headers` is only passed onto the get request itself... \r\n\r\nHowever if you want to set it permanently..\r\n\r\n```python\r\nimport requests\r\nfrom requests_toolbelt.utils import dump\r\n\r\nsession = requests.session()\r\nsession.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36'\r\nresp = session.get('http://www.gov.cn')\r\n\r\nprint(dump.dump_all(resp).decode('utf-8'))\r\n```\r\n\r\nI've included you a better debug to see the request sent as well :)",
"It looks like this ended up answered, going to resolve."
] |
https://api.github.com/repos/psf/requests/issues/5446
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5446/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5446/comments
|
https://api.github.com/repos/psf/requests/issues/5446/events
|
https://github.com/psf/requests/issues/5446
| 612,397,162
|
MDU6SXNzdWU2MTIzOTcxNjI=
| 5,446
|
Modified file content after upload
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/54662729?v=4",
"events_url": "https://api.github.com/users/ssy-lehmann/events{/privacy}",
"followers_url": "https://api.github.com/users/ssy-lehmann/followers",
"following_url": "https://api.github.com/users/ssy-lehmann/following{/other_user}",
"gists_url": "https://api.github.com/users/ssy-lehmann/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ssy-lehmann",
"id": 54662729,
"login": "ssy-lehmann",
"node_id": "MDQ6VXNlcjU0NjYyNzI5",
"organizations_url": "https://api.github.com/users/ssy-lehmann/orgs",
"received_events_url": "https://api.github.com/users/ssy-lehmann/received_events",
"repos_url": "https://api.github.com/users/ssy-lehmann/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ssy-lehmann/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ssy-lehmann/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ssy-lehmann",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-05-05T07:30:16Z
|
2021-09-01T00:11:22Z
|
2020-05-08T04:36:36Z
|
NONE
|
resolved
|
Also I have been looking into documentation I didn't found the problem/explanation.
## Szenario:
- The server does use WebDav and I can use a PUT request for uploading
- In addition it must be digest authentication
- it works with curl using --digest and --user "xxxxxxx:yyyyyy"
The difference between curl and the Python script after here is
that the script seems to modify the content of the file while uploading.
If I look at http://internal-demo-url/uploads/demo.properties the
content looks like following:
## The uploaded file
```
--6cb2e8363c8d7f9191d2068b62828985
Content-Disposition: form-data; name="file"; filename="demo.properties"
Content-Type: text/plain
title=demo
context=upload
message=hello world 3!
--6cb2e8363c8d7f9191d2068b62828985--
````
Of course I just would like to have the three lines in the middle.
**What did I wrong?**
## The Python code (upload.py)
```python
from requests import put
from requests.auth import HTTPDigestAuth
url = 'http://internal-demo-url/uploads'
with open('demo.properties', 'rb') as handle:
headers = {}
files = {'file':('demo.properties', handle, 'text/plain')}
response = put(url, auth=HTTPDigestAuth('xxxxxx', 'yyyyyy'),
files=files, headers=headers)
print(response.status_code)
```
|
{
"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/5446/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5446/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.",
"I'm cautious to say \"it is a bug\" however I see that the library is doing the stuff (while curl does not) and I don't see it documented on your side (except I missed it). From this I think the issue should be ok. Anyway I will ask on stackoverflow to make you happy ...",
"You've filed an issue that `files` is doing a `multipart/form-data` upload and that's not what cURL does with no description of how you're using curl or what format you expect the data to be in. `files` is documented to send data this way (that's its entire point) and thus either you've not read the docs and are using the wrong options (and need help from stackoverflow) or you think there's a bug in the encoding being used (which there decidedly is not)."
] |
https://api.github.com/repos/psf/requests/issues/5445
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5445/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5445/comments
|
https://api.github.com/repos/psf/requests/issues/5445/events
|
https://github.com/psf/requests/issues/5445
| 611,401,340
|
MDU6SXNzdWU2MTE0MDEzNDA=
| 5,445
|
utf-8 page wrongly detected as ISO-8859-1
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3165583?v=4",
"events_url": "https://api.github.com/users/klartext/events{/privacy}",
"followers_url": "https://api.github.com/users/klartext/followers",
"following_url": "https://api.github.com/users/klartext/following{/other_user}",
"gists_url": "https://api.github.com/users/klartext/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/klartext",
"id": 3165583,
"login": "klartext",
"node_id": "MDQ6VXNlcjMxNjU1ODM=",
"organizations_url": "https://api.github.com/users/klartext/orgs",
"received_events_url": "https://api.github.com/users/klartext/received_events",
"repos_url": "https://api.github.com/users/klartext/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/klartext/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/klartext/subscriptions",
"type": "User",
"url": "https://api.github.com/users/klartext",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-05-03T12:21:41Z
|
2021-08-30T00:06:23Z
|
2020-07-21T06:06:03Z
|
NONE
|
resolved
|
A webpage has been detcected as being ISO-8859-1 encoded, even though it is encoded in utf-8.
## Expected Result
Correct classification as utf-8.
## Actual Result
utf-8 page detected as ISO-8859-1.
## Reproduction Steps
```
#!/usr/bin/python
import requests
# example url
url = "https://digitalezivilgesellschaft.org/"
# get the page and print the supposed encoding
response = requests.get(url)
print(response.encoding)
```
Compare that with
```
rm -f index.html; wget -nv https://digitalezivilgesellschaft.org/ 2>/dev/null&& file index.html | grep index | tail -1
```
## System Information
$ python -m requests.help
```
explore_requests_bug$ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.8.2"
},
"platform": {
"release": "5.6.8-arch1-1",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010107f"
},
"urllib3": {
"version": "1.25.9"
},
"using_pyopenssl": false
}
```
This concrete problem seems to be related to the more general issue
https://github.com/psf/requests/issues/2086
|
{
"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/5445/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5445/timeline
| null |
completed
| null | null | false
|
[
"you can gei it like this:\r\n```python\r\nresponse.content.decode(\"utf8\")\r\n```\r\nnot\r\n```python\r\nresponse.text\r\n```",
"Hi @klartext, if a webpage fails to specify its encoding, we'll default to ISO-8859-1 which has been the spec since RFC 7230. This is starting to change, but we're in an inconsistent state for now. We've kept the functionality for backwards compatibility and it still seems to be the correct case more often.\r\n\r\nTo resolve this issue you can either do as @GoddessLuBoYan suggests above, or set the `encoding` attribute on your Response object before calling `text`. This will do the decoding for you."
] |
https://api.github.com/repos/psf/requests/issues/5444
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5444/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5444/comments
|
https://api.github.com/repos/psf/requests/issues/5444/events
|
https://github.com/psf/requests/issues/5444
| 610,673,102
|
MDU6SXNzdWU2MTA2NzMxMDI=
| 5,444
|
requests.get() with both a query string in URL and params defined does not adhere to HTML5 specifications for form interaction
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/64635888?v=4",
"events_url": "https://api.github.com/users/snorpdorp/events{/privacy}",
"followers_url": "https://api.github.com/users/snorpdorp/followers",
"following_url": "https://api.github.com/users/snorpdorp/following{/other_user}",
"gists_url": "https://api.github.com/users/snorpdorp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/snorpdorp",
"id": 64635888,
"login": "snorpdorp",
"node_id": "MDQ6VXNlcjY0NjM1ODg4",
"organizations_url": "https://api.github.com/users/snorpdorp/orgs",
"received_events_url": "https://api.github.com/users/snorpdorp/received_events",
"repos_url": "https://api.github.com/users/snorpdorp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/snorpdorp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/snorpdorp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/snorpdorp",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2020-05-01T09:57:47Z
|
2021-09-01T00:11:21Z
|
2020-05-08T14:49:17Z
|
NONE
|
resolved
|
[As per HTML5 specifications section "4.10.22.3 Form submission algorithm"](https://www.w3.org/TR/2011/WD-html5-20110525/association-of-controls-and-forms.html#form-submission-algorithm) , when a form with an action which contains a query string, and has a method of GET is executed, the query string in the action should be completely ignored and overwritten by the query string generated by the form.
However, in requests, when a request is formed with an URL including a query string, as well as a params parameter, the 2 query strings are merged, with both being used.
(I have no idea why any website would ever produce such a form, but this is explicitly mentioned in the specifications.)
There may be some debate over whether this is to be intended behavior or not: there is no strict implication that a GET with param data is meant specifically to emulate behavior of an HTML form, although that would seem to be the most common case to me. Some HTTP APIs may have some endpoint which includes a query string and also request additional data to be sent as part of the query string. However, [OpenAPI](https://swagger.io/docs/specification/describing-parameters/) does not mention anything about what to do if an endpoint itself contains a query string, only stating to "Query parameters are the most common type of parameters. They appear at the end of the request URL after a question mark (?), with different name=value pairs separated by ampersands (&). Query parameters can be required and optional."
This also makes it sound like explicitly mentioned "params" parameter should refer to everything after the question-mark delimiter, but I do not think they meant to be so specific as to talk about this strange edge-case.
So it seems that regardless of RESTful APIs, or sending GET forms, the parameters sent to the server should be the ones explicitly mentioned in params, and the parameters given to requests in the url should be ignored.
```
import requests
request = requests.Request(method="GET", url="https://somewebsite.com?pointless+key=pointless+value", params={"actual key": "actual value"})
session = requests.Session()
prepared_request = session.prepare_request(request)
print(request.url)
```
## Expected Result
```
https://somewebsite.com/?actual+key=actual+value
```
## Actual Result
```
https://somewebsite.com/?pointless+key=pointless+value&actual+key=actual+value
```
## Reproduction Steps
```
import requests
request = requests.Request(method="GET", url="https://somewebsite.com?pointless+key=pointless+value", params={"actual key": "actual value"})
session = requests.Session()
prepared_request = session.prepare_request(request)
print(request.url)
```
## System Information
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.3"
},
"platform": {
"release": "19.4.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "20000000"
},
"urllib3": {
"version": "1.24.1"
},
"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/5444/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5444/timeline
| null |
completed
| null | null | false
|
[
"Requests' behaviour is defined by RFC 7230, 7231, 7232, 7233, 7234, and 7235 none of which indicate your expectations as required behaviour. This behaviour has also been present for nearly a decade. Finally, Requests is in a feature freeze and the maintainers are (more-or-less) only fixing security issues. You can easily handle this yourself. ",
"@sigmavirus24 sorry to hijack the thread, but why is **Requests** in a `feature freeze`? is this because 3.x is coming?",
"@VeNoMouS Requests has been in a feature freeze for the majority of its existence. The goal of the project's scope was summed up pretty well [here](https://github.com/psf/requests/issues/1195#issuecomment-13574363) in 2013. I think our definition of \"freeze\" has changed a handful of times since then but the guiding idea is still there.\r\n\r\n3.x is an elephant in the room. We have a branch with proposed changes and a lot of hard work from former maintainers and many other contributors. A significant amount of scope creep was tacked onto this and prematurely promised as a \"Requests 3.0\" which we weren't in a place to deliver on. I've given a lot of thought to just releasing what's done but we don't have enough support to triage latent bugs or inevitable backlash of what the next major version \"doesn't do\".\r\n\r\nSeth and the urllib3 team are still making valuable improvements that Requests benefits from and we may eventually get to a point of delivering some incarnation of a new major version. For the time being, we're running on Sigmavirus' generous gifts of time and an issue management bot.",
"@nateprewitt hey thanks for the quick and well put response ❤️ "
] |
https://api.github.com/repos/psf/requests/issues/5443
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5443/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5443/comments
|
https://api.github.com/repos/psf/requests/issues/5443/events
|
https://github.com/psf/requests/pull/5443
| 610,027,008
|
MDExOlB1bGxSZXF1ZXN0NDExNTI4NDQ3
| 5,443
|
Don't use pyOpenSSL unless no SNI is detected
|
{
"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
| true
| null |
[] | null | 18
|
2020-04-30T13:57:50Z
|
2021-08-28T00:06:28Z
|
2020-05-01T23:33:52Z
|
MEMBER
|
resolved
|
This is part 1 on removing `requests[security]` extra, for now we can still support SNI-less installations of Python but instead of unconditional monkey-patching we only patch if we detect either no `ssl` module or no `SNI` support.
Related: https://github.com/psf/requests/issues/5267
cc @tiran
An additional thought I had was if we wanted to warn users about the complete removal of `requests[security]` I don't think there's a way to detect if you were installed via `requests pyopenssl` or `requests[security]` beyond registering a name on PyPI like `requests-security-extra`, trying to import it, and if we do then we know we were installed via `requests[security]` so throw a deprecation warning? Otherwise our "end-goal" could be to have `requests[security]` be empty?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 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/5443/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5443/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5443.diff",
"html_url": "https://github.com/psf/requests/pull/5443",
"merged_at": "2020-05-01T23:33:52Z",
"patch_url": "https://github.com/psf/requests/pull/5443.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5443"
}
| true
|
[
"I think this looks pretty straight forward and I agree we want to start moving away from PyOpenSSL by default. The only Python versions we'd expect to still be using pyopenssl after this would be <2.7.9, right? I'm think I'm fine approving but would like a second peek from Tiran or @sigmavirus24 if possible.\r\n\r\nAs for `requests[security]`, I'd rather not have the end state be a no-op placeholder if we can avoid it. The package idea is a little clunky but seems like a clever approach to getting things fully removed. If it's just placing a onetime dummy package in PyPI that we use to set a flag for the DeprecationWarning, I don't see issues with that.",
"I already have the name registered FYI: https://pypi.org/project/requests-security-extra\r\nCan detect with `import requests_security_extra`. If others agree I'll add that to this PR as well.\r\n\r\nSomething like:\r\n\r\n```python\r\ntry:\r\n import requests_security_extra\r\n warnings.warn(\r\n \"Installing 'requests[security]' is deprecated and will be removed in a future version of Requests. \"\r\n \"After changing your pip installs to remove [security] you can run \"\r\n \"'python -m pip uninstall requests-security-extra' to silence this DeprecationWarning\",\r\n category=DeprecationWarning\r\n )\r\nexcept ImportError:\r\n pass\r\n```",
"What I'll also say if we don't necessarily **need** to deprecate the extra since the worst that happens with the latest pip if the dist doesn't include the extra you asked for is to warn the user. So maybe that isn't as necessary as I originally thought?",
"So if we're doing better feature detection of the cases when we need to inject PyOpenSSL, why break backwards compatibility by removing `requests[security]`? We should also be documenting this change in behaviour as well as how folks can get back to the old behaviour (by calling `inject_openssl` or whatever it's called) themselves. I understand all of @tiran's objections but I don't think deprecating the extra is a reasonable or workable solution for everyone. Beyond that, distro packagers have their solution where necessary. `__init__.py` doesn't change so drastically that carrying that patch forward is difficult or opprobrious. \r\n\r\nThis was never meant to be a perfect solution, it was just the best solution within the constraints of an art project that reluctantly tried to be secure. I fear y'all will have more headaches trying to remove this than not and your ability to have a functioning inbox is important to me (and it should be important to you too)",
"@sigmavirus24 That's true, we can keep the extra as-is. As far as this patch looks now though you're in favor?\n\nCan definitely add a changelog entry. ",
"The proposed PR is a good compromise between backwards compatibility and my requested change. My main pain point was the fact that requests changed behavior depending on the presence of a 3rd party package and that PyOpenSSL is not compatible with W^X memory protection of modern CPUs.\r\n\r\nHow about documenting ``requests[security]`` as deprecated then? You could remove at the same time as Python 2 support in the distant future.",
"> How about documenting `requests[security]` as deprecated then? You could remove at the same time as Python 2 support in the distant future.\r\n\r\nThat seems like a great idea. By that point Requests should also just be supporting something like 3.6+ or 3.7+ so there should be no reason for PyOpenSSL (ideally :crossed_fingers: )\r\n\r\n> My main pain point was the fact that requests changed behavior depending on the presence of a 3rd party package and that PyOpenSSL is not compatible with W^X memory protection of modern CPUs.\r\n\r\nRight, last night I fell asleep wondering \"Why does @tiran even care? No one does `rpm install python-requests[security]` and then I realized that something else might depend on PyOpenSSL and that would cause the problem. ",
"> Right, last night I fell asleep wondering \"Why does @tiran even care? No one does `rpm install python-requests[security]` and then I realized that something else might depend on PyOpenSSL and that would cause the problem.\r\n\r\nI care because PyOpenSSL doesn't play nice with security hardening and ``inject_into_urllib3`` can cause bugs that are hard to debug.\r\n\r\nThe main system stacks at $JOB includes a Python webservice that runs on Apache and mod_wsgi. An SELinux policy prevents Apache to create memory pages with mmap that are both writeable and executable. In general it's a terrible idea because it allows an attacker to run arbitrary native code easily. This all works fine with default set of packages that do not include PyOpenSSL.\r\n\r\nBut some $CUSTOMERS also install additional packages. One of the packages depends on PyOpenSSL. As soon as PyOpenSSL is present **and** Apache is restarted, requests starts to behave differently, triggers SELinux violations, and the main API service is broken. The Apache service often runs for days, weeks or longer without restart. There is no apparent causation between the problem and PyOpenSSL. First time we had a lot of \"fun\" figuring out the cause of the problem...\r\n\r\nI came up with this workaround: https://github.com/freeipa/freeipa/commit/dea059d158efe82ba71fe4e4669adb7caf45bc9f",
"@tiran Yikes! 😱",
"Actually can we get a quick change log added for this too, @sethmlarson?",
"@nateprewitt Sure thing, it'll be done in half an hour. :)",
"@nateprewitt Done, let me know if you want to change the verbage.",
"Thanks all for the reviews! :tada: ",
"I just wanted to let you know that I am using PyOpenSSL integration not because of Python 2 issues but because the ability to use client-side keys and certificates provided as raw bytes instead of files (via https://www.pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.use_certificate and https://www.pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.use_privatekey) which seems to be difficult otherwise.",
"@saper Thanks for bringing that use-case to my attention! If you still need pyOpenSSL support you can manually call `urllib3.contrib.pyopenssl.inject_into_urllib3()`",
"@sethmlarson Yes, this is what I ultimately did because I only had `pyopenssl.OpenSSL.SSL.Context` monkeypatched in. It took me few hours to track this down to the unexpected update (I was getting SSL certificate verification errors). Leaving the project working in the afternoon and coming back in the evening and have everything broken by itself can be frustrating :)\r\n\r\nTime to pin the dependencies I guess :/ Big thanks for documenting it clearly here though - once I realized the release was out 6 hours earlier I figured it out very quickly.",
"> I just wanted to let you know that I am using PyOpenSSL integration not because of Python 2 issues but because the ability to use client-side keys and certificates provided as raw bytes instead of files (via [pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.use_certificate](https://www.pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.use_certificate) and [pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.use_privatekey](https://www.pyopenssl.org/en/stable/api/ssl.html#OpenSSL.SSL.Context.use_privatekey)) which seems to be difficult otherwise.\r\n\r\nYou can load certs and keys from a raw bytes with Python's ssl module, too. Just dump them into a temporary directory, load them from file, and remove the directory after you have loaded the files. Python ensures that a temporary directory is only accessible by the current effective user. This makes the approach safe. There is no risk when the key is secured with PKCS#8 PBE2.\r\n\r\nThere is a minimal risk if the key is not encrypted, you are running multiple untrusted processes under the same EUID and you have partly hardened the system. You can mitigate the risk by implementing privilege separation.\r\n\r\nIn all other cases loading private keys from raw bytes is **less** secure than loading it from files! OpenSSL does a far better job than Python when it comes to managing and cleaning memory that holds sensitive data. Just consider this example:\r\n\r\n```\r\n$ python3\r\n>>> import os\r\n>>> os.getpid()\r\n2258735\r\n>>> s = \"MY SUPER SECRET KEY\"\r\n```\r\n\r\n```\r\n$ gcore -o /tmp/dump 2258735\r\n$ strings /tmp/dump.2258735 | grep \"MY SUPER SECRET KEY\"\r\n = \"MY SUPER SECRET KEY\"\r\n>> s = \"MY SUPER SECRET KEY\"\r\n = \"MY SUPER SECRET KEY\r\ns = \"MY SUPER SECRET KEY\"\r\nMY SUPER SECRET KEY\r\n```",
"@tiran Sure, I know I can't trust anything like Python too much. I am not sure I always have a writable filesystem and other things (just being fed with PKCS#12 files). For proper key security I'd need to go the PKCS#11 route, but that has other issues (like poor library support)."
] |
https://api.github.com/repos/psf/requests/issues/5442
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5442/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5442/comments
|
https://api.github.com/repos/psf/requests/issues/5442/events
|
https://github.com/psf/requests/issues/5442
| 608,105,258
|
MDU6SXNzdWU2MDgxMDUyNTg=
| 5,442
|
How to access token based API using requests in python?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/56999733?v=4",
"events_url": "https://api.github.com/users/vvksahoo/events{/privacy}",
"followers_url": "https://api.github.com/users/vvksahoo/followers",
"following_url": "https://api.github.com/users/vvksahoo/following{/other_user}",
"gists_url": "https://api.github.com/users/vvksahoo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/vvksahoo",
"id": 56999733,
"login": "vvksahoo",
"node_id": "MDQ6VXNlcjU2OTk5NzMz",
"organizations_url": "https://api.github.com/users/vvksahoo/orgs",
"received_events_url": "https://api.github.com/users/vvksahoo/received_events",
"repos_url": "https://api.github.com/users/vvksahoo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/vvksahoo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vvksahoo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/vvksahoo",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-04-28T07:55:30Z
|
2021-09-01T00:11:25Z
|
2020-04-30T15:53:00Z
|
NONE
|
resolved
|
I want to call one API from another API. So external API is having jwt token based authentication .
```
import requests
response = requests.get('http://host:port/api/users', auth= ("username","password"))
````
I am getting error :
```
{"error":"authentication failed: jwt parse error: token contains an invalid number of segments","code":16,"message":"authentication failed: jwt parse error: token contains an invalid number of segments","details":[]}
```
Or , First i need to call login API ,get the token and while calling another API apply that token in header.
Please suggest here.
|
{
"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/5442/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5442/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.",
"Please find the StackOverflow link for the same issue. \r\nhttps://stackoverflow.com/questions/61482014/how-to-access-token-based-api-using-requests-module-in-python",
"Looks like the StackOverflow issue has some answers in it, resolving this."
] |
https://api.github.com/repos/psf/requests/issues/5441
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5441/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5441/comments
|
https://api.github.com/repos/psf/requests/issues/5441/events
|
https://github.com/psf/requests/pull/5441
| 607,860,646
|
MDExOlB1bGxSZXF1ZXN0NDA5NzUzMTQw
| 5,441
|
Strip double-quotes on proxy environment variables and add test (issue #4613)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/216653?v=4",
"events_url": "https://api.github.com/users/bluebird75/events{/privacy}",
"followers_url": "https://api.github.com/users/bluebird75/followers",
"following_url": "https://api.github.com/users/bluebird75/following{/other_user}",
"gists_url": "https://api.github.com/users/bluebird75/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bluebird75",
"id": 216653,
"login": "bluebird75",
"node_id": "MDQ6VXNlcjIxNjY1Mw==",
"organizations_url": "https://api.github.com/users/bluebird75/orgs",
"received_events_url": "https://api.github.com/users/bluebird75/received_events",
"repos_url": "https://api.github.com/users/bluebird75/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bluebird75/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bluebird75/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bluebird75",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] | null | 0
|
2020-04-27T21:19:20Z
|
2022-01-03T15:27:10Z
| null |
NONE
| null |
Issue #4613 details two problems :
* proxy may contain white-space accidentally
* proxy may be contain extra double-quotes on Windows
A fix already exists for the white-space problem, this addresses the second problem.
| 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/5441/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5441/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5441.diff",
"html_url": "https://github.com/psf/requests/pull/5441",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5441.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5441"
}
| true
|
[] |
https://api.github.com/repos/psf/requests/issues/5440
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5440/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5440/comments
|
https://api.github.com/repos/psf/requests/issues/5440/events
|
https://github.com/psf/requests/pull/5440
| 607,016,357
|
MDExOlB1bGxSZXF1ZXN0NDA5MDg2NDc1
| 5,440
|
fix failed testcase in test_requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12765401?v=4",
"events_url": "https://api.github.com/users/sgy123456/events{/privacy}",
"followers_url": "https://api.github.com/users/sgy123456/followers",
"following_url": "https://api.github.com/users/sgy123456/following{/other_user}",
"gists_url": "https://api.github.com/users/sgy123456/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sgy123456",
"id": 12765401,
"login": "sgy123456",
"node_id": "MDQ6VXNlcjEyNzY1NDAx",
"organizations_url": "https://api.github.com/users/sgy123456/orgs",
"received_events_url": "https://api.github.com/users/sgy123456/received_events",
"repos_url": "https://api.github.com/users/sgy123456/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sgy123456/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sgy123456/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sgy123456",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-04-26T13:46:47Z
|
2021-08-29T00:06:55Z
|
2020-05-09T04:52:02Z
|
NONE
|
resolved
|
when I run pytest in test_requests, an error occurred:
def test_conflicting_post_params(self, httpbin):
url = httpbin('post')
with open('Pipfile') as f:
> pytest.raises(ValueError, "requests.post(url, data='[{\"some\": \"data\"}]', files={'some': f})")
E TypeError: 'requests.post(url, data=\'[{"some": "data"}]\', files={\'some\': f})' object (type: <class 'str'>) must be callable
tests/test_requests.py:777: TypeError
|
{
"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/5440/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5440/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5440.diff",
"html_url": "https://github.com/psf/requests/pull/5440",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5440.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5440"
}
| true
|
[
"This looks like a dupe of #5305. I'm going to resolve in favor of that. Thanks for the contribution though @sgy123456!"
] |
https://api.github.com/repos/psf/requests/issues/5439
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5439/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5439/comments
|
https://api.github.com/repos/psf/requests/issues/5439/events
|
https://github.com/psf/requests/issues/5439
| 606,952,999
|
MDU6SXNzdWU2MDY5NTI5OTk=
| 5,439
|
should the shebang be removed?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39258624?v=4",
"events_url": "https://api.github.com/users/sandy-lcq/events{/privacy}",
"followers_url": "https://api.github.com/users/sandy-lcq/followers",
"following_url": "https://api.github.com/users/sandy-lcq/following{/other_user}",
"gists_url": "https://api.github.com/users/sandy-lcq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sandy-lcq",
"id": 39258624,
"login": "sandy-lcq",
"node_id": "MDQ6VXNlcjM5MjU4NjI0",
"organizations_url": "https://api.github.com/users/sandy-lcq/orgs",
"received_events_url": "https://api.github.com/users/sandy-lcq/received_events",
"repos_url": "https://api.github.com/users/sandy-lcq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sandy-lcq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sandy-lcq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sandy-lcq",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-04-26T08:20:31Z
|
2021-09-01T00:11:26Z
|
2020-04-26T08:32:21Z
|
NONE
|
resolved
|
certs.py have shebang "#!/usr/bin/env python", on some host, like fedora31 docker image,
only python3 installed, and no python link to python3, in this case, maybe error like "python: command not found" will repored when run certs.py .
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39258624?v=4",
"events_url": "https://api.github.com/users/sandy-lcq/events{/privacy}",
"followers_url": "https://api.github.com/users/sandy-lcq/followers",
"following_url": "https://api.github.com/users/sandy-lcq/following{/other_user}",
"gists_url": "https://api.github.com/users/sandy-lcq/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sandy-lcq",
"id": 39258624,
"login": "sandy-lcq",
"node_id": "MDQ6VXNlcjM5MjU4NjI0",
"organizations_url": "https://api.github.com/users/sandy-lcq/orgs",
"received_events_url": "https://api.github.com/users/sandy-lcq/received_events",
"repos_url": "https://api.github.com/users/sandy-lcq/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sandy-lcq/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sandy-lcq/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sandy-lcq",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5439/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5439/timeline
| null |
completed
| null | null | false
|
[
"duplicate https://github.com/pypa/pip/pull/7959"
] |
https://api.github.com/repos/psf/requests/issues/5438
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5438/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5438/comments
|
https://api.github.com/repos/psf/requests/issues/5438/events
|
https://github.com/psf/requests/issues/5438
| 606,939,270
|
MDU6SXNzdWU2MDY5MzkyNzA=
| 5,438
|
Unexpected Prepared Request behavior
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/36673811?v=4",
"events_url": "https://api.github.com/users/chanyshv/events{/privacy}",
"followers_url": "https://api.github.com/users/chanyshv/followers",
"following_url": "https://api.github.com/users/chanyshv/following{/other_user}",
"gists_url": "https://api.github.com/users/chanyshv/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chanyshv",
"id": 36673811,
"login": "chanyshv",
"node_id": "MDQ6VXNlcjM2NjczODEx",
"organizations_url": "https://api.github.com/users/chanyshv/orgs",
"received_events_url": "https://api.github.com/users/chanyshv/received_events",
"repos_url": "https://api.github.com/users/chanyshv/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chanyshv/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chanyshv/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chanyshv",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-04-26T06:59:29Z
|
2021-09-01T00:11:21Z
|
2020-05-08T14:55:04Z
|
NONE
|
resolved
|
`requests.Session.send` raises random error if you change `headers` in Prepared Request and send a `POST` request with `json` parameter.
## Reproduction Steps
```python
import requests as rq
s = rq.Session()
r = rq.Request('POST', 'https://google.com', json={'foo':'bar'})
p = r.prepare()
p.headers = {}
s.send(p)
```
**Error:**
```
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/hairygeek/.local/share/virtualenvs/slink-9m8Vdza8/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/home/hairygeek/.local/share/virtualenvs/slink-9m8Vdza8/lib/python3.8/site-packages/requests/adapters.py", line 470, in send
low_conn.send(hex(len(i))[2:].encode('utf-8'))
TypeError: object of type 'int' has no len()
```
However this works:
```python
r = rq.Request('POST', 'https://google.com')
p = r.prepare()
p.headers = {}
s.send(p)
<Response [405]>
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.8.2"
},
"platform": {
"release": "5.5.10-arch1-1",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010105f"
},
"urllib3": {
"version": "1.25.9"
},
"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/5438/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5438/timeline
| null |
completed
| null | null | false
|
[
"Also this works too:\r\n```python \r\nr = rq.Request('POST', 'https://google.com', json={'foo':'bar'})\r\np = r.prepare()\r\np.headers.update({'bar':'baz'})\r\ns.send(p)\r\n<Response [405]>\r\n```",
"Calling `prepare` generates all the headers that Requests has to pass to urllib3 including content-length and content-type. You're altering those and it seems you're expecting magic to happen. Removing essential headers will never Just Work.",
"You're right. But in this case it would be better to throw a specialized exception, something about there are missing essential headers. ",
"Why? The presumption is that if you're using the PreparedRequest flow you know enough to not need safety rails",
"I don’t think we can easily special case every possible action a user can take with a PreparedRequest. The PreparedRequest flow is for users making targeted changes that still operate within the realm of reasonable requests.\n\nThis specific case will actually go away if we move to using urllib3 for chunked encoding but that still needs through testing. I’m going to close this out since we don’t have any immediate actions take here."
] |
https://api.github.com/repos/psf/requests/issues/5437
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5437/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5437/comments
|
https://api.github.com/repos/psf/requests/issues/5437/events
|
https://github.com/psf/requests/pull/5437
| 606,835,338
|
MDExOlB1bGxSZXF1ZXN0NDA4OTU1NjQ2
| 5,437
|
docs: make danger of verify=False clearer
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18544?v=4",
"events_url": "https://api.github.com/users/elithrar/events{/privacy}",
"followers_url": "https://api.github.com/users/elithrar/followers",
"following_url": "https://api.github.com/users/elithrar/following{/other_user}",
"gists_url": "https://api.github.com/users/elithrar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/elithrar",
"id": 18544,
"login": "elithrar",
"node_id": "MDQ6VXNlcjE4NTQ0",
"organizations_url": "https://api.github.com/users/elithrar/orgs",
"received_events_url": "https://api.github.com/users/elithrar/received_events",
"repos_url": "https://api.github.com/users/elithrar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/elithrar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/elithrar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/elithrar",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-04-25T19:07:50Z
|
2021-08-28T00:06:23Z
|
2020-08-17T02:31:06Z
|
CONTRIBUTOR
|
resolved
|
This PR makes the danger of setting `verify=False` clearer to users of requests. In many cases, users may set this to `False` when running into problems locally with self-signed certificates, but not realize the risk they are opening themselves up to.
As an example of how the dangers of not verifying TLS (SSL) certificates is communicated, see Go's `InsecureSkipVerify` docs: https://golang.org/pkg/crypto/tls/
```
// InsecureSkipVerify controls whether a client verifies the
// server's certificate chain and host name.
// If InsecureSkipVerify is true, TLS accepts any certificate
// presented by the server and any host name in that certificate.
// In this mode, TLS is susceptible to man-in-the-middle attacks.
// This should be used only for testing.
```
Happy to take feedback on the wording / doc-style - this is my first PR to requests but I care a lot about 'safe defaults' in OSS!
|
{
"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/5437/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5437/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5437.diff",
"html_url": "https://github.com/psf/requests/pull/5437",
"merged_at": "2020-08-17T02:31:06Z",
"patch_url": "https://github.com/psf/requests/pull/5437.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5437"
}
| true
|
[
"Fixed some RST formatting / consistency.",
"Gentle ping - does this need anything else to be merged?"
] |
https://api.github.com/repos/psf/requests/issues/5436
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5436/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5436/comments
|
https://api.github.com/repos/psf/requests/issues/5436/events
|
https://github.com/psf/requests/issues/5436
| 606,483,070
|
MDU6SXNzdWU2MDY0ODMwNzA=
| 5,436
|
Add response.future_requests_uri, deprecate response.is_permanent_redirect
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1779619?v=4",
"events_url": "https://api.github.com/users/SoniEx2/events{/privacy}",
"followers_url": "https://api.github.com/users/SoniEx2/followers",
"following_url": "https://api.github.com/users/SoniEx2/following{/other_user}",
"gists_url": "https://api.github.com/users/SoniEx2/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/SoniEx2",
"id": 1779619,
"login": "SoniEx2",
"node_id": "MDQ6VXNlcjE3Nzk2MTk=",
"organizations_url": "https://api.github.com/users/SoniEx2/orgs",
"received_events_url": "https://api.github.com/users/SoniEx2/received_events",
"repos_url": "https://api.github.com/users/SoniEx2/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/SoniEx2/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/SoniEx2/subscriptions",
"type": "User",
"url": "https://api.github.com/users/SoniEx2",
"user_view_type": "public"
}
|
[
{
"color": "fad8c7",
"default": false,
"description": null,
"id": 136616769,
"name": "Documentation",
"node_id": "MDU6TGFiZWwxMzY2MTY3Njk=",
"url": "https://api.github.com/repos/psf/requests/labels/Documentation"
}
] |
open
| false
| null |
[] | null | 6
|
2020-04-24T17:50:35Z
|
2020-06-17T20:23:42Z
| null |
NONE
| null |
`response.is_permanent_redirect` is unreliable/useless/dangerous for chains of redirects, just give the user the correct URI instead.
example use-case: `foo` redirects temporarily to `bar`, which in turn redirects permanently to `baz`. future requests should still be made to `foo`, but using `is_permanent_redirect` would lead to them being made to `baz` instead.
| null |
{
"+1": 0,
"-1": 1,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/5436/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5436/timeline
| null | null | null | null | false
|
[
"That method was not introduced for users to use and was part of internal machinery that was ripped out",
"https://requests.readthedocs.io/en/master/api/#requests.Response.is_permanent_redirect ?",
"I think an alternative check for the first history item being a permanent redirect would be a more accurate way to calculate this? The actual permanent redirect url would be gotten from the last permanent redirect among the contiguous group of initial permanent redirects. Maybe?",
"@SoniEx2 I believe `autoclass` will auto-document a public method. That doesn't mean it's encouraged for you to use",
"Could we get it removed from the docs? It's hard to expect developers to consider a documented non-leading-`_` attribute private... Or implement it more sensibly (based on my minute or two of thought, maybe I'm missing something).",
"it does add value fwiw - if you're doing things yourself.\r\n\r\nbut don't rely on it as representative of the whole response chain."
] |
https://api.github.com/repos/psf/requests/issues/5435
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5435/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5435/comments
|
https://api.github.com/repos/psf/requests/issues/5435/events
|
https://github.com/psf/requests/issues/5435
| 605,677,935
|
MDU6SXNzdWU2MDU2Nzc5MzU=
| 5,435
|
QUES: Default port for Dockerfile
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5199900?v=4",
"events_url": "https://api.github.com/users/daddydrac/events{/privacy}",
"followers_url": "https://api.github.com/users/daddydrac/followers",
"following_url": "https://api.github.com/users/daddydrac/following{/other_user}",
"gists_url": "https://api.github.com/users/daddydrac/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/daddydrac",
"id": 5199900,
"login": "daddydrac",
"node_id": "MDQ6VXNlcjUxOTk5MDA=",
"organizations_url": "https://api.github.com/users/daddydrac/orgs",
"received_events_url": "https://api.github.com/users/daddydrac/received_events",
"repos_url": "https://api.github.com/users/daddydrac/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/daddydrac/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/daddydrac/subscriptions",
"type": "User",
"url": "https://api.github.com/users/daddydrac",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-04-23T16:33:04Z
|
2021-09-01T00:11:25Z
|
2020-04-30T15:57:33Z
|
NONE
|
resolved
|
What port do I need to map to in Dockerfile so requests can make a request out?
|
{
"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/5435/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5435/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here.",
"Thanks for your Shitty developer pedantry — I tried Stack and I labeled\nthis ques as a question.\n\nOn Thu, Apr 23, 2020 at 1:15 PM Ian Stapleton Cordasco <\nnotifications@github.com> wrote:\n\n> Hi there! Thanks for opening this issue. Unfortunately, it seems this is a\n> request for help instead of a report of a defect in the project. Please use\n> StackOverflow <https://stackoverflow.com> for general usage questions\n> instead and only report defects here.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/psf/requests/issues/5435#issuecomment-618563690>, or\n> unsubscribe\n> <https://github.com/notifications/unsubscribe-auth/ABHVQHBQ27H7ZIVOSYY6VXLROCASPANCNFSM4MPGOFCA>\n> .\n>\n",
"> I labeled this ques as a question.\r\n\r\nThe project doesn't accept questions in issues. If you'd followed the issue template then you'd have seen that and not opened this in the first place.\r\n\r\n"
] |
https://api.github.com/repos/psf/requests/issues/5434
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5434/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5434/comments
|
https://api.github.com/repos/psf/requests/issues/5434/events
|
https://github.com/psf/requests/pull/5434
| 604,768,818
|
MDExOlB1bGxSZXF1ZXN0NDA3Mjk5ODg1
| 5,434
|
Warn user once about missing timeouts
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/50769?v=4",
"events_url": "https://api.github.com/users/earonesty/events{/privacy}",
"followers_url": "https://api.github.com/users/earonesty/followers",
"following_url": "https://api.github.com/users/earonesty/following{/other_user}",
"gists_url": "https://api.github.com/users/earonesty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/earonesty",
"id": 50769,
"login": "earonesty",
"node_id": "MDQ6VXNlcjUwNzY5",
"organizations_url": "https://api.github.com/users/earonesty/orgs",
"received_events_url": "https://api.github.com/users/earonesty/received_events",
"repos_url": "https://api.github.com/users/earonesty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/earonesty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/earonesty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/earonesty",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2020-04-22T13:43:00Z
|
2023-05-12T00:03:08Z
|
2022-05-11T01:01:58Z
|
NONE
|
resolved
|
Not sure if this is the best way to do it, but some sort of warning that "hanging forever" is a possibility is probably important - given that this lib is for "humans".
|
{
"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/5434/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5434/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5434.diff",
"html_url": "https://github.com/psf/requests/pull/5434",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5434.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5434"
}
| true
|
[
"A) OK, I made a warning.\r\nB) Well, it's either that or severe intermittent bugs bubbling up. I'll take the former\r\nC) ? An instance variable wouldn't work, but as a class var, you get warned once and that's it.\r\nD) Valid? Under what circumstances should a request wait longer for a packet more than, say, 2 hours? This isn't the timeout for the whole download... just the time between any response bytes at all.",
"> B) Well, it's either that or severe intermittent bugs bubbling up. I'll take the former\r\n\r\nYeah, of course you will. You won't be dealing with the fallout from users. The warnings already in this project and in urllib3 have caused years long issue generation and comments complaining about them.\r\n\r\n> C) ? An instance variable wouldn't work, but as a class var, you get warned once and that's it.\r\n\r\nThis won't work across multiple processes or threads. It also doesn't properly provide any context. Imagine an application using celery and N API clients that all use Requests under the hood. Which one isn't providing a timeout? How does the user fix it? There's absolutely no value in this for the majority of the users who will _actually_ end up seeing this.\r\n\r\n> D) Valid? Under what circumstances should a request wait longer for a packet more than, say, 2 hours? This isn't the timeout for the whole download... just the time between any response bytes at all.\r\n\r\nThere's little value in responding to hyperbole, so I won't.",
"> You won't be dealing with the fallout from users.\r\n\r\nWhat we do now is patch requests to raise an exception if a timeout isn't present - which is fine. This allows us to quickly file bug reports with downstream libraries, and/or then up those libs. \r\n\r\nI agree, there might be less fallout if a default timeout is in there - instead of a warning. I'm just not sure how having requests with infinite timeouts is helpful to anyone except those trying to deliberately produce bugs.\r\n\r\nBear in mind... the effect of this is to break, at runtime, in rare and potentially dangerous production conditions.\r\n\r\nMaybe there's more fallout from not having something?\r\n\r\n> This won't work across multiple processes or threads\r\n\r\nIt will work fine across threads. Processes, no. \r\n\r\nI doubt anyone would be too upset if a potentially fatal bug is in their system.\r\n\r\n> hyperbole\r\n\r\nThe lack of a timeout, given the right conditions can cause applications that seem to work fine in production to suddenly break catastrophically and permanently. That's because it's rather rare that a TCP FIN_WAIT will never go through - but when that happens, the requests lib will never return. \r\n\r\n2 hours was just an example of a default timeout that would be perfectly fine - if you're opposed to a warning.\r\n\r\nI think it's sort of irresponsible to leave it without both a warning and a default timeout, simply because the conditions that cause an infinite wait are hard to simulate for users.\r\n\r\nI noticed there's an open issue to have a default timeout too. That would be fine.\r\n\r\n> context\r\n\r\nYes, it would be nicer, maybe, to have a bit of a trace on the warning.",
"I don't think we're going to merge a warning for this. It produces a considerable amount of noise in people's systems and we've generally stopped using warnings due to how often Requests is bundled in other projects. Often code the user has no control over is generating these warnings in their logs.\r\n\r\nThere's currently a paragraph in the [quickstart guide](https://docs.python-requests.org/en/latest/user/quickstart/#timeouts) with guidance at the top of the timeout section. That's probably still our best approach here.\r\n\r\n> You can tell Requests to stop waiting for a response after a given number of seconds with the timeout parameter. Nearly all production code should use this parameter in nearly all requests. Failure to do so can cause your program to hang indefinitely:"
] |
https://api.github.com/repos/psf/requests/issues/5433
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5433/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5433/comments
|
https://api.github.com/repos/psf/requests/issues/5433/events
|
https://github.com/psf/requests/issues/5433
| 604,190,015
|
MDU6SXNzdWU2MDQxOTAwMTU=
| 5,433
|
Requests library can hang indefinitely on windows, even if a timeout is set
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/50769?v=4",
"events_url": "https://api.github.com/users/earonesty/events{/privacy}",
"followers_url": "https://api.github.com/users/earonesty/followers",
"following_url": "https://api.github.com/users/earonesty/following{/other_user}",
"gists_url": "https://api.github.com/users/earonesty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/earonesty",
"id": 50769,
"login": "earonesty",
"node_id": "MDQ6VXNlcjUwNzY5",
"organizations_url": "https://api.github.com/users/earonesty/orgs",
"received_events_url": "https://api.github.com/users/earonesty/received_events",
"repos_url": "https://api.github.com/users/earonesty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/earonesty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/earonesty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/earonesty",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-04-21T18:23:32Z
|
2021-09-01T00:11:27Z
|
2020-04-22T01:55:42Z
|
NONE
|
resolved
|
Summary.
Assume you have a website that listens for and accepts connections, but never responds.
`requests.get('https://sitethatneverresponds.com', timeout=1)`
I expect this should *always* raise a timeout error.
Instead, if you put Windows into "sleep" mode during an openssl handshake, then wake it up a few minute later, socket events are silently dropped and the socket hangs forever.
## Reproduction Steps
On a laptop run do this a bunch of times:
`requests.get('https://sitethatneverresponds.com', timeout=1)`
Then close the laptop lid, and lift it up 5 minutes later (or whatever the tcp discard window is). The get request never times out, and never returns. If someone knows a better way of making a socket "disappear" and not time out, let me know.
It's possible to get a call stack by turning on python's tracing system and killing the process:
## Call stack of hung thread:
```
Thread 0x000070000823a000 (most recent call first):
File "site-packages/OpenSSL/SSL.py", line 1813 in recv_into
File "site-packages/urllib3/contrib/pyopenssl.py", line 313 in recv_into
File "socket.py", line 586 in readinto
File "http/client.py", line 258 in _read_status
File "http/client.py", line 297 in begin
File "http/client.py", line 1331 in getresponse
File "site-packages/urllib3/connectionpool.py", line 421 in _make_request
File "site-packages/urllib3/connectionpool.py", line 677 in urlopen
File "site-packages/requests/adapters.py", line 449 in send
File "site-packages/requests/sessions.py", line 643 in send
```
## Related Issue with pyopenssl:
pyopnessl, by not doing it themselves, has essentially decided that the caller must handle this by putting the socket into non-blocking mode, and calling select in a loop:
See: https://github.com/pyca/pyopenssl/issues/168 for potential solutions.
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.8"
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.6.8"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "1010104f",
"version": "19.1.0"
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1000211f"
},
"urllib3": {
"version": "1.25.8"
},
"using_pyopenssl": true
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/50769?v=4",
"events_url": "https://api.github.com/users/earonesty/events{/privacy}",
"followers_url": "https://api.github.com/users/earonesty/followers",
"following_url": "https://api.github.com/users/earonesty/following{/other_user}",
"gists_url": "https://api.github.com/users/earonesty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/earonesty",
"id": 50769,
"login": "earonesty",
"node_id": "MDQ6VXNlcjUwNzY5",
"organizations_url": "https://api.github.com/users/earonesty/orgs",
"received_events_url": "https://api.github.com/users/earonesty/received_events",
"repos_url": "https://api.github.com/users/earonesty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/earonesty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/earonesty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/earonesty",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5433/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5433/timeline
| null |
completed
| null | null | false
|
[
"I'm going to write a program that makes this easy to reproduce, then reopen if I can figure it out.",
"@earonesty I belive you're confused about what functionality `timeout` provides in `requests`. Please search open and closed issues and read those, or read the docs"
] |
https://api.github.com/repos/psf/requests/issues/5432
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5432/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5432/comments
|
https://api.github.com/repos/psf/requests/issues/5432/events
|
https://github.com/psf/requests/issues/5432
| 603,610,585
|
MDU6SXNzdWU2MDM2MTA1ODU=
| 5,432
|
Timeout exception not being raised
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25521899?v=4",
"events_url": "https://api.github.com/users/alexbode/events{/privacy}",
"followers_url": "https://api.github.com/users/alexbode/followers",
"following_url": "https://api.github.com/users/alexbode/following{/other_user}",
"gists_url": "https://api.github.com/users/alexbode/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alexbode",
"id": 25521899,
"login": "alexbode",
"node_id": "MDQ6VXNlcjI1NTIxODk5",
"organizations_url": "https://api.github.com/users/alexbode/orgs",
"received_events_url": "https://api.github.com/users/alexbode/received_events",
"repos_url": "https://api.github.com/users/alexbode/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alexbode/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alexbode/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alexbode",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-04-21T00:01:17Z
|
2021-09-01T00:11:27Z
|
2020-04-21T01:32:12Z
|
NONE
|
resolved
|
I am testing a backend api and expect an exception to be raised when the request takes longer than specified timeout. I am running a flask app behind nginx behind an aws elb. The app is running in a private subnet and the elb is in the public subnet. Don't know if this is an issue related to the backend architecture or a requests bug. When I go to the url in a browser flask returns the json response immediately. Interestingly, using the requests library, the response is returned at a time about double the specified timeout (see screenshots).
## Expected Result
Raised exception
## Actual Result
Returns response after specified (2 * timeout)
## Reproduction Steps
<img width="510" alt="image" src="https://user-images.githubusercontent.com/25521899/79810594-3fc49600-8328-11ea-96d4-c067679433a4.png">
<img width="497" alt="image" src="https://user-images.githubusercontent.com/25521899/79810605-45ba7700-8328-11ea-9fb5-fbcc32a12c52.png">
```python
import time
start = time.time()
print(requests.get("https://******.com/test", timeout=2).json())
print(time.time() - start)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.4"
},
"platform": {
"release": "19.4.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.22.0"
},
"system_ssl": {
"version": "1000213f"
},
"urllib3": {
"version": "1.25.6"
},
"using_pyopenssl": false
}
Python 3.7.4
requests==2.22.0
```
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/25521899?v=4",
"events_url": "https://api.github.com/users/alexbode/events{/privacy}",
"followers_url": "https://api.github.com/users/alexbode/followers",
"following_url": "https://api.github.com/users/alexbode/following{/other_user}",
"gists_url": "https://api.github.com/users/alexbode/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alexbode",
"id": 25521899,
"login": "alexbode",
"node_id": "MDQ6VXNlcjI1NTIxODk5",
"organizations_url": "https://api.github.com/users/alexbode/orgs",
"received_events_url": "https://api.github.com/users/alexbode/received_events",
"repos_url": "https://api.github.com/users/alexbode/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alexbode/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alexbode/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alexbode",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5432/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5432/timeline
| null |
completed
| null | null | false
|
[
"Hi @alexbode,\n\nIf you look at the [docs](https://requests.readthedocs.io/en/master/user/quickstart/#timeouts) or source code on timeouts, we’ve got a couple call outs on this. The timeout you’re specifying here is a Read Timeout, not a Total Timeout.\n\n> timeout is not a time limit on the entire response download; rather, an exception is raised if the server has not issued a response for timeout seconds (more precisely, if no bytes have been received on the underlying socket for timeout seconds). If no timeout is specified explicitly, requests do not time out.\n\nThe extra time you’re seeing is either because we’ve received some data from the server, resetting the timeout, or because the connection step is taking up the rest of the time.",
"@nateprewitt \r\n\r\nThank you for your quick response.\r\nSolved: Misconfigured Aws Elastic Load Balancer.\r\nVery interesting how the miscofigured load balancer affected the requests client in that way but the issue was on my end. I deployed the elb in a public and private availability zone, should have been only in a public availability zone. Thanks for the help again.\r\n"
] |
https://api.github.com/repos/psf/requests/issues/5431
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5431/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5431/comments
|
https://api.github.com/repos/psf/requests/issues/5431/events
|
https://github.com/psf/requests/pull/5431
| 602,771,602
|
MDExOlB1bGxSZXF1ZXN0NDA1NzAwNzg3
| 5,431
|
Add more details in error reponse of "Bad Request"
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3462960?v=4",
"events_url": "https://api.github.com/users/bitsapien/events{/privacy}",
"followers_url": "https://api.github.com/users/bitsapien/followers",
"following_url": "https://api.github.com/users/bitsapien/following{/other_user}",
"gists_url": "https://api.github.com/users/bitsapien/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bitsapien",
"id": 3462960,
"login": "bitsapien",
"node_id": "MDQ6VXNlcjM0NjI5NjA=",
"organizations_url": "https://api.github.com/users/bitsapien/orgs",
"received_events_url": "https://api.github.com/users/bitsapien/received_events",
"repos_url": "https://api.github.com/users/bitsapien/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bitsapien/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bitsapien/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bitsapien",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-04-19T17:18:37Z
|
2021-08-29T00:06:56Z
|
2020-04-30T15:49:01Z
|
NONE
|
resolved
|
**The problem**: When there is an exception raised on a 400 "Bad Request" from the server. The information provided on the exception is not enough to debug problems.
**Resolution**: Adding "content" attribute from the response to understand the error from the server's perspective.
|
{
"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/5431/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5431/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5431.diff",
"html_url": "https://github.com/psf/requests/pull/5431",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5431.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5431"
}
| true
|
[
"This doesn't scale. `response.content` isn't guaranteed to be pre-populated and in the event of a malicious server, this causes us to hang before we even raise the exception because a server could send an endless stream of bytes and requests has no mechanism to stop it.",
"Also, there's already a response attribute. If you want more information while handling this, log the `error.response.content` value yourself and at your own risk",
"Hi @bitsapien,\r\n\r\nSigmavirus24 already laid out the reasoning it looks like. We already have cases of the scenario he describes happening in the wild, so for that reason, I think we'll pass on this. The workaround provided should get you to where you want."
] |
https://api.github.com/repos/psf/requests/issues/5430
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5430/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5430/comments
|
https://api.github.com/repos/psf/requests/issues/5430/events
|
https://github.com/psf/requests/issues/5430
| 602,744,441
|
MDU6SXNzdWU2MDI3NDQ0NDE=
| 5,430
|
A `ConnectionError` ("Read timed out.") is raised instead of `ReadTimeout`, when using `timeout` keyword argument of `Session.get()`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/14088508?v=4",
"events_url": "https://api.github.com/users/nlykkei/events{/privacy}",
"followers_url": "https://api.github.com/users/nlykkei/followers",
"following_url": "https://api.github.com/users/nlykkei/following{/other_user}",
"gists_url": "https://api.github.com/users/nlykkei/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nlykkei",
"id": 14088508,
"login": "nlykkei",
"node_id": "MDQ6VXNlcjE0MDg4NTA4",
"organizations_url": "https://api.github.com/users/nlykkei/orgs",
"received_events_url": "https://api.github.com/users/nlykkei/received_events",
"repos_url": "https://api.github.com/users/nlykkei/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nlykkei/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nlykkei/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nlykkei",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] | null | 11
|
2020-04-19T15:29:31Z
|
2024-08-29T10:13:59Z
| null |
NONE
| null |
Consider the code below (**main.py**). When a temporary network disconnect occurs without the `timeout` keyword argument to `Session.get()`, the client may hang indefinitely and no exception is raised.
However, if I use the `timeout` keyword argument, the application will raise a `ConnectionError` from **models.py** corresponding to the `urllib3.exceptions.ReadTimeoutError`:
`requests.exceptions.ConnectionError: HTTPSConnectionPool(host='confluence.example.net', port=443): Read timed out.`
Given that the exception is only raised, when using the `timeout` keyword argument, why isn't Requests raising `ReadTimeout` exception instead? In particular, the `ConnectionError`'s exception message "Read timed out." suggests that it should be a `ReadTimeout` exception?
To mitigate the issue I'm currently performing a regular expression match on the exception message, which is a bad practice:
```
except ConnectionError as e:
if re.search('Read timed out', str(e), re.IGNORECASE):
```
**main.py**:
```
try:
with requests.Session() as rs:
rs.mount('https://', HTTPAdapter(max_retries=Retry(total=10, connect=10, read=10, backoff_factor=1)))
with rs.get(url, params={}, headers={}, auth=self.auth, verify=self.ssl_verify, timeout=(30, 30)) as r:
r.raise_for_status()
page_set = r.json()
except ReadTimeout as e:
logging.exception('Request for page set timed out: {}'.format(url))
continue
except ConnectionError as e:
if re.search('Read timed out', str(e), re.IGNORECASE):
logging.exception('Request for page set timed out (network problem): {}'.format(url))
continue
else:
raise
```
**models.py**:
https://github.com/psf/requests/blob/master/requests/models.py
```
def generate():
# Special case for urllib3.
if hasattr(self.raw, 'stream'):
try:
for chunk in self.raw.stream(chunk_size, decode_content=True):
yield chunk
except ProtocolError as e:
raise ChunkedEncodingError(e)
except DecodeError as e:
raise ContentDecodingError(e)
except ReadTimeoutError as e:
raise ConnectionError(e)
```
**Exception**:
```
ERROR -- 04/19/2020 04:51:32 PM -- root -- ThreadPoolExecutor-0_0 -- Request for page set timed out (network problem): https://confluence.example.net/rest/api/content/search?expand=version,history,space,body.storage,children.attachment.version,children.attachment.history,children.attachment.space&limit=50&start=1900&cql=(type=page)
Traceback (most recent call last):
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/urllib3/response.py", line 425, in _error_catcher
yield
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/urllib3/response.py", line 755, in read_chunked
chunk = self._handle_chunk(amt)
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/urllib3/response.py", line 708, in _handle_chunk
returned_chunk = self._fp._safe_read(self.chunk_left)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 620, in _safe_read
chunk = self.fp.read(min(amt, MAXAMOUNT))
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/requests/models.py", line 751, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/urllib3/response.py", line 560, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/urllib3/response.py", line 781, in read_chunked
self._original_response.close()
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/urllib3/response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='confluence.example.net', port=443): Read timed out.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/nlykkei/projects/atlassian-watchdog/confluence/confluence.py", line 112, in __producer
with rs.get(url, params={}, headers={}, auth=self.auth, verify=self.ssl_verify, timeout=(30, 30)) as r:
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/requests/sessions.py", line 683, in send
r.content
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/requests/models.py", line 829, in content
self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
File "/Users/nlykkei/projects/atlassian-watchdog/lib/python3.7/site-packages/requests/models.py", line 758, in generate
raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='confluence.example.net', port=443): Read timed out.
```
## Expected Result
I would expect a `requests.exceptions.ReadTimeout` to be raised.
## Actual Result
A `requests.exceptions.ConnectError` was raised instead, with the error message: `Read timed out.`
## System Information
$ python -m requests.help
```
nlykkei:~$ python3 -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.7"
},
"implementation": {
"name": "CPython",
"version": "3.7.7"
},
"platform": {
"release": "19.4.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010106f"
},
"urllib3": {
"version": "1.24.3"
},
"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": 10,
"-1": 0,
"confused": 0,
"eyes": 2,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 12,
"url": "https://api.github.com/repos/psf/requests/issues/5430/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5430/timeline
| null | null | null | null | false
|
[
"This is behaving exactly as it unfortunately must until a breaking API change can be introduced. The behaviour was likely (I don't remember this specifically) introduced to raise the same exception as it used to raise before urllib3 introduced finer-grained exceptions. Is that great? No. Is it what will happen until a _real_ requests 3.0 can happen? Almost certainly due to backwards compatibility concerns and API stability.",
"@simonvanderveldt So you're complaining about exception wrapping which is a user feature to allow them to not have to think about handling exceptions from N libraries being used inside of Requests? That's tangential to this issue. Please let's not muddy the water with this conversation",
"I am following this issue as I also get mixed results when a timeout is raised. \r\n\r\nMy timeout is set to `(1,10)` connect/read and when it times out, I can see any of these 2:\r\n\r\n> HTTPSConnectionPool(host='cloud-collector.newrelic.com', port=443): Read timed out. (read timeout=10)\r\n\r\n> HTTPSConnectionPool(host='cloud-collector.newrelic.com', port=443): Read timed out. (read timeout=1)\r\n\r\n<img width=\"1320\" alt=\"Screenshot 2020-07-30 at 16 36 08\" src=\"https://user-images.githubusercontent.com/1932338/88945113-7d20b400-d285-11ea-8189-ea68dfc7e9ff.png\">\r\n\r\n\r\nI imagine the second one should mention `connect` instead of `read`, possibly making one believe that the timeouts are not being applied correctly.\r\n\r\nI am still trying to narrow down the problem before creating a new github issue, but it seems something isn't too clear in the way exceptions are handled.\r\n\r\nEdit: I'm not entirely sure this is the same issue so I created https://github.com/psf/requests/issues/5544",
"try to enable the OS TCP/IP stack tcp keep alive, it is disable by default , ie. for Linux I use this inorder to keep the connection up...\r\n\r\n\r\n import socket\r\n from urllib3.connection import HTTPConnection\r\n HTTPConnection.default_socket_options = HTTPConnection.default_socket_options + [\r\n (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)\r\n ,(socket.SOL_TCP, socket.TCP_KEEPIDLE, 45)\r\n ,(socket.SOL_TCP, socket.TCP_KEEPINTVL, 10)\r\n ,(socket.SOL_TCP, socket.TCP_KEEPCNT, 6)\r\n ]\r\n\r\n from requests import session\r\n self.session = session()\r\n\r\nIf the socket gets dropped because the server didnt get any tcp keep alive msg while processing your request, you will get a ConectionTimeout or ConnectionReset eror, because, it is from a lower layer than the data tranfer...so if the socket is close...no data will be tranfer...",
"Hello @nlykkei By your doubt I assume you're trying to handle that exception raised by _urllib3_, if it is, then this is what I have done to handle it.\r\nInstead of using `except ReadTimeout as e:`\r\nI used `except requests.ReadTimeout as e:` and it handled just perfectly.\r\nPlease let me know if you had the same problem or not and whether you have managed to solve your problem.",
"> Hello @nlykkei By your doubt I assume you're trying to handle that exception raised by _urllib3_, if it is, then this is what I have done to handle it.\r\n> Instead of using `except ReadTimeout as e:`\r\n> I used `except requests.ReadTimeout as e:` and it handled just perfectly.\r\n> Please let me know if you had the same problem or not and whether you have managed to solve your problem.\r\n\r\nWell,your are correct about the Exception handle...but, the real issue, is that the OS libraries, no matter is your request forces to use persistenr connections by enabling theConnection : Keep-Alive header on HTTP/HTTPS Request....it depends on 2 possible scenarios, 1st, the easy one... the server responds back with a connection close or a the enconding is set too chunk-response.... to resolve this just iterate the response till you get Len 0 onthe responseheader...\r\n\r\nBut At least on my findings, the major issue deepnds on the lower layers, since the content providers dont want to spend resources on \"probably\" dead connection, they close them before the IETFs RFC standrard,that defines the TCP keep alive behaivor.....and set it to start sendind L4 TCP KA, after 2 hours....so it is insane, and obvously will spend resourses...so what I have done is set the SO_KEEPALIVE flag on, and ser the timers lower....so youcan release the connection to the connection pool, and release resourses on your device, when idle.\r\n\r\nI dont like catch exceptions and do retries, when they are not neccesary.... \r\n\r\nbut you can retry on your code, dont set the retry param, because you willgetthe same behaivor, sincethe Lower ayer will retry the High Level Request on the same dead connection....\r\n\r\nCheers from Mexico",
"I faced the same issue, by removing the headers worked for me.\r\n<snap>\r\n20:21\r\nTraceback (most recent call last):\r\n File “<stdin>“, line 1, in <module>\r\n File “/opt/domainvalidation/requests/api.py”, line 76, in get\r\n return request(‘get’, url, params=params, **kwargs)\r\n File “/opt/domainvalidation/requests/api.py”, line 61, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File “/opt/domainvalidation/requests/sessions.py”, line 530, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File “/opt/domainvalidation/requests/sessions.py”, line 643, in send\r\n r = adapter.send(request, **kwargs)\r\n File “/opt/domainvalidation/requests/adapters.py”, line 529, in send\r\n raise ReadTimeout(e, request=request)\r\nrequests.exceptions.ReadTimeout: HTTPSConnectionPool(host=‘www.123xyz.com’, port=443): Read timed out. (read timeout=15)\r\n>>> response = requests.get(‘https://www.123xyz.com’, timeout=15, allow_redirects=True)\r\n>>> response\r\n<Response [200]>\r\n\r\nNot sure the behavior is specific to the server\r\nNote: 123xyz is just for example.",
"Same issue in using a custom adapter as well where the underlying urllib3 adapter can return a `urllib3.exceptions.ReadTimeoutError` as a reason for `MaxRetryError` but that check is missing so it falls through to a `ConnectionError`\r\nhttps://github.com/psf/requests/blob/2d2447e210cf0b9e8c7484bfc6f158de9b24c171/requests/adapters.py#L501-L517",
"Please have a look at https://github.com/psf/requests/issues/4590 as the issue may be in _urllib3_. If not exactly this issue a very similar one. Thanks.",
"Please I need help. I've been trying to download spacy English package using: python -m spacy download en_core_web_sm\r\n\r\nBut I keep getting this error: requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Read timed out. (read timeout=None)\r\n\r\nThe full error message is presented below:\r\nC:\\Users\\user>python -m spacy download en_core_web_sm\r\nTraceback (most recent call last):\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\connectionpool.py\", line 467, in _make_request\r\n self._validate_conn(conn)\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\connectionpool.py\", line 1096, in _validate_conn\r\n conn.connect()\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\connection.py\", line 642, in connect\r\n sock_and_verified = _ssl_wrap_socket_and_match_hostname(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\connection.py\", line 782, in _ssl_wrap_socket_and_match_hostname\r\n ssl_sock = ssl_wrap_socket(\r\n ^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\util\\ssl_.py\", line 470, in ssl_wrap_socket\r\n ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\util\\ssl_.py\", line 514, in _ssl_wrap_socket_impl\r\n return ssl_context.wrap_socket(sock, server_hostname=server_hostname)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\ssl.py\", line 517, in wrap_socket\r\n return self.sslsocket_class._create(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\ssl.py\", line 1075, in _create\r\n self.do_handshake()\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\ssl.py\", line 1346, in do_handshake\r\n self._sslobj.do_handshake()\r\nTimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond\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 \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\requests\\adapters.py\", line 486, in send resp = conn.urlopen(\r\n ^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\connectionpool.py\", line 844, in urlopen\r\n retries = retries.increment(\r\n ^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\util\\retry.py\", line 470, in increment\r\n raise reraise(type(error), error, _stacktrace)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\util\\util.py\", line 39, in reraise\r\n raise value\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\connectionpool.py\", line 790, in urlopen\r\n response = self._make_request(\r\n ^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\connectionpool.py\", line 491, in _make_request\r\n raise new_e\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\connectionpool.py\", line 469, in _make_request\r\n self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\urllib3\\connectionpool.py\", line 370, in _raise_timeout\r\n raise ReadTimeoutError(\r\nurllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Read timed out. (read timeout=None)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"<frozen runpy>\", line 198, in _run_module_as_main\r\n File \"<frozen runpy>\", line 88, in _run_code\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\spacy\\__main__.py\", line 4, in <module>\r\n setup_cli()\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\spacy\\cli\\_util.py\", line 87, in setup_cli\r\n command(prog_name=COMMAND)\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\click\\core.py\", line 1157, in __call__\r\n return self.main(*args, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\typer\\core.py\", line 778, in main\r\n return _main(\r\n ^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\typer\\core.py\", line 216, in _main\r\n rv = self.invoke(ctx)\r\n ^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\click\\core.py\", line 1688, in invoke\r\n return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\click\\core.py\", line 1434, in invoke\r\n return ctx.invoke(self.callback, **ctx.params)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\click\\core.py\", line 783, in invoke\r\n return __callback(*args, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\typer\\main.py\", line 683, in wrapper\r\n return callback(**use_params) # type: ignore\r\n ^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\spacy\\cli\\download.py\", line 36, in download_cli\r\n download(model, direct, sdist, *ctx.args)\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\spacy\\cli\\download.py\", line 70, in download\r\n compatibility = get_compatibility()\r\n ^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\spacy\\cli\\download.py\", line 94, in get_compatibility\r\n r = requests.get(about.__compatibility__)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\requests\\api.py\", line 73, in get\r\n return request(\"get\", url, params=params, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\requests\\api.py\", line 59, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\requests\\sessions.py\", line 589, in request\r\n resp = self.send(prep, **send_kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\requests\\sessions.py\", line 703, in send r = adapter.send(request, **kwargs)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\requests\\adapters.py\", line 532, in send raise ReadTimeout(e, request=request)\r\nrequests.exceptions.ReadTimeout: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Read timed out. (read timeout=None)",
"\r\n===================================================================================================\r\n2024-08-29 13:08:08.653267\r\n---------------------------------------------------------------------------------------------------\r\nsys.args->['/usr/local/bin/hypercorn', '-b', '0.0.0.0:8080', 'app:asgi_app']\r\n---------------------------------------------------------------------------------------------------\r\nvariables->{'data': <FileStorage: 'RJ003LE001586N01-OSV-Documents-02.pdf' ('application/pdf')>}\r\n---------------------------------------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 536, in _make_request\r\n response = conn.getresponse()\r\n File \"/usr/local/lib/python3.10/site-packages/urllib3/connection.py\", line 464, in getresponse\r\n httplib_response = super().getresponse()\r\n File \"/usr/local/lib/python3.10/http/client.py\", line 1375, in getresponse\r\n response.begin()\r\n File \"/usr/local/lib/python3.10/http/client.py\", line 318, in begin\r\n version, status, reason = self._read_status()\r\n File \"/usr/local/lib/python3.10/http/client.py\", line 279, in _read_status\r\n line = str(self.fp.readline(_MAXLINE + 1), \"iso-8859-1\")\r\n File \"/usr/local/lib/python3.10/socket.py\", line 705, in readinto\r\n return self._sock.recv_into(b)\r\n File \"/usr/local/lib/python3.10/ssl.py\", line 1307, in recv_into\r\n return self.read(nbytes, buffer)\r\n File \"/usr/local/lib/python3.10/ssl.py\", line 1163, in read\r\n return self._sslobj.read(len, buffer)\r\nTimeoutError: The read operation timed out\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 \"/usr/local/lib/python3.10/site-packages/requests/adapters.py\", line 667, in send\r\n resp = conn.urlopen(\r\n File \"/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 843, in urlopen\r\n retries = retries.increment(\r\n File \"/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py\", line 474, in increment\r\n raise reraise(type(error), error, _stacktrace)\r\n File \"/usr/local/lib/python3.10/site-packages/urllib3/util/util.py\", line 39, in reraise\r\n raise value\r\n File \"/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 789, in urlopen\r\n response = self._make_request(\r\n File \"/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 538, in _make_request\r\n self._raise_timeout(err=e, url=url, timeout_value=read_timeout)\r\n File \"/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py\", line 369, in _raise_timeout\r\n raise ReadTimeoutError(\r\nurllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Read timed out. (read timeout=60)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/app/app.py\", line 1011, in gcs_upload\r\n response = gcp_client.upload(local_path,destination_path)\r\n File \"/app/app.py\", line 270, in upload\r\n blob.upload_from_filename(source_file_name)\r\n File \"/usr/local/lib/python3.10/site-packages/google/cloud/storage/blob.py\", line 2947, in upload_from_filename\r\n self._handle_filename_and_upload(\r\n File \"/usr/local/lib/python3.10/site-packages/google/cloud/storage/blob.py\", line 2826, in _handle_filename_and_upload\r\n self._prep_and_do_upload(\r\n File \"/usr/local/lib/python3.10/site-packages/google/cloud/storage/blob.py\", line 2643, in _prep_and_do_upload\r\n created_json = self._do_upload(\r\n File \"/usr/local/lib/python3.10/site-packages/google/cloud/storage/blob.py\", line 2466, in _do_upload\r\n response = self._do_resumable_upload(\r\n File \"/usr/local/lib/python3.10/site-packages/google/cloud/storage/blob.py\", line 2302, in _do_resumable_upload\r\n response = upload.transmit_next_chunk(transport, timeout=timeout)\r\n File \"/usr/local/lib/python3.10/site-packages/google/resumable_media/requests/upload.py\", line 515, in transmit_next_chunk\r\n return _request_helpers.wait_and_retry(\r\n File \"/usr/local/lib/python3.10/site-packages/google/resumable_media/requests/_request_helpers.py\", line 178, in wait_and_retry\r\n raise error\r\n File \"/usr/local/lib/python3.10/site-packages/google/resumable_media/requests/_request_helpers.py\", line 155, in wait_and_retry\r\n response = func()\r\n File \"/usr/local/lib/python3.10/site-packages/google/resumable_media/requests/upload.py\", line 507, in retriable_request\r\n result = transport.request(\r\n File \"/usr/local/lib/python3.10/site-packages/google/auth/transport/requests.py\", line 538, in request\r\n response = super(AuthorizedSession, self).request(\r\n File \"/usr/local/lib/python3.10/site-packages/requests/sessions.py\", line 589, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/local/lib/python3.10/site-packages/requests/sessions.py\", line 703, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/local/lib/python3.10/site-packages/requests/adapters.py\", line 713, in send\r\n raise ReadTimeout(e, request=request)\r\nrequests.exceptions.ReadTimeout: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Read timed out. (read timeout=60)\r\n\r\n\r\nHow to solve this error\r\n\r\n\r\n"
] |
https://api.github.com/repos/psf/requests/issues/5429
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5429/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5429/comments
|
https://api.github.com/repos/psf/requests/issues/5429/events
|
https://github.com/psf/requests/issues/5429
| 602,573,158
|
MDU6SXNzdWU2MDI1NzMxNTg=
| 5,429
|
Not able to import requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/56107942?v=4",
"events_url": "https://api.github.com/users/DutchviewSumit/events{/privacy}",
"followers_url": "https://api.github.com/users/DutchviewSumit/followers",
"following_url": "https://api.github.com/users/DutchviewSumit/following{/other_user}",
"gists_url": "https://api.github.com/users/DutchviewSumit/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/DutchviewSumit",
"id": 56107942,
"login": "DutchviewSumit",
"node_id": "MDQ6VXNlcjU2MTA3OTQy",
"organizations_url": "https://api.github.com/users/DutchviewSumit/orgs",
"received_events_url": "https://api.github.com/users/DutchviewSumit/received_events",
"repos_url": "https://api.github.com/users/DutchviewSumit/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/DutchviewSumit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/DutchviewSumit/subscriptions",
"type": "User",
"url": "https://api.github.com/users/DutchviewSumit",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-04-18T23:15:23Z
|
2021-09-01T00:11:25Z
|
2020-04-30T15:57:57Z
|
NONE
|
resolved
|
If I am trying to install requests it is showing requirement already satisfied but If I am trying to import then it is throwing error. Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'.
I am running the command pip3 list then it is showing requests 2.23.0. but not able to import.
|
{
"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/5429/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5429/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here."
] |
https://api.github.com/repos/psf/requests/issues/5428
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5428/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5428/comments
|
https://api.github.com/repos/psf/requests/issues/5428/events
|
https://github.com/psf/requests/issues/5428
| 602,436,746
|
MDU6SXNzdWU2MDI0MzY3NDY=
| 5,428
|
Received response with content-encoding: gzip, but failed to decode it.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1636393?v=4",
"events_url": "https://api.github.com/users/petasis/events{/privacy}",
"followers_url": "https://api.github.com/users/petasis/followers",
"following_url": "https://api.github.com/users/petasis/following{/other_user}",
"gists_url": "https://api.github.com/users/petasis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/petasis",
"id": 1636393,
"login": "petasis",
"node_id": "MDQ6VXNlcjE2MzYzOTM=",
"organizations_url": "https://api.github.com/users/petasis/orgs",
"received_events_url": "https://api.github.com/users/petasis/received_events",
"repos_url": "https://api.github.com/users/petasis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/petasis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/petasis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/petasis",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2020-04-18T11:19:28Z
|
2021-09-01T00:11:23Z
|
2020-04-30T15:59:15Z
|
NONE
|
resolved
|
I get an error while trying to download from https://www.huffingtonpost.gr/feeds/index.xml.
## Expected Result
To download the data.
## Actual Result
I get an exception.
('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check'))
## Reproduction Steps
```python
import requests
requests.get('https://www.huffingtonpost.gr/feeds/index.xml', timeout=5.0, allow_redirects=True)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.6.1"
},
"idna": {
"version": "2.8"
},
"implementation": {
"name": "CPython",
"version": "3.7.6"
},
"platform": {
"release": "5.5.15-200.fc31.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010104f",
"version": "19.0.0"
},
"requests": {
"version": "2.22.0"
},
"system_ssl": {
"version": "1010104f"
},
"urllib3": {
"version": "1.25.7"
},
"using_pyopenssl": true
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5428/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5428/timeline
| null |
completed
| null | null | false
|
[
"This isn't a bug in Requests. The server your talking to (or an intermediary) is mucking with the compression of the response.",
"Going to resolve since there's nothing we can do here. This would need to be resolved with the server in the network chain.",
"On the other hand, other libraries (wget, firefox), seem to download the data.",
"Any fix for this would be in urllib3"
] |
https://api.github.com/repos/psf/requests/issues/5427
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5427/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5427/comments
|
https://api.github.com/repos/psf/requests/issues/5427/events
|
https://github.com/psf/requests/issues/5427
| 602,242,935
|
MDU6SXNzdWU2MDIyNDI5MzU=
| 5,427
|
Cannot download files larger than 124MB
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/61763378?v=4",
"events_url": "https://api.github.com/users/stefanosporiazis/events{/privacy}",
"followers_url": "https://api.github.com/users/stefanosporiazis/followers",
"following_url": "https://api.github.com/users/stefanosporiazis/following{/other_user}",
"gists_url": "https://api.github.com/users/stefanosporiazis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/stefanosporiazis",
"id": 61763378,
"login": "stefanosporiazis",
"node_id": "MDQ6VXNlcjYxNzYzMzc4",
"organizations_url": "https://api.github.com/users/stefanosporiazis/orgs",
"received_events_url": "https://api.github.com/users/stefanosporiazis/received_events",
"repos_url": "https://api.github.com/users/stefanosporiazis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/stefanosporiazis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stefanosporiazis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/stefanosporiazis",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 9
|
2020-04-17T21:26:53Z
|
2021-08-31T00:07:01Z
|
2020-05-12T17:00:24Z
|
NONE
|
resolved
|
I'm using requests to download files from my remote server. All files under 124MB are downloaded and saved properly. Files larger than that are only downloaded up to 124MB and the rest of the data is skipped.
Originally I hadn't set **stream** to **True** and I was simply saving the data using **r.content**. I thought setting **stream** to **True** and iterating over chunks with **iter_content()** would fix my problem but it persists.
Am I doing something wrong?
Here's my code
```python
for file in files_list:
url = "http://server:8080/path/" + file
r = requests.get(url, stream=True)
with open(file, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
f.write(chunk)
f.flush()
```
**Edit:** I previously stated that it downloaded up to 130MB, but it's actually 124MB.
**Edit 2:** Solution that worked for me: https://serverfault.com/questions/470403/apache-2-4-on-windows-2008-large-file-downloads-are-corrupt
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/61763378?v=4",
"events_url": "https://api.github.com/users/stefanosporiazis/events{/privacy}",
"followers_url": "https://api.github.com/users/stefanosporiazis/followers",
"following_url": "https://api.github.com/users/stefanosporiazis/following{/other_user}",
"gists_url": "https://api.github.com/users/stefanosporiazis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/stefanosporiazis",
"id": 61763378,
"login": "stefanosporiazis",
"node_id": "MDQ6VXNlcjYxNzYzMzc4",
"organizations_url": "https://api.github.com/users/stefanosporiazis/orgs",
"received_events_url": "https://api.github.com/users/stefanosporiazis/received_events",
"repos_url": "https://api.github.com/users/stefanosporiazis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/stefanosporiazis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stefanosporiazis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/stefanosporiazis",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5427/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5427/timeline
| null |
completed
| null | null | false
|
[
"What file type were you trying to download and what type of webserver are you running? (If you don't know what type you might be able to find it in the \"X-Powered-By\" or \"Server\" response headers) I think I have a solution but still trying to debug. ",
"Webserver is: **Apache/2.4.37 (Win64) PHP/7.3.1**\r\nThe file type is a Unity Engine binary file with **.resS** extension\r\n\r\nI still haven't found a solution and I was forced to split the file in smaller pieces and combine them as they're being downloaded.",
"what does \r\n\r\n```python\r\nr.headers[\"Content-Length\"]\r\n```\r\n\r\nSay?",
"> what does\r\n> \r\n> ```python\r\n> r.headers[\"Content-Length\"]\r\n> ```\r\n> \r\n> Say?\r\n\r\nIt says ~219 million bytes. Which is correct since the file is 219MB.",
"Stupid question but what happens if you increase the chunk size to like **8192**?",
"> Stupid question but what happens if you increase the chunk size to like **8192**?\r\n\r\nSame thing. Downloads up to 124MB and stops. Last chunk was 514 bytes in size. I don't know why though.",
"And it downloads ok via wget / curl? can we get the url to test?",
"Dunno if related.. https://serverfault.com/questions/470403/apache-2-4-on-windows-2008-large-file-downloads-are-corrupt",
"> Dunno if related.. https://serverfault.com/questions/470403/apache-2-4-on-windows-2008-large-file-downloads-are-corrupt\r\n\r\nThat seems to be the solution! File downloads completely now. Thank you so much for your help! :heart: "
] |
https://api.github.com/repos/psf/requests/issues/5426
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5426/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5426/comments
|
https://api.github.com/repos/psf/requests/issues/5426/events
|
https://github.com/psf/requests/pull/5426
| 600,933,308
|
MDExOlB1bGxSZXF1ZXN0NDA0MjY4ODU5
| 5,426
|
word correction
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24846146?v=4",
"events_url": "https://api.github.com/users/cciprian5/events{/privacy}",
"followers_url": "https://api.github.com/users/cciprian5/followers",
"following_url": "https://api.github.com/users/cciprian5/following{/other_user}",
"gists_url": "https://api.github.com/users/cciprian5/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cciprian5",
"id": 24846146,
"login": "cciprian5",
"node_id": "MDQ6VXNlcjI0ODQ2MTQ2",
"organizations_url": "https://api.github.com/users/cciprian5/orgs",
"received_events_url": "https://api.github.com/users/cciprian5/received_events",
"repos_url": "https://api.github.com/users/cciprian5/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cciprian5/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cciprian5/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cciprian5",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-04-16T10:35:24Z
|
2021-08-29T00:06:56Z
|
2020-04-30T15:51:52Z
|
NONE
|
resolved
|
{
"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/5426/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5426/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5426.diff",
"html_url": "https://github.com/psf/requests/pull/5426",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5426.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5426"
}
| true
|
[
"This isn't a correction. `sans` means `without`.",
"Mea culpa... I did not know that this word exists in english. Thought that\r\nit's a leftover from french translation.\r\n\r\n\r\n\r\n\r\nOn Thu, Apr 16, 2020 at 5:34 PM Ian Stapleton Cordasco <\r\nnotifications@github.com> wrote:\r\n\r\n> This isn't a correction. sans means without.\r\n>\r\n> —\r\n> You are receiving this because you authored the thread.\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/psf/requests/pull/5426#issuecomment-614691816>, or\r\n> unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AF5R6QQLWAF24ZO7OYZUYI3RM4JPTANCNFSM4MJPVOSQ>\r\n> .\r\n>\r\n",
"It's one of those French words that actually gets used in (at least American) English with relative frequency. I'm not against replacing it with \"without\" but it's not a faux pas in this case"
] |
|
https://api.github.com/repos/psf/requests/issues/5425
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5425/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5425/comments
|
https://api.github.com/repos/psf/requests/issues/5425/events
|
https://github.com/psf/requests/issues/5425
| 600,500,899
|
MDU6SXNzdWU2MDA1MDA4OTk=
| 5,425
|
Requests does not terminate sending data if a response is received
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/44279559?v=4",
"events_url": "https://api.github.com/users/crabtreej/events{/privacy}",
"followers_url": "https://api.github.com/users/crabtreej/followers",
"following_url": "https://api.github.com/users/crabtreej/following{/other_user}",
"gists_url": "https://api.github.com/users/crabtreej/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/crabtreej",
"id": 44279559,
"login": "crabtreej",
"node_id": "MDQ6VXNlcjQ0Mjc5NTU5",
"organizations_url": "https://api.github.com/users/crabtreej/orgs",
"received_events_url": "https://api.github.com/users/crabtreej/received_events",
"repos_url": "https://api.github.com/users/crabtreej/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/crabtreej/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/crabtreej/subscriptions",
"type": "User",
"url": "https://api.github.com/users/crabtreej",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2020-04-15T18:26:23Z
|
2021-09-01T00:11:27Z
|
2020-04-16T17:56:34Z
|
NONE
|
resolved
|
**Summary**
A request.post() will continue sending the entirety of the provided data after the receiver has already attempted to terminate the request. Specifically, this problem is occurring with requests 2.23.0, and the request is being sent to a Django server running Django 3.0.5. I was unsure if this should be a bug or a feature, but since it deviates from other standard tools (e.g. curl), I figured it should be a bug.
**Expected Result**
1. I send a POST request to a Django server's endpoint containing some large (>200 mb) multi-part encoded file.
2. The Django server quickly returns an HTTP 400 response to the sender.
3. I expect that the sender would then stop sending data over the socket, collect Django's response, and return from the POST without sending the rest of the data, which will never be read.
This is Curl's response to handling receiving an early response.
**Actual Result**
Step 1 and 2 proceed as normal. In step 3, requests will instead continue sending all of the data to the server even though a response has already been received.
My use case is sending files on the order of several GB (which I know is not typical), and request's behavior will kill the receiving server because Django will attempt to read all the 'leftover' data (which is a huge amount) in one run.
**Reproduction Steps**
**Request's Side**
```python
import requests
file_name = 'test.txt'
f_handle = open(file_name, 'rb')
res = requests.post('http://localhost:8000/upload', files={'file': (file_name, f_handle, 'raw')})
res.raise_for_status()
```
The error can be difficult to see here because at a certain file size there will be a memory error from requests, so it's hard to tell if it's stuck sending. Using requests-toolbelt allows arbitrarily large multipart files by streaming them, and I originally posted the error there - [Requests-Toolbelt error](https://github.com/requests/toolbelt/issues/292). If it makes the hang when requests sends the entire file easier to see, here's code using a MultipartEncoder as well, toolbelt version 0.9.1.
**Alt Request's Side**:
```python
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
file_name = 'test.txt'
f_handle = open(file_name, 'rb')
m = MultipartEncoder({'file': (file_name, f_handle, 'raw')})
res = requests.post('http://localhost:8000/upload', data=m, headers={'Content-Type': m.content_type})
res.raise_for_status()
```
**Django views.py**: Just kicks back an error
```python
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
@csrf_exempt
@require_POST
def upload(request):
return HttpResponse("Done!", status=400)
```
**Curl's Behavior**: Sending an ~800mb file, stops immediately (147 bytes in) and shows Django's response.
`curl -F file=test.txt -k http://localhost:8000/upload`
```
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 152 100 5 100 147 333 9800 --:--:-- --:--:-- --:--:-- 10133 Done!
```
**System Information**
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.6.6"
},
"platform": {
"release": "7",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "100020ff"
},
"urllib3": {
"version": "1.25.8"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/44279559?v=4",
"events_url": "https://api.github.com/users/crabtreej/events{/privacy}",
"followers_url": "https://api.github.com/users/crabtreej/followers",
"following_url": "https://api.github.com/users/crabtreej/following{/other_user}",
"gists_url": "https://api.github.com/users/crabtreej/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/crabtreej",
"id": 44279559,
"login": "crabtreej",
"node_id": "MDQ6VXNlcjQ0Mjc5NTU5",
"organizations_url": "https://api.github.com/users/crabtreej/orgs",
"received_events_url": "https://api.github.com/users/crabtreej/received_events",
"repos_url": "https://api.github.com/users/crabtreej/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/crabtreej/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/crabtreej/subscriptions",
"type": "User",
"url": "https://api.github.com/users/crabtreej",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5425/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5425/timeline
| null |
completed
| null | null | false
|
[
"Early responses aren't supported by Python's standard `httplib`/`http.client` and so Requests and urllib3 cannot support them.",
"Thank you for the quick response. Do you know if httplib2 supports early responses, or is requests already based on httplib2?",
"I would expect a client built on something like Twisted or Tornado to be able to handle early responses. I don't expect that `httplib2` would handle that but it might.",
"Just for posterity's sake, in case anyone has a similar use case - I found that PycURL supports handling early responses. Thanks for the information!"
] |
https://api.github.com/repos/psf/requests/issues/5424
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5424/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5424/comments
|
https://api.github.com/repos/psf/requests/issues/5424/events
|
https://github.com/psf/requests/pull/5424
| 599,780,380
|
MDExOlB1bGxSZXF1ZXN0NDAzMzUwNzYw
| 5,424
|
WIP: Allow use of system CA certs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1520812?v=4",
"events_url": "https://api.github.com/users/jflemer-ndp/events{/privacy}",
"followers_url": "https://api.github.com/users/jflemer-ndp/followers",
"following_url": "https://api.github.com/users/jflemer-ndp/following{/other_user}",
"gists_url": "https://api.github.com/users/jflemer-ndp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jflemer-ndp",
"id": 1520812,
"login": "jflemer-ndp",
"node_id": "MDQ6VXNlcjE1MjA4MTI=",
"organizations_url": "https://api.github.com/users/jflemer-ndp/orgs",
"received_events_url": "https://api.github.com/users/jflemer-ndp/received_events",
"repos_url": "https://api.github.com/users/jflemer-ndp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jflemer-ndp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jflemer-ndp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jflemer-ndp",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-04-14T18:41:02Z
|
2021-08-29T00:06:57Z
|
2020-04-15T21:49:40Z
|
NONE
|
resolved
|
This allows setting `REQUESTS_CA_BUNDLE=SYSTEM` to make Requests behaves like the base python standard library with respect to CA cert trust.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1520812?v=4",
"events_url": "https://api.github.com/users/jflemer-ndp/events{/privacy}",
"followers_url": "https://api.github.com/users/jflemer-ndp/followers",
"following_url": "https://api.github.com/users/jflemer-ndp/following{/other_user}",
"gists_url": "https://api.github.com/users/jflemer-ndp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jflemer-ndp",
"id": 1520812,
"login": "jflemer-ndp",
"node_id": "MDQ6VXNlcjE1MjA4MTI=",
"organizations_url": "https://api.github.com/users/jflemer-ndp/orgs",
"received_events_url": "https://api.github.com/users/jflemer-ndp/received_events",
"repos_url": "https://api.github.com/users/jflemer-ndp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jflemer-ndp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jflemer-ndp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jflemer-ndp",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5424/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5424/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5424.diff",
"html_url": "https://github.com/psf/requests/pull/5424",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5424.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5424"
}
| true
|
[
"Based on a comment on the original issue (https://github.com/psf/requests/issues/2966#issuecomment-613577111) this is not trustworthy (i.e., we can't guarantee that the systems will remotely do the right thing) enough of a fix to accept.",
"This commit doesn't change default behavior.",
"I don't see what your comment has to do with my point that anyone attempting to use this value would have no visibility into whether it's remotely doing the right thing because this library and it's dependencies can't guarantee that.",
"Agree, it doesn't guarantee anything other than that it will cause Requests to use the underlying python ssl behavior. And users have to explicitly enable it, therefor assume responsibility for use.",
"Right. And users can already do that without overloading the usage of this environment bundle with a transport adapter. For example, the [toolbelt](/requests/toolbelt) has a SSL Adapter which allows for modification of the defaults and makes it easy to search for usage of non-default TLS settings. A similar approach could be taken by a user to force the default certificate locations to be used instead of certifi including doing something like:\r\n\r\n```\r\nREQUESTS_CA_BUNDLE=\"$(python -c 'import ssl; print(ssl.get_default_verify_paths().cafile)')\"\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/5423
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5423/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5423/comments
|
https://api.github.com/repos/psf/requests/issues/5423/events
|
https://github.com/psf/requests/issues/5423
| 599,509,923
|
MDU6SXNzdWU1OTk1MDk5MjM=
| 5,423
|
HTTPS under Jython 2.7.2 failes
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/23736716?v=4",
"events_url": "https://api.github.com/users/lukicsl/events{/privacy}",
"followers_url": "https://api.github.com/users/lukicsl/followers",
"following_url": "https://api.github.com/users/lukicsl/following{/other_user}",
"gists_url": "https://api.github.com/users/lukicsl/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lukicsl",
"id": 23736716,
"login": "lukicsl",
"node_id": "MDQ6VXNlcjIzNzM2NzE2",
"organizations_url": "https://api.github.com/users/lukicsl/orgs",
"received_events_url": "https://api.github.com/users/lukicsl/received_events",
"repos_url": "https://api.github.com/users/lukicsl/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lukicsl/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lukicsl/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lukicsl",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 5
|
2020-04-14T11:45:47Z
|
2021-09-01T00:11:28Z
|
2020-04-14T15:49:12Z
|
NONE
|
resolved
|
I am not able to use request for https site, without SSL things run fine
Jython 2.7.2 running in a docker container.
```
root@5ddd8c24f29b:/# python
Jython 2.7.2 (v2.7.2:925a3cc3b49d, Mar 21 2020, 10:03:58)
[OpenJDK Server VM (AdoptOpenJDK)] on java14
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> import json
>>> r =requests.get('http://api.eiswarnung.de/')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/jython/Lib/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/jython/Lib/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/jython/Lib/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/jython/Lib/site-packages/requests/sessions.py", line 665, in send
history = [resp for resp in gen] if allow_redirects else []
File "/usr/local/jython/Lib/site-packages/requests/sessions.py", line 237, in resolve_redirects
resp = self.send(
File "/usr/local/jython/Lib/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/local/jython/Lib/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.eiswarnung.de', port=443): Max retries exceeded with url: /api/public/ (Caused by SSLError(SSLError(1, u'Received fatal alert: internal_error'),))
>>>
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/23736716?v=4",
"events_url": "https://api.github.com/users/lukicsl/events{/privacy}",
"followers_url": "https://api.github.com/users/lukicsl/followers",
"following_url": "https://api.github.com/users/lukicsl/following{/other_user}",
"gists_url": "https://api.github.com/users/lukicsl/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lukicsl",
"id": 23736716,
"login": "lukicsl",
"node_id": "MDQ6VXNlcjIzNzM2NzE2",
"organizations_url": "https://api.github.com/users/lukicsl/orgs",
"received_events_url": "https://api.github.com/users/lukicsl/received_events",
"repos_url": "https://api.github.com/users/lukicsl/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lukicsl/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lukicsl/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lukicsl",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5423/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5423/timeline
| null |
completed
| null | null | false
|
[
"This is unsurprising since Jython isn't part of the CI for this project and no one tests it.",
"> This is unsurprising since Jython isn't part of the CI for this project and no one tests it.\r\n\r\nDoes this mean that actually nobody will followup with anything as a suggestion/solution?\r\nI am not that experienced in python development.",
"> Does this mean that actually nobody will followup with anything as a suggestion/solution?\r\n\r\nI don't think anyone involved with the project uses Jython or tests against it. Beyond that, this doesn't seem to be a problem with Requests but more likely a problem with that specific website and Jython based upon the exception message `Received fatal alert: internal_error` and https://github.com/jythontools/jython/issues/165",
"Opened a ticket at jython",
"the same happens with urllib3:\r\n```\r\nroot@34b4e3a1e41b:/# python\r\nJython 2.7.2 (v2.7.2:925a3cc3b49d, Mar 21 2020, 10:03:58)\r\n[OpenJDK Server VM (AdoptOpenJDK)] on java14\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import urllib3\r\n>>> http = urllib3.PoolManager()\r\n>>> r = http.request('GET', 'http://api.eiswarnung.de/')\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/usr/local/jython/Lib/site-packages/urllib3/request.py\", line 75, in request\r\n return self.request_encode_url(\r\n File \"/usr/local/jython/Lib/site-packages/urllib3/request.py\", line 97, in request_encode_url\r\n return self.urlopen(method, url, **extra_kw)\r\n File \"/usr/local/jython/Lib/site-packages/urllib3/poolmanager.py\", line 369, in urlopen\r\n return self.urlopen(method, redirect_location, **kw)\r\n File \"/usr/local/jython/Lib/site-packages/urllib3/poolmanager.py\", line 330, in urlopen\r\n response = conn.urlopen(method, u.request_uri, **kw)\r\n File \"/usr/local/jython/Lib/site-packages/urllib3/connectionpool.py\", line 747, in urlopen\r\n return self.urlopen(\r\n File \"/usr/local/jython/Lib/site-packages/urllib3/connectionpool.py\", line 747, in urlopen\r\n return self.urlopen(\r\n File \"/usr/local/jython/Lib/site-packages/urllib3/connectionpool.py\", line 719, in urlopen\r\n retries = retries.increment(\r\n File \"/usr/local/jython/Lib/site-packages/urllib3/util/retry.py\", line 436, in increment\r\n raise MaxRetryError(_pool, url, error or ResponseError(cause))\r\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.eiswarnung.de', port=443): Max retries exceeded with url: /api/public/ (Caused by SSLError(SSLError(1, u'Received fatal alert: internal_error'),))\r\n>>> \r\n```"
] |
https://api.github.com/repos/psf/requests/issues/5422
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5422/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5422/comments
|
https://api.github.com/repos/psf/requests/issues/5422/events
|
https://github.com/psf/requests/issues/5422
| 599,413,579
|
MDU6SXNzdWU1OTk0MTM1Nzk=
| 5,422
|
Usage of SourceAddressAdapter to create multiple source ip
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10762524?v=4",
"events_url": "https://api.github.com/users/kaushik853/events{/privacy}",
"followers_url": "https://api.github.com/users/kaushik853/followers",
"following_url": "https://api.github.com/users/kaushik853/following{/other_user}",
"gists_url": "https://api.github.com/users/kaushik853/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kaushik853",
"id": 10762524,
"login": "kaushik853",
"node_id": "MDQ6VXNlcjEwNzYyNTI0",
"organizations_url": "https://api.github.com/users/kaushik853/orgs",
"received_events_url": "https://api.github.com/users/kaushik853/received_events",
"repos_url": "https://api.github.com/users/kaushik853/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kaushik853/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kaushik853/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kaushik853",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-04-14T09:06:44Z
|
2021-09-01T00:11:29Z
|
2020-04-14T13:12:47Z
|
NONE
|
resolved
|
Hi,
Can you tell how can i test it with multiple source ip address . Something i tried like
```python
from requests_toolbelt.adapters import source
session = PACSession(pac)
list_source_ip_and_url = [("10.129.xx.yy", "https://google.com"), ("10.189.yy.xx", "https://random.com/Surveyor.Web/")]
responses = []
try:
for source_ip, url in list_source_ip_and_url:
new_source = source.SourceAddressAdapter(source_ip)
session.mount('http://', new_source)
session.mount('https://', new_source)
responses.append(session.get(url))
print(responses)
except Exception as e:
print(e)
```
I am getting error like:
HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x033D5547>: Failed to establish a new connection: [WinError 10049] The requested address is not valid in its context'))
Looks like im hitting some requests module error.
Is it because i can't assign source ip to my interface?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10762524?v=4",
"events_url": "https://api.github.com/users/kaushik853/events{/privacy}",
"followers_url": "https://api.github.com/users/kaushik853/followers",
"following_url": "https://api.github.com/users/kaushik853/following{/other_user}",
"gists_url": "https://api.github.com/users/kaushik853/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kaushik853",
"id": 10762524,
"login": "kaushik853",
"node_id": "MDQ6VXNlcjEwNzYyNTI0",
"organizations_url": "https://api.github.com/users/kaushik853/orgs",
"received_events_url": "https://api.github.com/users/kaushik853/received_events",
"repos_url": "https://api.github.com/users/kaushik853/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kaushik853/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kaushik853/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kaushik853",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5422/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5422/timeline
| null |
completed
| null | null | false
|
[
"This isn't appropriate for this project. `requests_toolbelt` is a separate third-party project.",
"ok, i will open it there, thanks"
] |
https://api.github.com/repos/psf/requests/issues/5421
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5421/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5421/comments
|
https://api.github.com/repos/psf/requests/issues/5421/events
|
https://github.com/psf/requests/issues/5421
| 598,734,110
|
MDU6SXNzdWU1OTg3MzQxMTA=
| 5,421
|
How can I use sendfile?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11208082?v=4",
"events_url": "https://api.github.com/users/ImSingee/events{/privacy}",
"followers_url": "https://api.github.com/users/ImSingee/followers",
"following_url": "https://api.github.com/users/ImSingee/following{/other_user}",
"gists_url": "https://api.github.com/users/ImSingee/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ImSingee",
"id": 11208082,
"login": "ImSingee",
"node_id": "MDQ6VXNlcjExMjA4MDgy",
"organizations_url": "https://api.github.com/users/ImSingee/orgs",
"received_events_url": "https://api.github.com/users/ImSingee/received_events",
"repos_url": "https://api.github.com/users/ImSingee/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ImSingee/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ImSingee/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ImSingee",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-04-13T07:49:52Z
|
2021-09-01T00:11:24Z
|
2020-04-30T16:03:16Z
|
NONE
|
resolved
|
I tried
```
r = requests.get(SOME_URL, stream=True, verify=False)
with open('/path/to/dest', 'wb') as f:
socket.fromfd(r.raw.fileno(), socket.AF_INET, socket.SOCK_STREAM).sendfile(f)
```
but it doesn't work.
|
{
"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/5421/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5421/timeline
| null |
completed
| null | null | false
|
[
"You can't use sendfile.",
"Hi @ImSingee,\r\n\r\nThis isn't something Requests supports and I don't think we can provide help on it. You'd need to do some more digging with the socket library."
] |
https://api.github.com/repos/psf/requests/issues/5420
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5420/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5420/comments
|
https://api.github.com/repos/psf/requests/issues/5420/events
|
https://github.com/psf/requests/issues/5420
| 598,384,959
|
MDU6SXNzdWU1OTgzODQ5NTk=
| 5,420
|
json parameter should transform booleans
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2020-04-12T01:15:38Z
|
2021-09-01T00:11:29Z
|
2020-04-13T23:13:55Z
|
NONE
|
resolved
|
Summary.
`json=` parameter should correctly transform booleans.
## Expected Result
Given this:
```
resp = req.post('https://example.com/endPoint',
json={ "foo": false }
)
```
I'd expect this to work, and python to correctly transform `false` to `False`.
## Actual Result
Instead, I get `"foo": false, NameError: name 'false' is not defined`
This works:
```
resp = req.post('https://example.com/endPoint',
json={ "foo": False }
)
```
And this works:
```
payload = json.loads("{ "foo": false }")
resp = req.post('https://example.com/endPoint',
json=payload
)
```
Therefore this is an request for enhancement that the `requests` library handle this for us, so that it "just works".
| 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/5420/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5420/timeline
| null |
completed
| null | null | false
|
[
"The requests library can not change the actual syntax of Python",
"Yes, but you can include some rudimentary transformation inside the `post` method?",
"I don't think you understand what is happening here, @Dynatrace-Adam-Gardner .\r\n\r\nTry just doing:\r\n\r\n```py\r\njson={ \"foo\": False }\r\n```\r\n\r\nYou're binding a dictionary using Python's syntax to a name - `json`. With this you could then do\r\n\r\n```py\r\nrequests.post(url, json=json)\r\n```\r\n\r\nLikewise you can pass that dictionary in as you are trying to but Python's lexer and syntax are inescapable inside the `(` and `)` because `requests` literally can neither change the lexer nor the syntax of the compiled Python binary.\r\n\r\nThere is absolutely nothing a library like Requests can do in this case.\r\n\r\nIf you want you can do:\r\n\r\n```py\r\nfalse = False\r\n```\r\n\r\nAnd thus you've done your own rudimentary transformation, but there is no pre-processing that Requests can do because it's executed after Python has lexed the code and is executing it. The `NameError` you're getting comes directly from Python.",
"You guessed correctly. I'm very very green with Python. Thanks for the info. I'll close this now :) ;)"
] |
https://api.github.com/repos/psf/requests/issues/5419
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5419/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5419/comments
|
https://api.github.com/repos/psf/requests/issues/5419/events
|
https://github.com/psf/requests/issues/5419
| 598,354,716
|
MDU6SXNzdWU1OTgzNTQ3MTY=
| 5,419
|
"Authorization" header is rewritten for HTTP Basic Auth, even when it is explicitly set in the headers kwarg
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/328598?v=4",
"events_url": "https://api.github.com/users/terminalmage/events{/privacy}",
"followers_url": "https://api.github.com/users/terminalmage/followers",
"following_url": "https://api.github.com/users/terminalmage/following{/other_user}",
"gists_url": "https://api.github.com/users/terminalmage/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/terminalmage",
"id": 328598,
"login": "terminalmage",
"node_id": "MDQ6VXNlcjMyODU5OA==",
"organizations_url": "https://api.github.com/users/terminalmage/orgs",
"received_events_url": "https://api.github.com/users/terminalmage/received_events",
"repos_url": "https://api.github.com/users/terminalmage/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/terminalmage/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/terminalmage/subscriptions",
"type": "User",
"url": "https://api.github.com/users/terminalmage",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 3
|
2020-04-11T21:28:37Z
|
2021-09-01T00:11:29Z
|
2020-04-12T15:49:05Z
|
NONE
|
resolved
|
I tried setting the `Authorization` header manually to make a request to the Github API, but authentication failed despite the same token working fine when making the request using cURL, `urllib.request.Request()`, and other methods.
## Expected Result
Successful auth and a `200 OK` response.
## Actual Result
Authentication fails with a `401 Bad Credentials` response.
Upon inspecting the response's `request` attribute, I found that the `Authorization` header had been overwritten (looks like this happens [here](https://github.com/psf/requests/blob/9cdf294/requests/auth.py#L95-L97)).
I've since worked around this, but in my opinion, one should expect that if they are setting the `Authorization` header manually (rather than using the `auth` param), the header should not be overwritten.
I can draft a PR to address this if the project maintainers agree to such a change.
## Reproduction Steps
Create an [access token](https://github.com/settings/tokens) and then try to auth to the API like so:
```python
requests.get(
'https://api.github.com/notifications',
headers={'Authorization': 'token MY_TOKEN_HERE'}
)
```
## System Information
```python
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.8.2"
},
"platform": {
"release": "5.6.3-arch1-1",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010106f"
},
"urllib3": {
"version": "1.25.8"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/328598?v=4",
"events_url": "https://api.github.com/users/terminalmage/events{/privacy}",
"followers_url": "https://api.github.com/users/terminalmage/followers",
"following_url": "https://api.github.com/users/terminalmage/following{/other_user}",
"gists_url": "https://api.github.com/users/terminalmage/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/terminalmage",
"id": 328598,
"login": "terminalmage",
"node_id": "MDQ6VXNlcjMyODU5OA==",
"organizations_url": "https://api.github.com/users/terminalmage/orgs",
"received_events_url": "https://api.github.com/users/terminalmage/received_events",
"repos_url": "https://api.github.com/users/terminalmage/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/terminalmage/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/terminalmage/subscriptions",
"type": "User",
"url": "https://api.github.com/users/terminalmage",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5419/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5419/timeline
| null |
completed
| null | null | false
|
[
"> Upon inspecting the response's `request` attribute, I found that the `Authorization` header had been overwritten (looks like this happens [here](https://github.com/psf/requests/blob/9cdf294/requests/auth.py#L95-L97)).\r\n\r\nI believe your diagnosis is wrong. You likely have a `.netrc` file with basic credentials in it and need to set `trust_env=False`.",
"You're right. I knew about the .netrc parsing feature, but I just got a new laptop and imported my dotfiles using [chezmoi](https://github.com/twpayne/chezmoi) and didn't realize I had added an old .netrc file to chezmoi. After deleting it, auth works fine.",
"This then becomes a duplicate of an issue about `trust_env`"
] |
https://api.github.com/repos/psf/requests/issues/5418
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5418/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5418/comments
|
https://api.github.com/repos/psf/requests/issues/5418/events
|
https://github.com/psf/requests/pull/5418
| 598,024,924
|
MDExOlB1bGxSZXF1ZXN0NDAyMDE0MTQ2
| 5,418
|
Remove extraneous paramater from doctring for put() method
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/418738?v=4",
"events_url": "https://api.github.com/users/gregpoulos/events{/privacy}",
"followers_url": "https://api.github.com/users/gregpoulos/followers",
"following_url": "https://api.github.com/users/gregpoulos/following{/other_user}",
"gists_url": "https://api.github.com/users/gregpoulos/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gregpoulos",
"id": 418738,
"login": "gregpoulos",
"node_id": "MDQ6VXNlcjQxODczOA==",
"organizations_url": "https://api.github.com/users/gregpoulos/orgs",
"received_events_url": "https://api.github.com/users/gregpoulos/received_events",
"repos_url": "https://api.github.com/users/gregpoulos/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gregpoulos/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gregpoulos/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gregpoulos",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-04-10T18:21:51Z
|
2021-08-29T00:06:57Z
|
2020-04-10T18:52:20Z
|
NONE
|
resolved
|
There's an unused `json` parameter in the docstring from the put() method.
|
{
"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/5418/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5418/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5418.diff",
"html_url": "https://github.com/psf/requests/pull/5418",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5418.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5418"
}
| true
|
[
"Hi @gregpoulos, thanks for the contribution! This was added in #3666 because there was some confusion on whether verbs other than POST supported the json argument. The documentation change is intended to make it clear despite it not being an explicit arg. I think we'll probably leave this in place for now.",
"@nateprewitt Understood. Thanks for the quick response!"
] |
https://api.github.com/repos/psf/requests/issues/5417
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5417/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5417/comments
|
https://api.github.com/repos/psf/requests/issues/5417/events
|
https://github.com/psf/requests/issues/5417
| 596,550,777
|
MDU6SXNzdWU1OTY1NTA3Nzc=
| 5,417
|
Downloading corrupted files with Python
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/62334013?v=4",
"events_url": "https://api.github.com/users/Pablo-Marina/events{/privacy}",
"followers_url": "https://api.github.com/users/Pablo-Marina/followers",
"following_url": "https://api.github.com/users/Pablo-Marina/following{/other_user}",
"gists_url": "https://api.github.com/users/Pablo-Marina/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Pablo-Marina",
"id": 62334013,
"login": "Pablo-Marina",
"node_id": "MDQ6VXNlcjYyMzM0MDEz",
"organizations_url": "https://api.github.com/users/Pablo-Marina/orgs",
"received_events_url": "https://api.github.com/users/Pablo-Marina/received_events",
"repos_url": "https://api.github.com/users/Pablo-Marina/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Pablo-Marina/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Pablo-Marina/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Pablo-Marina",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-04-08T12:46:07Z
|
2021-09-01T00:11:31Z
|
2020-04-10T18:37:55Z
|
NONE
|
resolved
|
Hello,
I have a XAMPP Server on Windows, from which I aim to download remotely a pdf file located in C:/xampp/htdocs/ using requests library from python to generate it in the very same folder but with another name (later I'll change the direction to downloads folder once it works)
The server is running in IP address 192.168.1.134 port 8081.
This is the part of the code:
```
url="http://192.168.1.134:8081/c:/xampp/htdocs/informe.pdf"
response=requests.get(url)
tofile=open('informelocal.pdf','wb')
tofile.write(response.content)
tofile.close()
```
The thing is, once I try to open the local file, I can't open it, because it's corrupted.
I think something is matter with that URL, but I don't know how to put it right.
Thanks for your time
|
{
"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": 1,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/5417/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5417/timeline
| null |
completed
| null | null | false
|
[
"Hi there! Thanks for opening this issue. Unfortunately, it seems this is a request for help instead of a report of a defect in the project. Please use [StackOverflow](https://stackoverflow.com) for general usage questions instead and only report defects here."
] |
https://api.github.com/repos/psf/requests/issues/5416
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5416/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5416/comments
|
https://api.github.com/repos/psf/requests/issues/5416/events
|
https://github.com/psf/requests/issues/5416
| 596,240,232
|
MDU6SXNzdWU1OTYyNDAyMzI=
| 5,416
|
Add a Pull request template
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45192178?v=4",
"events_url": "https://api.github.com/users/to09/events{/privacy}",
"followers_url": "https://api.github.com/users/to09/followers",
"following_url": "https://api.github.com/users/to09/following{/other_user}",
"gists_url": "https://api.github.com/users/to09/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/to09",
"id": 45192178,
"login": "to09",
"node_id": "MDQ6VXNlcjQ1MTkyMTc4",
"organizations_url": "https://api.github.com/users/to09/orgs",
"received_events_url": "https://api.github.com/users/to09/received_events",
"repos_url": "https://api.github.com/users/to09/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/to09/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/to09/subscriptions",
"type": "User",
"url": "https://api.github.com/users/to09",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-04-08T01:06:05Z
|
2021-09-01T00:11:24Z
|
2020-04-30T16:12:18Z
|
NONE
|
resolved
|
To make easier for the contributors and guide them in the right way to contribute with the deploy preview check.
|
{
"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": 2,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 3,
"url": "https://api.github.com/repos/psf/requests/issues/5416/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5416/timeline
| null |
completed
| null | null | false
|
[
"Hi @to09,\r\n\r\nThanks for the interest! You can find the full contribution guide [here](https://requests.readthedocs.io/en/master/dev/contributing/) which would be the best place to get that information.\r\n\r\nThat said, Requests is both on a semi-permanent feature freeze and under limited support. We're only able to reliably review security issues or critical bugs right now. For that reason, I think adding a template may generate more churn for all parties."
] |
https://api.github.com/repos/psf/requests/issues/5415
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5415/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5415/comments
|
https://api.github.com/repos/psf/requests/issues/5415/events
|
https://github.com/psf/requests/issues/5415
| 595,860,962
|
MDU6SXNzdWU1OTU4NjA5NjI=
| 5,415
|
Specifying number of retries in requests.get
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/845175?v=4",
"events_url": "https://api.github.com/users/ndvbd/events{/privacy}",
"followers_url": "https://api.github.com/users/ndvbd/followers",
"following_url": "https://api.github.com/users/ndvbd/following{/other_user}",
"gists_url": "https://api.github.com/users/ndvbd/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ndvbd",
"id": 845175,
"login": "ndvbd",
"node_id": "MDQ6VXNlcjg0NTE3NQ==",
"organizations_url": "https://api.github.com/users/ndvbd/orgs",
"received_events_url": "https://api.github.com/users/ndvbd/received_events",
"repos_url": "https://api.github.com/users/ndvbd/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ndvbd/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ndvbd/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ndvbd",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2020-04-07T13:17:56Z
|
2021-09-01T00:11:30Z
|
2020-04-10T18:43:01Z
|
NONE
|
resolved
|
Is it possible to specify number of retries in requests.get?
|
{
"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/5415/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5415/timeline
| null |
completed
| null | null | false
|
[
"No",
"Is this a feature that would be considered for a feature addition? I'd be happy to write if so.",
"No. The project's been under a feature freeze for years - most especially when it comes to the API",
"Sigmavirus24 is right, we're currently under a feature freeze for Requests. There are a handful of guides available for using urllib3's `Retry` class with a Requests `Session`, but we don't support retries with the `requests.get` api."
] |
https://api.github.com/repos/psf/requests/issues/5414
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5414/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5414/comments
|
https://api.github.com/repos/psf/requests/issues/5414/events
|
https://github.com/psf/requests/pull/5414
| 594,552,691
|
MDExOlB1bGxSZXF1ZXN0Mzk5MTY1Njc0
| 5,414
|
Raise InvalidUrl if host starts with '.' character.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/23049315?v=4",
"events_url": "https://api.github.com/users/mondeja/events{/privacy}",
"followers_url": "https://api.github.com/users/mondeja/followers",
"following_url": "https://api.github.com/users/mondeja/following{/other_user}",
"gists_url": "https://api.github.com/users/mondeja/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mondeja",
"id": 23049315,
"login": "mondeja",
"node_id": "MDQ6VXNlcjIzMDQ5MzE1",
"organizations_url": "https://api.github.com/users/mondeja/orgs",
"received_events_url": "https://api.github.com/users/mondeja/received_events",
"repos_url": "https://api.github.com/users/mondeja/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mondeja/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mondeja/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mondeja",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] |
{
"closed_at": "2021-12-30T21:48:07Z",
"closed_issues": 11,
"created_at": "2021-09-02T07:23:33Z",
"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/29",
"id": 7115399,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/29/labels",
"node_id": "MI_kwDOABTKOs4AbJKH",
"number": 29,
"open_issues": 0,
"state": "closed",
"title": "2.27.0",
"updated_at": "2021-12-30T21:48:07Z",
"url": "https://api.github.com/repos/psf/requests/milestones/29"
}
| 0
|
2020-04-05T16:52:04Z
|
2022-03-29T08:05:38Z
|
2021-12-29T01:39:37Z
|
CONTRIBUTOR
|
resolved
|
Closes #5367
Attempting to get `http://.example.com` results in a `UnicodeError` but should be raise `InvalidUrl` as attempting to get `http://*example.com`.
I've added `InvalidUrl` tests for `http://.example.com` and `http://*example.com`.
|
{
"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/5414/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5414/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5414.diff",
"html_url": "https://github.com/psf/requests/pull/5414",
"merged_at": "2021-12-29T01:39:36Z",
"patch_url": "https://github.com/psf/requests/pull/5414.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5414"
}
| true
|
[] |
https://api.github.com/repos/psf/requests/issues/5413
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5413/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5413/comments
|
https://api.github.com/repos/psf/requests/issues/5413/events
|
https://github.com/psf/requests/pull/5413
| 594,539,672
|
MDExOlB1bGxSZXF1ZXN0Mzk5MTU0NDAy
| 5,413
|
Add text_with_headers to Response model
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45501389?v=4",
"events_url": "https://api.github.com/users/JonPizza/events{/privacy}",
"followers_url": "https://api.github.com/users/JonPizza/followers",
"following_url": "https://api.github.com/users/JonPizza/following{/other_user}",
"gists_url": "https://api.github.com/users/JonPizza/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/JonPizza",
"id": 45501389,
"login": "JonPizza",
"node_id": "MDQ6VXNlcjQ1NTAxMzg5",
"organizations_url": "https://api.github.com/users/JonPizza/orgs",
"received_events_url": "https://api.github.com/users/JonPizza/received_events",
"repos_url": "https://api.github.com/users/JonPizza/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/JonPizza/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JonPizza/subscriptions",
"type": "User",
"url": "https://api.github.com/users/JonPizza",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-04-05T16:22:25Z
|
2021-08-29T00:06:54Z
|
2020-05-09T05:11:01Z
|
NONE
|
resolved
|
This property will return the entire HTTP response including the headers. There doesn't seem to be a `test_models.py` file in the tests folder so I'm not sure if I should make a test for this, but if so where would I make it?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5413/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5413/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5413.diff",
"html_url": "https://github.com/psf/requests/pull/5413",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5413.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5413"
}
| true
|
[
"Hi @JonPizza,\r\n\r\nRequests is currently under a feature freeze. This will probably be useful to a subset of users but is pretty straight forward to implement if needed. I think we'll pass on this for now. Thanks!"
] |
https://api.github.com/repos/psf/requests/issues/5412
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5412/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5412/comments
|
https://api.github.com/repos/psf/requests/issues/5412/events
|
https://github.com/psf/requests/issues/5412
| 593,519,559
|
MDU6SXNzdWU1OTM1MTk1NTk=
| 5,412
|
Expecting property name enclosed in double quotes
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1139228?v=4",
"events_url": "https://api.github.com/users/jeffreyscottgraham/events{/privacy}",
"followers_url": "https://api.github.com/users/jeffreyscottgraham/followers",
"following_url": "https://api.github.com/users/jeffreyscottgraham/following{/other_user}",
"gists_url": "https://api.github.com/users/jeffreyscottgraham/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jeffreyscottgraham",
"id": 1139228,
"login": "jeffreyscottgraham",
"node_id": "MDQ6VXNlcjExMzkyMjg=",
"organizations_url": "https://api.github.com/users/jeffreyscottgraham/orgs",
"received_events_url": "https://api.github.com/users/jeffreyscottgraham/received_events",
"repos_url": "https://api.github.com/users/jeffreyscottgraham/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jeffreyscottgraham/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jeffreyscottgraham/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jeffreyscottgraham",
"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": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
}
] |
closed
| true
| null |
[] | null | 9
|
2020-04-03T17:03:09Z
|
2021-12-25T23:00:34Z
|
2020-04-10T18:43:44Z
|
NONE
|
resolved
|
Summary.
Cant parse json result because property names are in single quotes instead of double
## Expected Result
A proper parse of course.
## Actual Result
Caught exception Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
## Reproduction Steps
res=requests.get(...)
s=str(res.json())
j=json.loads(s)
## System Information
python3 -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.3"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.7.3"
},
"platform": {
"release": "5.0.0-38-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010100f",
"version": "19.0.0"
},
"requests": {
"version": "2.21.0"
},
"system_ssl": {
"version": "1010102f"
},
"urllib3": {
"version": "1.24.1"
},
"using_pyopenssl": true
}
This is running on up-to-date Ubuntu 19.04 and python 3.7.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"
}
|
{
"+1": 1,
"-1": 1,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/5412/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5412/timeline
| null |
completed
| null | null | false
|
[
"Hi @jeffreyscottgraham,\r\n\r\nThis looks like a bit of confusion about data types. You're attempting to cast a Python dictionary into a string which will use single quotes by convention.\r\n\r\nPython dictionaries aren't directly equivalent with JSON. If you need a string representation of the data, you can either call `text()` on your response, or use `json.dumps` instead of trying to cast as a string.",
"I did finally figure out to use text().... i spent 4 hours literally hacking around for a solution.\r\nMay I request that an example be made part of the regular readme/documentation around the useof json(). It would have prevented all the wasted time looking for the solution.\r\nThanks for the ironically quick response :)",
"Do you have any suggestions on what you'd like to see added to the docs? We currently have example usage on the [front page](https://requests.readthedocs.io/en/master/) and a more detailed section in the [quick start guide](https://requests.readthedocs.io/en/master/user/quickstart/#json-response-content).",
"@jeffreyscottgraham I don't think it's up to the documentation of this project to teach you how to write Python.",
"Closing since the documentation appears to be in place and we didn't receive further feedback.",
"@sigmavirus24 examples actually speed up the development process. \"Tell me and I forget, teach me and I learn\".",
"@osamaramihafez we have examples but no one has explained how to improve them or what was confusing. OP here seemed to not find an example that's in the docs but didn't tell us what they looked for or how to improve that discoverability. Without details beyond \"I did this wrong and your docs are bad\" we can't action very much. That said, every library's documentation can not be responsible for making sure you've learned the language sufficiently well by teaching you how to write code in that language. There will always be superior resources for that elsewhere and it's not worth my time to half-ass that. Finally, more is not always better of it makes crucial examples harder to find. No piece of documentation written entirely by volunteers on limited time can satisfy everyone, but it can satisfy 95% and that's better than perfect.",
"> Hi @jeffreyscottgraham,\r\n> \r\n> This looks like a bit of confusion about data types. You're attempting to cast a Python dictionary into a string which will use single quotes by convention.\r\n> \r\n> Python dictionaries aren't directly equivalent with JSON. If you need a string representation of the data, you can either call `text()` on your response, or use `json.dumps` instead of trying to cast as a string.\r\n\r\nwas this thread supposed to help me convert `\"{'some string': 140}\"` into a json? \r\n\r\nYou're suggesting to use json.dumps, but if I could do that I wouldn't need to convert it INTO a json. That's how I'm getting the strings and I don't have control over how they get encoded. ",
"@EightRice if you can't import something from the standard library I don't know how to help you generate valid JSON or handle invalid JSON.\n\nAlso, if you're getting garbage over the wire, it's not this library's responsibility to magically understand the intent you have for using garbage. You'll need to discern how to parse that string correctly and (hopefully) safely and understand those trade-offs because, as I think you realize, you're not being sent JSON."
] |
https://api.github.com/repos/psf/requests/issues/5411
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5411/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5411/comments
|
https://api.github.com/repos/psf/requests/issues/5411/events
|
https://github.com/psf/requests/issues/5411
| 592,523,068
|
MDU6SXNzdWU1OTI1MjMwNjg=
| 5,411
|
Incorrect cookie handling: third level domain incorrectly uses second level domain cookies
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5113916?v=4",
"events_url": "https://api.github.com/users/dvorapa/events{/privacy}",
"followers_url": "https://api.github.com/users/dvorapa/followers",
"following_url": "https://api.github.com/users/dvorapa/following{/other_user}",
"gists_url": "https://api.github.com/users/dvorapa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dvorapa",
"id": 5113916,
"login": "dvorapa",
"node_id": "MDQ6VXNlcjUxMTM5MTY=",
"organizations_url": "https://api.github.com/users/dvorapa/orgs",
"received_events_url": "https://api.github.com/users/dvorapa/received_events",
"repos_url": "https://api.github.com/users/dvorapa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dvorapa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dvorapa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dvorapa",
"user_view_type": "public"
}
|
[] |
open
| false
| null |
[] | null | 1
|
2020-04-02T10:27:12Z
|
2020-05-14T08:44:28Z
| null |
NONE
| null |
When visiting (logging in to) zh.wikisource.org, cookies for the following domain are set:
- .wikisource.org
If one visits wikisource.org afterwards, cookies for the following domain are set:
- wikisource.org
After i.e. logout from zh.wikisource.org, zh.wikisource.org sends cookie invalidation request for .wikisource.org. Requests invalidates them correctly, leaves wikisource.org cookies untouched correctly.
But for further communication with zh.wikisource.org, requests incorrectly use remaining wikisource.org cookie. Which is rejected by zh.wikisource.org and followed by cookie invalidation request for .wikisource.org.
## Expected Result
It looks like the cookie handling library used by requests is doing something wrong (at least according to the RFCs), as it should not send the host-only cookie for wikisource.org to zh.wikisource.org. If it's using RFC 2109, "zh.wikisource.org" does not domain-match the cookie for "wikisource.org" because "wikisource.org" doesn't begin with a dot. If it's using RFC 6265, the domainless cookie for "wikisource.org" should have had the host-only-flag set meaning it should not be sent to "zh.wikisource.org". OTOH, it's possible it's being bug-compatible with browsers (RFC 6265 even notes that such a bug exists/existed in some agents in § 4.1.2.3).
## Actual Result
As written above, requests use wikisource.org cookie for zh.wikisource.org. Which is rejected by zh.wikisource.org and followed by cookie invalidation request for .wikisource.org". That is fulfilled (no cookies for .wikisource.org are set), but requests still tries to push cookies for wikisource.org to zh.wikisource.org. So the actual result is endless loop (https://travis-ci.org/github/wikimedia/pywikibot/jobs/669558038#L13763).
## Reproduction Steps
Simple:
```python
import pywikibot
s=pywikibot.Site('zh', 'wikisource')
print(s.hostname()) # zh.wikisource.org
s.login()
s2=pywikibot.Site('mul', 'wikisource')
print(s2.hostname()) # wikisource.org
s2.login()
s.logout()
s.login()
# endless loop here
```
Elaborate:
```python
import requests
s=requests.Session()
def login(url):
while True:
# login token
r1=s.post(url=url, data={'action':'query','meta':'tokens','type':'login','format':'json'})
logintoken = r1.json()['query']['tokens']['logintoken']
# login (test account)
r2=s.post(url=url, data={'action':'clientlogin','loginreturnurl':'https://example.com','logintoken':logintoken,'username':'Test20200402','password':'popokatepetl','format':'json'})
print(r2.json())
if r2.json().get('error') and r2.json()['error'].get('code') == 'badtoken':
continue
else:
break
#print(s.cookies)
def logout(url):
# logout token
r1=s.post(url=url, data={'action':'query','meta':'tokens','type':'csrf','format':'json'})
logouttoken = r1.json()['query']['tokens']['csrftoken']
# logout
r2=s.post(url=url, data={'action':'logout','token':logouttoken,'format':'json'})
print(r2.json())
#print(s.cookies)
url1 = 'https://zh.wikisource.org/w/api.php'
url2='https://wikisource.org/w/api.php'
login(url1)
login(url2)
logout(url1)
login(url1)
# endless loop here
```
## System Information
$ python -m requests.help
Reproduced on many PCs with many configurations and also on Travis-CI. Here is one:
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.9"
},
"platform": {
"release": "5.4.18",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010104f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
Links:
Reported and described in more detail in: https://phabricator.wikimedia.org/T224712
Reproducible immediately in: https://repl.it/repls/HarmfulBiodegradableExperiments
Pastebin (just in case): https://pastebin.com/7d7Dn9p1
| 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/5411/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5411/timeline
| null | null | null | null | false
|
[
"Is this a Python issue?"
] |
https://api.github.com/repos/psf/requests/issues/5410
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5410/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5410/comments
|
https://api.github.com/repos/psf/requests/issues/5410/events
|
https://github.com/psf/requests/pull/5410
| 592,464,391
|
MDExOlB1bGxSZXF1ZXN0Mzk3NDQxNjQy
| 5,410
|
Remove shebang from nonexecutable script
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13086088?v=4",
"events_url": "https://api.github.com/users/hrnciar/events{/privacy}",
"followers_url": "https://api.github.com/users/hrnciar/followers",
"following_url": "https://api.github.com/users/hrnciar/following{/other_user}",
"gists_url": "https://api.github.com/users/hrnciar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hrnciar",
"id": 13086088,
"login": "hrnciar",
"node_id": "MDQ6VXNlcjEzMDg2MDg4",
"organizations_url": "https://api.github.com/users/hrnciar/orgs",
"received_events_url": "https://api.github.com/users/hrnciar/received_events",
"repos_url": "https://api.github.com/users/hrnciar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hrnciar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hrnciar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hrnciar",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 0
|
2020-04-02T08:50:39Z
|
2022-02-26T15:00:31Z
|
2021-11-28T14:32:29Z
|
NONE
|
resolved
|
When packaging requests and pip (which bundles it) in Fedora, we have realised
that there is a nonexecutable file with a shebang line.
It seems that the primary purpose of this file is to be imported from Python
code and hence the shebang appears to be unnecessary.
Shebangs are hard to handle when doing downstream packaging, because it makes
sense for upstream to use `#!/usr/bin/env python` while in the RPM package, we
need to avoid that and use a more specific interpreter. Since the shebang was
unused, I propose to remove it to avoid the problems.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4",
"events_url": "https://api.github.com/users/sethmlarson/events{/privacy}",
"followers_url": "https://api.github.com/users/sethmlarson/followers",
"following_url": "https://api.github.com/users/sethmlarson/following{/other_user}",
"gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sethmlarson",
"id": 18519037,
"login": "sethmlarson",
"node_id": "MDQ6VXNlcjE4NTE5MDM3",
"organizations_url": "https://api.github.com/users/sethmlarson/orgs",
"received_events_url": "https://api.github.com/users/sethmlarson/received_events",
"repos_url": "https://api.github.com/users/sethmlarson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sethmlarson",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/5410/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5410/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5410.diff",
"html_url": "https://github.com/psf/requests/pull/5410",
"merged_at": "2021-11-28T14:32:29Z",
"patch_url": "https://github.com/psf/requests/pull/5410.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5410"
}
| true
|
[] |
https://api.github.com/repos/psf/requests/issues/5409
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5409/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5409/comments
|
https://api.github.com/repos/psf/requests/issues/5409/events
|
https://github.com/psf/requests/issues/5409
| 591,214,341
|
MDU6SXNzdWU1OTEyMTQzNDE=
| 5,409
|
missing implementation of "json" argument in "put" method
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7370334?v=4",
"events_url": "https://api.github.com/users/liyakun/events{/privacy}",
"followers_url": "https://api.github.com/users/liyakun/followers",
"following_url": "https://api.github.com/users/liyakun/following{/other_user}",
"gists_url": "https://api.github.com/users/liyakun/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/liyakun",
"id": 7370334,
"login": "liyakun",
"node_id": "MDQ6VXNlcjczNzAzMzQ=",
"organizations_url": "https://api.github.com/users/liyakun/orgs",
"received_events_url": "https://api.github.com/users/liyakun/received_events",
"repos_url": "https://api.github.com/users/liyakun/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/liyakun/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/liyakun/subscriptions",
"type": "User",
"url": "https://api.github.com/users/liyakun",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 4
|
2020-03-31T15:43:20Z
|
2021-09-01T00:11:34Z
|
2020-03-31T17:16:44Z
|
NONE
|
resolved
|
It seems that the implementation of "json" argument was forgot, see [1].
[1] https://github.com/psf/requests/blob/bebf5250b0df1b922ff534e987a4481cc4dde99d/requests/api.py#L128
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7370334?v=4",
"events_url": "https://api.github.com/users/liyakun/events{/privacy}",
"followers_url": "https://api.github.com/users/liyakun/followers",
"following_url": "https://api.github.com/users/liyakun/following{/other_user}",
"gists_url": "https://api.github.com/users/liyakun/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/liyakun",
"id": 7370334,
"login": "liyakun",
"node_id": "MDQ6VXNlcjczNzAzMzQ=",
"organizations_url": "https://api.github.com/users/liyakun/orgs",
"received_events_url": "https://api.github.com/users/liyakun/received_events",
"repos_url": "https://api.github.com/users/liyakun/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/liyakun/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/liyakun/subscriptions",
"type": "User",
"url": "https://api.github.com/users/liyakun",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5409/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5409/timeline
| null |
completed
| null | null | false
|
[
"Nope. It's accepted via `**kwargs*`.",
"@sigmavirus24 thanks, you are right.\r\n\r\nIt would be great to keep it in similar format as `post` method as they both accept this argument. Is there any specific reason why they are written in different ways?",
"Maintenance overhead is much higher if you have to keep argument lists updated in two places",
"Okay, I see, thanks for your explanation."
] |
https://api.github.com/repos/psf/requests/issues/5408
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5408/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5408/comments
|
https://api.github.com/repos/psf/requests/issues/5408/events
|
https://github.com/psf/requests/issues/5408
| 590,886,333
|
MDU6SXNzdWU1OTA4ODYzMzM=
| 5,408
|
Commercial Usage Rights
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10250923?v=4",
"events_url": "https://api.github.com/users/hi2rashid/events{/privacy}",
"followers_url": "https://api.github.com/users/hi2rashid/followers",
"following_url": "https://api.github.com/users/hi2rashid/following{/other_user}",
"gists_url": "https://api.github.com/users/hi2rashid/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hi2rashid",
"id": 10250923,
"login": "hi2rashid",
"node_id": "MDQ6VXNlcjEwMjUwOTIz",
"organizations_url": "https://api.github.com/users/hi2rashid/orgs",
"received_events_url": "https://api.github.com/users/hi2rashid/received_events",
"repos_url": "https://api.github.com/users/hi2rashid/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hi2rashid/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hi2rashid/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hi2rashid",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-03-31T08:02:43Z
|
2021-09-01T00:11:33Z
|
2020-04-03T17:41:11Z
|
NONE
|
resolved
|
We are using this module in our application with Django.
Can you please confirm if its okay to be used commercially.
Thank you in advance
|
{
"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/5408/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5408/timeline
| null |
completed
| null | null | false
|
[
"Hi @hi2rashid, this project is released under the Apache-2.0 license as noted [here](https://github.com/psf/requests/blob/master/LICENSE). You can use it freely within the constraints of that licensing agreement.\r\n\r\nHere's a quick explanation of expectations: https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)"
] |
https://api.github.com/repos/psf/requests/issues/5407
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5407/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5407/comments
|
https://api.github.com/repos/psf/requests/issues/5407/events
|
https://github.com/psf/requests/pull/5407
| 590,548,206
|
MDExOlB1bGxSZXF1ZXN0Mzk1ODYyMTIw
| 5,407
|
Bump bleach from 3.1.1 to 3.1.4
|
{
"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"
}
] |
closed
| true
| null |
[] | null | 1
|
2020-03-30T19:49:56Z
|
2021-08-29T00:06:58Z
|
2020-04-03T21:45:07Z
|
CONTRIBUTOR
|
resolved
|
Bumps [bleach](https://github.com/mozilla/bleach) from 3.1.1 to 3.1.4.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/mozilla/bleach/blob/master/CHANGES">bleach's changelog</a>.</em></p>
<blockquote>
<h2>Version 3.1.4 (March 24th, 2020)</h2>
<p><strong>Security fixes</strong></p>
<ul>
<li>
<p><code>bleach.clean</code> behavior parsing style attributes could result in a
regular expression denial of service (ReDoS).</p>
<p>Calls to <code>bleach.clean</code> with an allowed tag with an allowed
<code>style</code> attribute were vulnerable to ReDoS. For example,
<code>bleach.clean(..., attributes={'a': ['style']})</code>.</p>
<p>This issue was confirmed in Bleach versions v3.1.3, v3.1.2, v3.1.1,
v3.1.0, v3.0.0, v2.1.4, and v2.1.3. Earlier versions used a similar
regular expression and should be considered vulnerable too.</p>
<p>Anyone using Bleach <=v3.1.3 is encouraged to upgrade.</p>
<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1623633">https://bugzilla.mozilla.org/show_bug.cgi?id=1623633</a></p>
</li>
</ul>
<p><strong>Backwards incompatible changes</strong></p>
<ul>
<li>Style attributes with dashes, or single or double quoted values are
cleaned instead of passed through.</li>
</ul>
<p><strong>Features</strong></p>
<p>None</p>
<p><strong>Bug fixes</strong></p>
<p>None</p>
<h2>Version 3.1.3 (March 17th, 2020)</h2>
<p><strong>Security fixes</strong></p>
<p>None</p>
<p><strong>Backwards incompatible changes</strong></p>
<p>None</p>
<p><strong>Features</strong></p>
<ul>
<li>
<p>Add relative link to code of conduct. (<a href="https://github-redirect.dependabot.com/mozilla/bleach/issues/442">#442</a>)</p>
</li>
<li>
<p>Drop deprecated 'setup.py test' support. (<a href="https://github-redirect.dependabot.com/mozilla/bleach/issues/507">#507</a>)</p>
</li>
</ul>
</tr></table> ... (truncated)
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/mozilla/bleach/commit/6e74a5027b57055cdaeb040343d32934121392a7"><code>6e74a50</code></a> Update for v3.1.4 release</li>
<li><a href="https://github.com/mozilla/bleach/commit/d6018f2539d271963c3e7f54f36ef11900363c69"><code>d6018f2</code></a> fix bug 1623633</li>
<li><a href="https://github.com/mozilla/bleach/commit/fc77027e67cc04aff6f4d4885358705f98ad20f4"><code>fc77027</code></a> Merge branch 'v3.1.0-branch'</li>
<li><a href="https://github.com/mozilla/bleach/commit/e4b1c50e098c33f82c862a34bb2a40f9c4458f46"><code>e4b1c50</code></a> Update for v3.1.3 release</li>
<li><a href="https://github.com/mozilla/bleach/commit/59cc502cee44bd18adc78619e6baed7a108c3ba1"><code>59cc502</code></a> Update for v3.1.2 release</li>
<li><a href="https://github.com/mozilla/bleach/commit/3f39d489ab7a1b38df8c245e9bd66217c1698369"><code>3f39d48</code></a> add wheel to requirements-dev</li>
<li><a href="https://github.com/mozilla/bleach/commit/175f67740e7951e1d80cefb7831e6c3e4efeb986"><code>175f677</code></a> fix bug 1621692</li>
<li><a href="https://github.com/mozilla/bleach/commit/78a06726dd6c72a42c90c1f7a8fa5d21ebcfa587"><code>78a0672</code></a> Update for v3.1.2 release</li>
<li><a href="https://github.com/mozilla/bleach/commit/7b625ff9f6888a08037700269fb23e3ef863b8a7"><code>7b625ff</code></a> add wheel to requirements-dev</li>
<li><a href="https://github.com/mozilla/bleach/commit/e4e9e21e7aebff40c88fafa4319bba4636a602d9"><code>e4e9e21</code></a> fix bug 1621692</li>
<li>Additional commits viewable in <a href="https://github.com/mozilla/bleach/compare/v3.1.1...v3.1.4">compare view</a></li>
</ul>
</details>
<br />
[](https://help.github.com/articles/configuring-automated-security-fixes)
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 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)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/psf/requests/network/alerts).
</details>
|
{
"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"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5407/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5407/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5407.diff",
"html_url": "https://github.com/psf/requests/pull/5407",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5407.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5407"
}
| true
|
[
"Looks like bleach is up-to-date now, so this is no longer needed."
] |
https://api.github.com/repos/psf/requests/issues/5406
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5406/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5406/comments
|
https://api.github.com/repos/psf/requests/issues/5406/events
|
https://github.com/psf/requests/pull/5406
| 589,833,775
|
MDExOlB1bGxSZXF1ZXN0Mzk1MjgyNDAx
| 5,406
|
Port of PR #4173 from v3 to v2 to fix issue #4391
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1581907?v=4",
"events_url": "https://api.github.com/users/atzannes/events{/privacy}",
"followers_url": "https://api.github.com/users/atzannes/followers",
"following_url": "https://api.github.com/users/atzannes/following{/other_user}",
"gists_url": "https://api.github.com/users/atzannes/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/atzannes",
"id": 1581907,
"login": "atzannes",
"node_id": "MDQ6VXNlcjE1ODE5MDc=",
"organizations_url": "https://api.github.com/users/atzannes/orgs",
"received_events_url": "https://api.github.com/users/atzannes/received_events",
"repos_url": "https://api.github.com/users/atzannes/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/atzannes/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/atzannes/subscriptions",
"type": "User",
"url": "https://api.github.com/users/atzannes",
"user_view_type": "public"
}
|
[] |
closed
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 29,
"created_at": "2024-05-19T18:29:04Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/18519037?v=4",
"events_url": "https://api.github.com/users/sethmlarson/events{/privacy}",
"followers_url": "https://api.github.com/users/sethmlarson/followers",
"following_url": "https://api.github.com/users/sethmlarson/following{/other_user}",
"gists_url": "https://api.github.com/users/sethmlarson/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sethmlarson",
"id": 18519037,
"login": "sethmlarson",
"node_id": "MDQ6VXNlcjE4NTE5MDM3",
"organizations_url": "https://api.github.com/users/sethmlarson/orgs",
"received_events_url": "https://api.github.com/users/sethmlarson/received_events",
"repos_url": "https://api.github.com/users/sethmlarson/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sethmlarson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sethmlarson/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sethmlarson",
"user_view_type": "public"
},
"description": "",
"due_on": null,
"html_url": "https://github.com/psf/requests/milestone/34",
"id": 11073254,
"labels_url": "https://api.github.com/repos/psf/requests/milestones/34/labels",
"node_id": "MI_kwDOABTKOs4AqPbm",
"number": 34,
"open_issues": 0,
"state": "open",
"title": "Bankruptcy",
"updated_at": "2024-05-20T14:37:16Z",
"url": "https://api.github.com/repos/psf/requests/milestones/34"
}
| 9
|
2020-03-29T16:49:46Z
|
2024-05-20T14:36:48Z
|
2024-05-20T14:36:48Z
|
NONE
| null |
Fixes #4391
# Problem
This code was failing to verify the SSL:
```python
def test_session_verify_not_stateful(self):
insecure_url = "https://expired.badssl.com/"
s = requests.Session()
assert s.verify is True
with pytest.raises(Exception):
s.get(insecure_url, verify=True)
s.get(insecure_url, verify=False)
assert s.verify is True
with pytest.raises(Exception):
s.get(insecure_url, verify=True) # <- This line was not raising bc we got a cached unverfied connection
```
The problem was that we were modifying the connection object returned to us by the poolmanager, which is illegal, causing us to get unverified connections when requesting verified ones.
# Approach
I had come up with the same solution as PR #4173 independently, not having found the issue before trying to fix it, but my unit-tests were not as thurough, so I added those from PR #4173
The issue was closed in 2018 because it was fixed in v3 (which is still not released), and presumably because it was not fixable in v2, but perhaps this fix works for v2 (new urllib3 perhaps that allows it?)
|
{
"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/5406/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5406/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5406.diff",
"html_url": "https://github.com/psf/requests/pull/5406",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5406.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5406"
}
| true
|
[
"The issue was that fixing it involved breaking an API in v2. I suppose a feature flag could be added, something like ``really_actually_do_verify`` which defaults to False but is documented as something you _probably_ want, and the old behavior and API are available with that flag set to False. That'd make it easier to work around.",
"Hi @jeremycline thanks for the feedback. Which API is broken in v2 by this change? Are you refering to `get_gonnection` in adapters.py which now takes two additional optional arguments, or the removal of `cert_verify` which was illegally modifying the connection object?",
"The removal of ``cert_verify`` which is a public method. If you kept that and switched behavior based on a feature flag it'd probably be more palatable.",
"ok, great! I wasn't sure whether `cert_verify` was treated as public given the comment saying \"This method should not be called from user code.\"\r\n\r\nHaving played around with it a bit, I have a suspicion that keeping that function in, even without a feature flag, will do the right thing in combination with building and passing the `conn_kwargs` to the poolmanager. I'll test that hypothesis and get a update up soon. Again, thanks for the quick feedback @jeremycline !",
"Oh, also, just to be clear I'm not a maintainer here, my feedback has no influence on the acceptance of such a pull request, is provided \"as is\", etc. :smile: ",
"@jeremycline I know you contributed the PR where I got most of the unit-tests from for this PR. And I was happy to see that the solution I had come up with was effectively identical with the one you had. By reading your PR, I inferred that you're not a maintainer here. But your feedback is very welcome and valuable nonetheless.\r\n\r\nOk, so I force-pushed and now there are two commits:\r\n- the first where I've only added the `_build_conn_kwargs` function and where `cert_verify` (the member function and its call in `send`) are untouched. Tests pass even despite its shenanigans.\r\n- the second where `cert_verify` has been deprecated (its body is replaced by `pass`), but we're still calling it from `send`, so that any code that has derived from HTTPAdapter and has not overriden `send` but has overriden `cert_verify` would continue working presumably.\r\n\r\nI prefer having `cert_verify` deprecated because it was doing something illegal. \r\n\r\nThoughts? Concerns? \r\n",
"@nateprewitt @Lukasa gentle ping. This is an API-compatible backport of @jeremycline's great fix for issue #4391. \r\n\r\n- Added `_build_conn_kwargs` which mirrors what `cert_verify` does, but instead of modifying the `conn` argument in-place, it builds kwargs to be passed to the `PoolManager` so that it returns the right connection. The subsequent call to `cert_verify` should be a no-op if `PoolManager` honored the kwargs we passed.\r\n- API change: `get_connection` in HTTPAdaper takes two new optional arguments: `verify`, and `cert` because it needs to call `_build_conn_kwargs`.\r\n",
"[Is there anybody out there?](https://www.youtube.com/watch?v=fNLhxKpfCnA)",
"In an effort to clean up the issue tracker to only have issues that are still relevant to the project we've done a quick pass and decided this issue may no longer be relevant for a variety of potential reasons, including:\r\n\r\n* Applies to a much older version, unclear whether the issue still applies.\r\n* Change requires a backwards incompatible release and it's unclear if the benefits are worth the migration effort from the community.\r\n* There isn't a clear demand from the community on the change landing in Requests.\r\n\r\nIf you think the issue should remain open, please comment so below or open a new issue and link back to the original issue. Again, thank you for opening the issue and for the discussion, it's much appreciated."
] |
https://api.github.com/repos/psf/requests/issues/5405
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5405/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5405/comments
|
https://api.github.com/repos/psf/requests/issues/5405/events
|
https://github.com/psf/requests/issues/5405
| 589,818,769
|
MDU6SXNzdWU1ODk4MTg3Njk=
| 5,405
|
JSON with Umlaut (äüö) not ok on Python 2.7
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/23736716?v=4",
"events_url": "https://api.github.com/users/lukicsl/events{/privacy}",
"followers_url": "https://api.github.com/users/lukicsl/followers",
"following_url": "https://api.github.com/users/lukicsl/following{/other_user}",
"gists_url": "https://api.github.com/users/lukicsl/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lukicsl",
"id": 23736716,
"login": "lukicsl",
"node_id": "MDQ6VXNlcjIzNzM2NzE2",
"organizations_url": "https://api.github.com/users/lukicsl/orgs",
"received_events_url": "https://api.github.com/users/lukicsl/received_events",
"repos_url": "https://api.github.com/users/lukicsl/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lukicsl/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lukicsl/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lukicsl",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 2
|
2020-03-29T15:35:57Z
|
2021-09-01T00:11:35Z
|
2020-03-30T10:27:51Z
|
NONE
|
resolved
|
I am having the following code:
```
r =requests.get('http://{}/api/{}/groups/37'.format(HUE_BRIDGE, API_CODE))
log.info('r.content: {} '.format(r.content))
log.info('r.headers["content-type"]: {} '.format(r.headers['content-type']))
log.info('r.json(): {} '.format(r.json()))
```
the log output:
```
2020-03-29 17:10:57.224 [INFO ] [jsr223.jython.huegroups.log ] - r.headers["content-type"]: application/json; charset=utf-8
2020-03-29 17:10:57.234 [INFO ] [jsr223.jython.huegroups.log ] - r.json(): {u'devicemembership': [], u'type': u'LightGroup', u'name': u'T\xe4st Gruppe', u'scenes': [{u'transitiontime': 10, u'name': u'Morning', u'id': u'1', u'lightcount': 3}, {u'transitiontime': 10, u'name': u'Evening', u'id': u'2', u'lightcount': 3}, {u'transitiontime': 10, u'name': u'Middle OFF', u'id': u'3', u'lightcount': 3}], u'action': {u'xy': [0, 0], u'sat': 127, u'scene': u'3', u'ct': 370, u'effect': u'none', u'bri': 74, u'hue': 0, u'colormode': u'ct', u'on': False}, u'etag': u'b5e003450e01af7f862214ded33c74b6', u'id': u'37', u'state': {u'all_on': False, u'any_on': False}, u'lights': [u'17', u'2', u'6']}
```
One of the values is **T\xe4st Gruppe** instead of **T\xe4st Gruppe** is delivered
Running the same request from the Chrome REST Client:
```
{"action":{"bri":74,"colormode":"ct","ct":370,"effect":"none","hue":0,"on":false,"sat":127,"scene":"3","xy":[0,0]},"devicemembership":[],"etag":"b5e003450e01af7f862214ded33c74b6","id":"37","lights":["17","2","6"],"name":"Täst Gruppe","scenes":[{"id":"1","lightcount":3,"name":"Morning","transitiontime":10},{"id":"2","lightcount":3,"name":"Evening","transitiontime":10},{"id":"3","lightcount":3,"name":"Middle OFF","transitiontime":10}],"state":{"all_on":false,"any_on":false},"type":"LightGroup"}
```
response headers:
```
access-control-allow-origin: *
content-type: application/json; charset=utf-8
content-length: 498
```
I am running on Jython 2.7.1, this is my installation log:
```
(lukics@vevedock-02:~/git.com/docker-swarm-and-compose/openhab $ sudo pip install --upgrade --target=/datavol/openhab-2.5.1/openhab_conf/automation/lib/python requests
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting requests
Using cached https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests)
Using cached https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests)
Using cached https://files.pythonhosted.org/packages/e8/74/6e4f91745020f967d09332bb2b8b9b10090957334692eb88ea4afe91b77f/urllib3-1.25.8-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
Using cached https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl
Collecting chardet<4,>=3.0.2 (from requests)
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Installing collected packages: idna, urllib3, certifi, chardet, requests
Successfully installed certifi-2019.11.28 chardet-3.0.4 idna-2.9 requests-2.23.0 urllib3-1.25.8
)
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/23736716?v=4",
"events_url": "https://api.github.com/users/lukicsl/events{/privacy}",
"followers_url": "https://api.github.com/users/lukicsl/followers",
"following_url": "https://api.github.com/users/lukicsl/following{/other_user}",
"gists_url": "https://api.github.com/users/lukicsl/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lukicsl",
"id": 23736716,
"login": "lukicsl",
"node_id": "MDQ6VXNlcjIzNzM2NzE2",
"organizations_url": "https://api.github.com/users/lukicsl/orgs",
"received_events_url": "https://api.github.com/users/lukicsl/received_events",
"repos_url": "https://api.github.com/users/lukicsl/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lukicsl/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lukicsl/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lukicsl",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5405/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5405/timeline
| null |
completed
| null | null | false
|
[
"Made some tests on online python server [python3](https://repl.it/languages/python3) and [python2.7](https://repl.it/languages/python) with sample json [http://my-json-server.typicode.com/lukicsl/requests-issue/posts/1](http://my-json-server.typicode.com/lukicsl/requests-issue/posts/1)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n",
"Seems that that's the way how Python 2.7 handles utf-8"
] |
https://api.github.com/repos/psf/requests/issues/5404
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5404/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5404/comments
|
https://api.github.com/repos/psf/requests/issues/5404/events
|
https://github.com/psf/requests/pull/5404
| 589,757,807
|
MDExOlB1bGxSZXF1ZXN0Mzk1MjI2NTE5
| 5,404
|
typo
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18441050?v=4",
"events_url": "https://api.github.com/users/ndanil/events{/privacy}",
"followers_url": "https://api.github.com/users/ndanil/followers",
"following_url": "https://api.github.com/users/ndanil/following{/other_user}",
"gists_url": "https://api.github.com/users/ndanil/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ndanil",
"id": 18441050,
"login": "ndanil",
"node_id": "MDQ6VXNlcjE4NDQxMDUw",
"organizations_url": "https://api.github.com/users/ndanil/orgs",
"received_events_url": "https://api.github.com/users/ndanil/received_events",
"repos_url": "https://api.github.com/users/ndanil/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ndanil/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ndanil/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ndanil",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-03-29T10:01:08Z
|
2021-08-29T00:06:59Z
|
2020-03-30T04:25:45Z
|
NONE
|
resolved
|
typo in options?
|
{
"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/5404/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5404/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5404.diff",
"html_url": "https://github.com/psf/requests/pull/5404",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/5404.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5404"
}
| true
|
[
"@dtrodrigues is right, this is the correct endpoint in the current docs. Thanks for checking!"
] |
https://api.github.com/repos/psf/requests/issues/5403
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5403/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5403/comments
|
https://api.github.com/repos/psf/requests/issues/5403/events
|
https://github.com/psf/requests/pull/5403
| 589,679,824
|
MDExOlB1bGxSZXF1ZXN0Mzk1MTY5ODE0
| 5,403
|
fix README typo
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/614233?v=4",
"events_url": "https://api.github.com/users/dtrodrigues/events{/privacy}",
"followers_url": "https://api.github.com/users/dtrodrigues/followers",
"following_url": "https://api.github.com/users/dtrodrigues/following{/other_user}",
"gists_url": "https://api.github.com/users/dtrodrigues/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dtrodrigues",
"id": 614233,
"login": "dtrodrigues",
"node_id": "MDQ6VXNlcjYxNDIzMw==",
"organizations_url": "https://api.github.com/users/dtrodrigues/orgs",
"received_events_url": "https://api.github.com/users/dtrodrigues/received_events",
"repos_url": "https://api.github.com/users/dtrodrigues/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dtrodrigues/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dtrodrigues/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dtrodrigues",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-03-28T23:26:27Z
|
2021-08-29T00:06:58Z
|
2020-04-03T20:59:18Z
|
CONTRIBUTOR
|
resolved
|
{
"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/5403/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5403/timeline
| null | null | false
|
{
"diff_url": "https://github.com/psf/requests/pull/5403.diff",
"html_url": "https://github.com/psf/requests/pull/5403",
"merged_at": "2020-04-03T20:59:18Z",
"patch_url": "https://github.com/psf/requests/pull/5403.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/5403"
}
| true
|
[
"Good suggestions - I force-pushed the requested changes."
] |
|
https://api.github.com/repos/psf/requests/issues/5402
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5402/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5402/comments
|
https://api.github.com/repos/psf/requests/issues/5402/events
|
https://github.com/psf/requests/issues/5402
| 589,551,566
|
MDU6SXNzdWU1ODk1NTE1NjY=
| 5,402
|
Send Request to HAProxyProtocol Enabled Endpoint
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6111679?v=4",
"events_url": "https://api.github.com/users/yks0000/events{/privacy}",
"followers_url": "https://api.github.com/users/yks0000/followers",
"following_url": "https://api.github.com/users/yks0000/following{/other_user}",
"gists_url": "https://api.github.com/users/yks0000/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yks0000",
"id": 6111679,
"login": "yks0000",
"node_id": "MDQ6VXNlcjYxMTE2Nzk=",
"organizations_url": "https://api.github.com/users/yks0000/orgs",
"received_events_url": "https://api.github.com/users/yks0000/received_events",
"repos_url": "https://api.github.com/users/yks0000/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yks0000/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yks0000/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yks0000",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-03-28T10:38:12Z
|
2021-08-28T00:06:07Z
|
2020-11-26T06:08:24Z
|
NONE
|
resolved
|
Trying to send request to below endpoint which implements haproxy protocol (v1 and v2) using requests module. I am not seeing any specific options to pass to `requests.request()` or `requests.get`
```
curl "https://localhost/health/local?skipCacheCheck=true" -ik --haproxy-protocol**
```
**Without Flag:**
```
[root@ip-10-89-83-80 ~]# curl "https://localhost/health/local?skipCacheCheck=true" -ik ;echo
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:443
```
**With Flag:**
```
[root@ip-10-89-83-80 ~]# curl "https://localhost/health/local?skipCacheCheck=true" -ik --haproxy-protocol;echo
HTTP/2 200
server: envoy
date: Fri, 27 Mar 2020 14:43:18 GMT
content-type: text/plain
x-envoy-upstream-service-time: 2
Health Check Ok
```
Please suggest?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6111679?v=4",
"events_url": "https://api.github.com/users/yks0000/events{/privacy}",
"followers_url": "https://api.github.com/users/yks0000/followers",
"following_url": "https://api.github.com/users/yks0000/following{/other_user}",
"gists_url": "https://api.github.com/users/yks0000/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yks0000",
"id": 6111679,
"login": "yks0000",
"node_id": "MDQ6VXNlcjYxMTE2Nzk=",
"organizations_url": "https://api.github.com/users/yks0000/orgs",
"received_events_url": "https://api.github.com/users/yks0000/received_events",
"repos_url": "https://api.github.com/users/yks0000/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yks0000/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yks0000/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yks0000",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5402/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5402/timeline
| null |
completed
| null | null | false
|
[
"I used `pycurl` for this.\r\n\r\n```python\r\nimport pycurl\r\n\r\n\r\nurl = \"https://localhost/health/local\"\r\n\r\n\r\n# LibCurl Options as per https://github.com/curl/curl/blob/master/include/curl/curl.h\r\nCURLOPT_HAPROXYPROTOCOL = 274\r\nCURLOPT_SSL_VERIFYPEER = 64\r\nCURLOPT_SSL_VERIFYHOST = 81\r\nENABLE = 1\r\nDISABLE = 0\r\n\r\n\r\nbuffer = BytesIO()\r\ncurl = pycurl.Curl()\r\ncurl.setopt(curl.URL, url)\r\ncurl.setopt(curl.WRITEDATA, buffer)\r\n\r\ncurl.setopt(CURLOPT_HAPROXYPROTOCOL, ENABLE) # Equivalent to --haproxy-protocol in curl\r\ncurl.setopt(CURLOPT_SSL_VERIFYHOST, DISABLE) # Equivalent to -k/--insecure in curl\r\ncurl.perform()\r\n\r\nbody = buffer.getvalue()\r\nresponse_text = body.decode('iso-8859-1')\r\nstatus_code = curl.getinfo(curl.RESPONSE_CODE)\r\ncurl.close()\r\n\r\nif status_code == 200 and response_text == \"Health Check Ok\":\r\n return True\r\nreturn False\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/5401
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5401/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5401/comments
|
https://api.github.com/repos/psf/requests/issues/5401/events
|
https://github.com/psf/requests/issues/5401
| 589,347,245
|
MDU6SXNzdWU1ODkzNDcyNDU=
| 5,401
|
Missing Occasional *space char/url %20* in HTML?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39680353?v=4",
"events_url": "https://api.github.com/users/treatmesubj/events{/privacy}",
"followers_url": "https://api.github.com/users/treatmesubj/followers",
"following_url": "https://api.github.com/users/treatmesubj/following{/other_user}",
"gists_url": "https://api.github.com/users/treatmesubj/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/treatmesubj",
"id": 39680353,
"login": "treatmesubj",
"node_id": "MDQ6VXNlcjM5NjgwMzUz",
"organizations_url": "https://api.github.com/users/treatmesubj/orgs",
"received_events_url": "https://api.github.com/users/treatmesubj/received_events",
"repos_url": "https://api.github.com/users/treatmesubj/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/treatmesubj/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/treatmesubj/subscriptions",
"type": "User",
"url": "https://api.github.com/users/treatmesubj",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-03-27T19:02:25Z
|
2021-09-01T00:11:36Z
|
2020-03-28T16:02:39Z
|
NONE
|
resolved
|
Requesting HTML to grab some links out of <script> at the end of the HTML, but I noticed that some strings being pulled from the requests_html.HTML object were missing space characters compared to strings in my Firefox developer source file.
## Expected Result
Expected to find strings as they are in my Firefox Developer Debugger.
They have occasional spaces that I can't systematically understand, so I just went to get them from the script as they are.
Like this one with a weird space before the parentheses:
```'11 - Im Gonna Be Ft Jhene Aiko (Prod by keY Wane).mp3'```
!Actually, it's not even showing the extra space here when I submit my post, but I can see it in the raw text?
## Actual Result
When parsing the requests_html.HTML object for the same string, I found that the weird space wasn't there.
Like this:
```'11 - Im Gonna Be Ft Jhene Aiko (Prod by keY Wane).mp3'```
## Reproduction Steps
```
import requests
from requests_html import HTML
player_link = f"https://embeds.datpiff.com/mixtape/390127"
player_html = HTML(html=requests.get(player_link).text)
js = player_html.find("body>script")[-1].text
print(js)
"""
requests html: '11 - Im Gonna Be Ft Jhene Aiko (Prod by keY Wane).mp3'
js in Firefox: '11 - Im Gonna Be Ft Jhene Aiko (Prod by keY Wane).mp3'
"""
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39680353?v=4",
"events_url": "https://api.github.com/users/treatmesubj/events{/privacy}",
"followers_url": "https://api.github.com/users/treatmesubj/followers",
"following_url": "https://api.github.com/users/treatmesubj/following{/other_user}",
"gists_url": "https://api.github.com/users/treatmesubj/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/treatmesubj",
"id": 39680353,
"login": "treatmesubj",
"node_id": "MDQ6VXNlcjM5NjgwMzUz",
"organizations_url": "https://api.github.com/users/treatmesubj/orgs",
"received_events_url": "https://api.github.com/users/treatmesubj/received_events",
"repos_url": "https://api.github.com/users/treatmesubj/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/treatmesubj/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/treatmesubj/subscriptions",
"type": "User",
"url": "https://api.github.com/users/treatmesubj",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5401/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5401/timeline
| null |
completed
| null | null | false
|
[
"> \r\n> \r\n> Requesting HTML to grab some links out of <script> at the end of the HTML, but I noticed that some strings being pulled from the requests_html.HTML object were missing space characters compared to strings in my Firefox developer source file.\r\n> ## Expected Result\r\n> \r\n> Expected to find strings as they are in my Firefox Developer Debugger.\r\n> They have occasional spaces that I can't systematically understand, so I just went to get them from the script as they are.\r\n> \r\n> Like this one with a weird space before the parentheses: '11 - Im Gonna Be Ft Jhene Aiko (Prod by keY Wane).mp3'\r\n> \r\n> !Actually, it's not even showing the extra space here when I submit my post, but I can see it in the raw text?\r\n> ## Actual Result\r\n> \r\n> When parsing the requests_html.HTML object for the same string, I found that the weird space wasn't there.\r\n> \r\n> Like this: '11 - Im Gonna Be Ft Jhene Aiko (Prod by keY Wane).mp3'\r\n> ## Reproduction Steps\r\n> \r\n> ```\r\n> import requests\r\n> from requests_html import HTML\r\n> \r\n> player_link = f\"https://embeds.datpiff.com/mixtape/390127\"\r\n> player_html = HTML(html=requests.get(player_link).text)\r\n> \r\n> js = player_html.find(\"body>script\")[-1].text\r\n> print(js)\r\n> \r\n> \"\"\"\r\n> requests html: '11 - Im Gonna Be Ft Jhene Aiko (Prod by keY Wane).mp3'\r\n> js in Firefox: '11 - Im Gonna Be Ft Jhene Aiko (Prod by keY Wane).mp3'\r\n> \"\"\"\r\n> ```\r\n\r\nSeems like extra spaces are just compacted in HTML due to the spec, so never mind I guess"
] |
https://api.github.com/repos/psf/requests/issues/5400
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5400/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5400/comments
|
https://api.github.com/repos/psf/requests/issues/5400/events
|
https://github.com/psf/requests/issues/5400
| 588,704,171
|
MDU6SXNzdWU1ODg3MDQxNzE=
| 5,400
|
SSLError: HTTPSConnectionPool(host='free-proxy-list.net', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_record', 'wrong version number')])")))
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/55036280?v=4",
"events_url": "https://api.github.com/users/victorb37/events{/privacy}",
"followers_url": "https://api.github.com/users/victorb37/followers",
"following_url": "https://api.github.com/users/victorb37/following{/other_user}",
"gists_url": "https://api.github.com/users/victorb37/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/victorb37",
"id": 55036280,
"login": "victorb37",
"node_id": "MDQ6VXNlcjU1MDM2Mjgw",
"organizations_url": "https://api.github.com/users/victorb37/orgs",
"received_events_url": "https://api.github.com/users/victorb37/received_events",
"repos_url": "https://api.github.com/users/victorb37/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/victorb37/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/victorb37/subscriptions",
"type": "User",
"url": "https://api.github.com/users/victorb37",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-03-26T20:24:13Z
|
2021-09-01T00:11:33Z
|
2020-04-03T17:46:05Z
|
NONE
|
resolved
|
**I am getting this error in return when running Twitterscraper on Python.
This is the the code that was used:**
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from twitterscraper import query_tweets
import datetime as dt
import pandas as pd
begin_date = dt.date(2020, 2, 17)
end_date = dt.date(2020, 3, 20)
limit = 2000
lang = 'english'
tweets = query_tweets('coronavirus deaths', begindate = begin_date, enddate = end_date, limit = limit, lang = lang)
df = pd.DataFrame(t.__dict__ for t in tweets)
filt = df['text'].str.contains('coronavirus deaths')
df = df.loc[filt]
export_excel = df.to_excel (r'C:\Users\victo\Desktop\coronavirus.xlsx', index = None, header=True)
**How can I fix this issue?**
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5400/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5400/timeline
| null |
completed
| null | null | false
|
[
"Hi @victorb37,\r\n\r\nThis is due to either the web server you're hitting being unable to negotiate a proper TLS connection or potentially an issue with the version of OpenSSL you have installed on your machine.\r\n\r\nNeither of these are issues directly with Requests though which is what we have this issue tracker reserved for. Your best bet will be to create a question on Stackoverflow.com with the `python-requests` tag to debug there. Thanks!"
] |
https://api.github.com/repos/psf/requests/issues/5399
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5399/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5399/comments
|
https://api.github.com/repos/psf/requests/issues/5399/events
|
https://github.com/psf/requests/issues/5399
| 588,700,250
|
MDU6SXNzdWU1ODg3MDAyNTA=
| 5,399
|
SSLError: HTTPSConnectionPool(host='free-proxy-list.net', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_record', 'wrong version number')])")))
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/55036280?v=4",
"events_url": "https://api.github.com/users/victorb37/events{/privacy}",
"followers_url": "https://api.github.com/users/victorb37/followers",
"following_url": "https://api.github.com/users/victorb37/following{/other_user}",
"gists_url": "https://api.github.com/users/victorb37/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/victorb37",
"id": 55036280,
"login": "victorb37",
"node_id": "MDQ6VXNlcjU1MDM2Mjgw",
"organizations_url": "https://api.github.com/users/victorb37/orgs",
"received_events_url": "https://api.github.com/users/victorb37/received_events",
"repos_url": "https://api.github.com/users/victorb37/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/victorb37/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/victorb37/subscriptions",
"type": "User",
"url": "https://api.github.com/users/victorb37",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 0
|
2020-03-26T20:17:11Z
|
2021-09-01T00:11:36Z
|
2020-03-26T20:20:27Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/55036280?v=4",
"events_url": "https://api.github.com/users/victorb37/events{/privacy}",
"followers_url": "https://api.github.com/users/victorb37/followers",
"following_url": "https://api.github.com/users/victorb37/following{/other_user}",
"gists_url": "https://api.github.com/users/victorb37/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/victorb37",
"id": 55036280,
"login": "victorb37",
"node_id": "MDQ6VXNlcjU1MDM2Mjgw",
"organizations_url": "https://api.github.com/users/victorb37/orgs",
"received_events_url": "https://api.github.com/users/victorb37/received_events",
"repos_url": "https://api.github.com/users/victorb37/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/victorb37/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/victorb37/subscriptions",
"type": "User",
"url": "https://api.github.com/users/victorb37",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/5399/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5399/timeline
| null |
completed
| null | null | false
|
[] |
|
https://api.github.com/repos/psf/requests/issues/5398
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/5398/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/5398/comments
|
https://api.github.com/repos/psf/requests/issues/5398/events
|
https://github.com/psf/requests/issues/5398
| 588,590,092
|
MDU6SXNzdWU1ODg1OTAwOTI=
| 5,398
|
Request returns broken encoding (how to use with BeautifulSoup)?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/52889259?v=4",
"events_url": "https://api.github.com/users/h56cho/events{/privacy}",
"followers_url": "https://api.github.com/users/h56cho/followers",
"following_url": "https://api.github.com/users/h56cho/following{/other_user}",
"gists_url": "https://api.github.com/users/h56cho/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/h56cho",
"id": 52889259,
"login": "h56cho",
"node_id": "MDQ6VXNlcjUyODg5MjU5",
"organizations_url": "https://api.github.com/users/h56cho/orgs",
"received_events_url": "https://api.github.com/users/h56cho/received_events",
"repos_url": "https://api.github.com/users/h56cho/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/h56cho/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/h56cho/subscriptions",
"type": "User",
"url": "https://api.github.com/users/h56cho",
"user_view_type": "public"
}
|
[] |
closed
| true
| null |
[] | null | 1
|
2020-03-26T17:21:08Z
|
2021-09-01T00:11:32Z
|
2020-04-03T18:01:21Z
|
NONE
|
resolved
|
Hello,
I am trying to web scrap a site that contains lots of ELA questions (permission obtained). I have been trying to implement the code below:
```python
login_url = 'https://www.helpteaching.com/registration/login.htm?'
data = {
'name': '<myUserName>',
'password': '<myPassword>',
'remember_me': 1
}
with requests.Session() as s:
response = requests.post(login_url , data)
s.encoding='utf_8'
index_page= s.get('https://www.helpteaching.com/questions/Reading_Strategies')
soup = BeautifulSoup(index_page.text, 'html.parser')
```
Note that the encoding used by the site is utf-8, and I even manually adjusted the encoding to 'utf-8'.
However, when execute the code above, the texts are all broken.
Is there any way that I can use Requests with BeautifulSoup?
I am using Python 3.7.0.
Thank you,
|
{
"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/5398/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/5398/timeline
| null |
completed
| null | null | false
|
[
"Hi @h56cho,\r\n\r\n`Session` objects don't have an `encoding` parameter. With the web today, it will rarely work to apply a single encoding to all response. You can try to set the encoding on the `Response` object, but that shouldn't be needed in this case.\r\n\r\nYou should validate the output from Requests before passing it to BeautifulSoup. If it's still coming back broken (with and without setting the encoding), the response from the webserver isn't in UTF-8. This unfortunately is outside of the scope for this issue tracker. You'll probably have the best luck asking a question on Stackoverflow.com with the `python-requests` tag."
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.