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/4361
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4361/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4361/comments
|
https://api.github.com/repos/psf/requests/issues/4361/events
|
https://github.com/psf/requests/pull/4361
| 269,529,777 |
MDExOlB1bGxSZXF1ZXN0MTQ5NDcwNzk5
| 4,361 |
Bugfix issue #4325 by AzePUG team member Elshad Agayev
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3605068?v=4",
"events_url": "https://api.github.com/users/elshadaghazade/events{/privacy}",
"followers_url": "https://api.github.com/users/elshadaghazade/followers",
"following_url": "https://api.github.com/users/elshadaghazade/following{/other_user}",
"gists_url": "https://api.github.com/users/elshadaghazade/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/elshadaghazade",
"id": 3605068,
"login": "elshadaghazade",
"node_id": "MDQ6VXNlcjM2MDUwNjg=",
"organizations_url": "https://api.github.com/users/elshadaghazade/orgs",
"received_events_url": "https://api.github.com/users/elshadaghazade/received_events",
"repos_url": "https://api.github.com/users/elshadaghazade/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/elshadaghazade/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/elshadaghazade/subscriptions",
"type": "User",
"url": "https://api.github.com/users/elshadaghazade",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-30T09:23:22Z
|
2021-09-04T00:06:39Z
|
2017-11-27T13:16:12Z
|
NONE
|
resolved
|
PoolManager object was initialized once and assigned to self.poolmanager property of HTTPAdapter class. Thats why updating settings (for example - verify=False to verify=True) does not affect. I reinitialized PoolManager on every connection and problem solved.
adapters.py:166
```
def init_poolmanager(self ...):
....
self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize,
block=block, strict=True, **pool_kwargs)
return self.poolmanager
```
adapters.py:320
```
def get_connection(self...):
...
conn = self.init_poolmanager(self._pool_connections, self._pool_maxsize, block=self._pool_block).connection_from_url(url)
```
|
{
"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/4361/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4361/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4361.diff",
"html_url": "https://github.com/psf/requests/pull/4361",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4361.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4361"
}
| true |
[
"I believe the issue you are attempting to fix was scheduled for Requests 3.0 and is already fixed on the branch of code dedicated to that release. As such, I'm closing this. Thanks for contributing!"
] |
https://api.github.com/repos/psf/requests/issues/4360
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4360/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4360/comments
|
https://api.github.com/repos/psf/requests/issues/4360/events
|
https://github.com/psf/requests/pull/4360
| 269,525,983 |
MDExOlB1bGxSZXF1ZXN0MTQ5NDY4MDYz
| 4,360 |
bugfix issue #4353 by AzePUG team member Elshad Agayev
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3605068?v=4",
"events_url": "https://api.github.com/users/elshadaghazade/events{/privacy}",
"followers_url": "https://api.github.com/users/elshadaghazade/followers",
"following_url": "https://api.github.com/users/elshadaghazade/following{/other_user}",
"gists_url": "https://api.github.com/users/elshadaghazade/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/elshadaghazade",
"id": 3605068,
"login": "elshadaghazade",
"node_id": "MDQ6VXNlcjM2MDUwNjg=",
"organizations_url": "https://api.github.com/users/elshadaghazade/orgs",
"received_events_url": "https://api.github.com/users/elshadaghazade/received_events",
"repos_url": "https://api.github.com/users/elshadaghazade/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/elshadaghazade/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/elshadaghazade/subscriptions",
"type": "User",
"url": "https://api.github.com/users/elshadaghazade",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-30T09:09:14Z
|
2021-09-04T00:06:43Z
|
2017-10-31T04:34:33Z
|
NONE
|
resolved
|
- Added new function validate_url into the file utils.py at the line 858
- Before to call prepend_scheme_if_needed function we are checking validity of proxy url in the file adapters.py at the line 307, if wrong then raising ProxyError exception with clear error message
by Azerbaijan Python User Group
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4360/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4360/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4360.diff",
"html_url": "https://github.com/psf/requests/pull/4360",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4360.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4360"
}
| true |
[
"Thanks for contributing to requests, @elshadaghazade! Unfortunately, this issue is already being addressed in #4356. I'll be closing this one in favor of the earlier PR."
] |
https://api.github.com/repos/psf/requests/issues/4359
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4359/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4359/comments
|
https://api.github.com/repos/psf/requests/issues/4359/events
|
https://github.com/psf/requests/pull/4359
| 269,376,797 |
MDExOlB1bGxSZXF1ZXN0MTQ5MzcxNDc1
| 4,359 |
Fix flake8 errors
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16889901?v=4",
"events_url": "https://api.github.com/users/Sriharivignesh/events{/privacy}",
"followers_url": "https://api.github.com/users/Sriharivignesh/followers",
"following_url": "https://api.github.com/users/Sriharivignesh/following{/other_user}",
"gists_url": "https://api.github.com/users/Sriharivignesh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Sriharivignesh",
"id": 16889901,
"login": "Sriharivignesh",
"node_id": "MDQ6VXNlcjE2ODg5OTAx",
"organizations_url": "https://api.github.com/users/Sriharivignesh/orgs",
"received_events_url": "https://api.github.com/users/Sriharivignesh/received_events",
"repos_url": "https://api.github.com/users/Sriharivignesh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Sriharivignesh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Sriharivignesh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Sriharivignesh",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-10-29T07:04:45Z
|
2021-09-04T00:06:43Z
|
2017-10-29T08:09:00Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4359/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4359/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4359.diff",
"html_url": "https://github.com/psf/requests/pull/4359",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4359.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4359"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=h1) Report\n> Merging [#4359](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/81b63419cbd8a6f0c9c2b79083d25dc2260156e3?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `75%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4359 +/- ##\n=======================================\n Coverage 88.28% 88.28% \n=======================================\n Files 18 18 \n Lines 2031 2031 \n=======================================\n Hits 1793 1793 \n Misses 238 238\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `92.99% <0%> (ø)` | :arrow_up: |\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.45% <100%> (ø)` | :arrow_up: |\n| [tests/testserver/\\_\\_init\\_\\_.py](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=tree#diff-dGVzdHMvdGVzdHNlcnZlci9fX2luaXRfXy5weQ==) | `73.33% <0%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=footer). Last update [81b6341...1c9693d](https://codecov.io/gh/requests/requests/pull/4359?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"No thanks. "
] |
|
https://api.github.com/repos/psf/requests/issues/4358
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4358/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4358/comments
|
https://api.github.com/repos/psf/requests/issues/4358/events
|
https://github.com/psf/requests/pull/4358
| 269,245,151 |
MDExOlB1bGxSZXF1ZXN0MTQ5MjkyNTg4
| 4,358 |
[WIP] Fix e.response is None when ChunkedEncodingError occured
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13451468?v=4",
"events_url": "https://api.github.com/users/iaroslavscript/events{/privacy}",
"followers_url": "https://api.github.com/users/iaroslavscript/followers",
"following_url": "https://api.github.com/users/iaroslavscript/following{/other_user}",
"gists_url": "https://api.github.com/users/iaroslavscript/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/iaroslavscript",
"id": 13451468,
"login": "iaroslavscript",
"node_id": "MDQ6VXNlcjEzNDUxNDY4",
"organizations_url": "https://api.github.com/users/iaroslavscript/orgs",
"received_events_url": "https://api.github.com/users/iaroslavscript/received_events",
"repos_url": "https://api.github.com/users/iaroslavscript/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/iaroslavscript/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/iaroslavscript/subscriptions",
"type": "User",
"url": "https://api.github.com/users/iaroslavscript",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2017-10-27T21:46:03Z
|
2021-09-03T00:10:56Z
|
2018-05-18T14:02:18Z
|
NONE
|
resolved
|
Hi!
I found that it's impossible to read headers and response code when ChunkedEncodingError occured.
Here is demonstration code.
Server code:
```
#!/usr/bin/env python
import BaseHTTPServer
import SocketServer
class ChunkingHTTPServer(SocketServer.ThreadingMixIn,
BaseHTTPServer.HTTPServer):
daemon_threads = True
class ChunkingRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
ALWAYS_SEND_SOME = False
ALLOW_GZIP = False
protocol_version = 'HTTP/1.1'
def do_GET(self):
self.send_response(200)
self.send_header('Transfer-Encoding', 'chunked')
self.send_header('Content-type', 'text/plain')
raise Exception()
if __name__ == '__main__':
server = ChunkingHTTPServer(
('127.0.0.1', 8000), ChunkingRequestHandler)
print 'Starting server, use <Ctrl-C> to stop'
server.serve_forever()
```
Client code:
```
#!/usr/bin/env python
import requests
try:
requests.get('http://127.0.0.1:8000')
except requests.exceptions.ChunkedEncodingError as e:
print(e.response)
```
Before patch: None
After patch: <Response [200]>
I have problem with presenting this code for testing, just have no idea how to integrate it. Could someone help me with it, please.
Also I think that the same behavior is here:
- https://github.com/requests/requests/blob/master/requests/models.py#L750
- https://github.com/requests/requests/blob/master/requests/models.py#L752
But I don't know how to emulate these types of error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4358/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4358/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4358.diff",
"html_url": "https://github.com/psf/requests/pull/4358",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4358.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4358"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4358?src=pr&el=h1) Report\n> Merging [#4358](https://codecov.io/gh/requests/requests/pull/4358?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/81b63419cbd8a6f0c9c2b79083d25dc2260156e3?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `0%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4358?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4358 +/- ##\n=======================================\n Coverage 88.28% 88.28% \n=======================================\n Files 18 18 \n Lines 2031 2031 \n=======================================\n Hits 1793 1793 \n Misses 238 238\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4358?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/models.py](https://codecov.io/gh/requests/requests/pull/4358?src=pr&el=tree#diff-cmVxdWVzdHMvbW9kZWxzLnB5) | `93.45% <0%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4358?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4358?src=pr&el=footer). Last update [81b6341...fa063c9](https://codecov.io/gh/requests/requests/pull/4358?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Are you sure this patch is necessary? If you set `stream=True` the error will be delayed until you read the body, allowing you to see the response header.",
"Hi @Lukasa thanks for your suggestion.\r\nIt's strange but when I use stream=True no exception raised at all and I'm not sure it's good.",
"As I noted, the exception should only happen when you read the body (e.g. when you call `response.content`, `response.iter_content`, `response.iter_lines` or similar).",
"Looking at this, Lukasa's explanation works fine. Using stream will allow access to the headers and if the server fails to send a complete response, we're not going to be able to display the response. You should have access to all other attributes on the object using stream though.\r\n\r\nI'm going to close this out since this doesn't seem necessary. Thanks for the initiative though!"
] |
https://api.github.com/repos/psf/requests/issues/4357
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4357/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4357/comments
|
https://api.github.com/repos/psf/requests/issues/4357/events
|
https://github.com/psf/requests/issues/4357
| 268,907,668 |
MDU6SXNzdWUyNjg5MDc2Njg=
| 4,357 |
POST with files and timeout does both?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/904818?v=4",
"events_url": "https://api.github.com/users/arski/events{/privacy}",
"followers_url": "https://api.github.com/users/arski/followers",
"following_url": "https://api.github.com/users/arski/following{/other_user}",
"gists_url": "https://api.github.com/users/arski/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/arski",
"id": 904818,
"login": "arski",
"node_id": "MDQ6VXNlcjkwNDgxOA==",
"organizations_url": "https://api.github.com/users/arski/orgs",
"received_events_url": "https://api.github.com/users/arski/received_events",
"repos_url": "https://api.github.com/users/arski/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/arski/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arski/subscriptions",
"type": "User",
"url": "https://api.github.com/users/arski",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-10-26T20:53:55Z
|
2021-09-08T04:00:46Z
|
2018-01-23T15:51:56Z
|
NONE
|
resolved
|
Hi, im making a requests.post call with sometimes large files object and a 5s timeout. Im observing that even if the call does indeed raise a timeout exception, the full file still ends up being sent.. Somehow.
Is this intentional or are there any nuances to using timeout with files?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4357/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4357/timeline
| null |
completed
| null | null | false |
[
"A timeout is a complex thing. In this case, the timeout is applied *per socket operation*. That means each send, regardless of how much data, and each read. \r\n\r\nIn this case you are likely timing out on the read. That will lead to the behaviour you’re describing. \r\n\r\nIf you want a total timeout you can arrange it, but it’s definitely tricky. ",
"Hi, so just to be clear, if uploading the file actually takes minutes, but the request is constantly sending sone data, would the timeout trigger, or does it see that data is being sent, so all is good?",
"So long as at least one byte reaches the wire per timeout interval, it would think all is good. "
] |
https://api.github.com/repos/psf/requests/issues/4356
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4356/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4356/comments
|
https://api.github.com/repos/psf/requests/issues/4356/events
|
https://github.com/psf/requests/pull/4356
| 268,788,399 |
MDExOlB1bGxSZXF1ZXN0MTQ4OTU0OTIz
| 4,356 |
Check if host is invalid for proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1779189?v=4",
"events_url": "https://api.github.com/users/nehaljwani/events{/privacy}",
"followers_url": "https://api.github.com/users/nehaljwani/followers",
"following_url": "https://api.github.com/users/nehaljwani/following{/other_user}",
"gists_url": "https://api.github.com/users/nehaljwani/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nehaljwani",
"id": 1779189,
"login": "nehaljwani",
"node_id": "MDQ6VXNlcjE3NzkxODk=",
"organizations_url": "https://api.github.com/users/nehaljwani/orgs",
"received_events_url": "https://api.github.com/users/nehaljwani/received_events",
"repos_url": "https://api.github.com/users/nehaljwani/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nehaljwani/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nehaljwani/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nehaljwani",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2017-10-26T14:41:40Z
|
2021-09-04T00:06:42Z
|
2017-11-15T22:16:34Z
|
CONTRIBUTOR
|
resolved
|
According to RFC3986, the authority section can be empty for a given URL,
however, for a proxy URL, it shouldn't be. This patch adds a check to verify
that the parsed URL will have a valid host before creating the proxy manager.
Fixes #4353
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4356/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4356/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4356.diff",
"html_url": "https://github.com/psf/requests/pull/4356",
"merged_at": "2017-11-15T22:16:34Z",
"patch_url": "https://github.com/psf/requests/pull/4356.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4356"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4356?src=pr&el=h1) Report\n> :exclamation: No coverage uploaded for pull request base (`master@234f80a`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).\n> The diff coverage is `100%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4356?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4356 +/- ##\n========================================\n Coverage ? 87.2% \n========================================\n Files ? 18 \n Lines ? 2055 \n Branches ? 0 \n========================================\n Hits ? 1792 \n Misses ? 263 \n Partials ? 0\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4356?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4356?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `91.74% <100%> (ø)` | |\n| [requests/exceptions.py](https://codecov.io/gh/requests/requests/pull/4356?src=pr&el=tree#diff-cmVxdWVzdHMvZXhjZXB0aW9ucy5weQ==) | `100% <100%> (ø)` | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4356?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4356?src=pr&el=footer). Last update [234f80a...9a8a826](https://codecov.io/gh/requests/requests/pull/4356?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"@sigmavirus24 Is there anything else that I might have missed in the last update of the PR?",
"I think I saw feedback that we should use a different exception class and I kind of agree. I think it makes sense to subclass `ProxyError` to create `InvalidProxyUrlError` or something similar so people can catch that specifically",
"I have updated the PR with `InvalidProxyURL`",
"I think @nehaljwani is on vacation right now. I'd rebase the PR for him if I could.",
"I have rebased the PR.",
"Friendly nudge :sweat_smile: ",
"Thanks for your contribution @nehaljwani!"
] |
https://api.github.com/repos/psf/requests/issues/4355
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4355/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4355/comments
|
https://api.github.com/repos/psf/requests/issues/4355/events
|
https://github.com/psf/requests/issues/4355
| 268,416,999 |
MDU6SXNzdWUyNjg0MTY5OTk=
| 4,355 |
Use another SSL engine than OpenSSL
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2804645?v=4",
"events_url": "https://api.github.com/users/hydrargyrum/events{/privacy}",
"followers_url": "https://api.github.com/users/hydrargyrum/followers",
"following_url": "https://api.github.com/users/hydrargyrum/following{/other_user}",
"gists_url": "https://api.github.com/users/hydrargyrum/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hydrargyrum",
"id": 2804645,
"login": "hydrargyrum",
"node_id": "MDQ6VXNlcjI4MDQ2NDU=",
"organizations_url": "https://api.github.com/users/hydrargyrum/orgs",
"received_events_url": "https://api.github.com/users/hydrargyrum/received_events",
"repos_url": "https://api.github.com/users/hydrargyrum/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hydrargyrum/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hydrargyrum/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hydrargyrum",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-25T14:21:22Z
|
2021-09-08T06:00:33Z
|
2017-10-25T18:15:17Z
|
NONE
|
resolved
|
Requests should let the ability to use other SSL backends than OpenSSL (which has numerous problems), for example NSS.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4355/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4355/timeline
| null |
completed
| null | null | false |
[
"This is an enormously difficult request to achieve. Python is extremely tightly tied to OpenSSL, and so therefore Requests is too (because it ultimately uses httplib). Changing this would require a very substantial patch, and take an enormous amount of developer time. This is sadly just not a priority for the development team. While we'd welcome a patch to do this, it will need to be organised separately from this project."
] |
https://api.github.com/repos/psf/requests/issues/4354
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4354/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4354/comments
|
https://api.github.com/repos/psf/requests/issues/4354/events
|
https://github.com/psf/requests/issues/4354
| 268,052,571 |
MDU6SXNzdWUyNjgwNTI1NzE=
| 4,354 |
Typo in path? ""Could not find suitable TLS certificate
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5991543?v=4",
"events_url": "https://api.github.com/users/niderhoff/events{/privacy}",
"followers_url": "https://api.github.com/users/niderhoff/followers",
"following_url": "https://api.github.com/users/niderhoff/following{/other_user}",
"gists_url": "https://api.github.com/users/niderhoff/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/niderhoff",
"id": 5991543,
"login": "niderhoff",
"node_id": "MDQ6VXNlcjU5OTE1NDM=",
"organizations_url": "https://api.github.com/users/niderhoff/orgs",
"received_events_url": "https://api.github.com/users/niderhoff/received_events",
"repos_url": "https://api.github.com/users/niderhoff/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/niderhoff/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/niderhoff/subscriptions",
"type": "User",
"url": "https://api.github.com/users/niderhoff",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-24T14:23:21Z
|
2021-09-08T06:00:33Z
|
2017-10-24T15:09:58Z
|
NONE
|
resolved
|
Due to what I susped to be a TYPO in a hard-coded PATH in the requests package, the certificate is not found in Windows 10.
Requests Version is 2.14.2 from anaconda 4.4.0 for Windows 64bit.
## Expected Result
Pip/Conda work using TLS.
## Actual Result
``
`$ C:\Users\niid\AppData\Local\Continuum\Anaconda2\Scripts\conda-script.py update conda`
Traceback (most recent call last):
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\exceptions.py", line 632, in conda_exception_handler
return_value = func(*args, **kwargs)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\cli\main.py", line 137, in _main
exit_code = args.func(args, p)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\cli\main_update.py", line 65, in execute
install(args, parser, 'update')
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\cli\install.py", line 221, in install
unknown=index_args['unknown'], prefix=prefix)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\core\index.py", line 93, in get_index
index = fetch_index(channel_priority_map, use_cache=use_cache)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\core\index.py", line 112, in fetch_index
repodatas = collect_all_repodata(use_cache, tasks)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\core\repodata.py", line 74, in collect_all_repodata
repodatas = _collect_repodatas_serial(use_cache, tasks)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\core\repodata.py", line 481, in _collect_repodatas_serial
for url, schan, pri in tasks]
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\core\repodata.py", line 109, in func
res = f(*args, **kwargs)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\core\repodata.py", line 460, in fetch_repodata
mod_etag_headers.get('_mod'))
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\conda\core\repodata.py", line 138, in fetch_repodata_remote_request
timeout=timeout)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\requests\sessions.py", line 531, in get
return self.request('GET', url, **kwargs)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\requests\sessions.py", line 518, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\requests\sessions.py", line 639, in send
r = adapter.send(request, **kwargs)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\requests\adapters.py", line 405, in send
self.cert_verify(conn, request.url, verify, cert)
File "C:\Users\niid\AppData\Local\Continuum\Anaconda2\lib\site-packages\requests\adapters.py", line 225, in cert_verify
"invalid path: {0}".format(cert_loc))
IOError: Could not find a suitable TLS CA certificate bundle, invalid path: %SystemRoom%\System32\cacert.pem
``
Notice *SystemRoom* instead of *SystemRoot* in the last line.
## Reproduction Steps
```
conda update conda
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5991543?v=4",
"events_url": "https://api.github.com/users/niderhoff/events{/privacy}",
"followers_url": "https://api.github.com/users/niderhoff/followers",
"following_url": "https://api.github.com/users/niderhoff/following{/other_user}",
"gists_url": "https://api.github.com/users/niderhoff/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/niderhoff",
"id": 5991543,
"login": "niderhoff",
"node_id": "MDQ6VXNlcjU5OTE1NDM=",
"organizations_url": "https://api.github.com/users/niderhoff/orgs",
"received_events_url": "https://api.github.com/users/niderhoff/received_events",
"repos_url": "https://api.github.com/users/niderhoff/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/niderhoff/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/niderhoff/subscriptions",
"type": "User",
"url": "https://api.github.com/users/niderhoff",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4354/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4354/timeline
| null |
completed
| null | null | false |
[
"Okay, something messed up my system environment variables. Never mind."
] |
https://api.github.com/repos/psf/requests/issues/4353
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4353/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4353/comments
|
https://api.github.com/repos/psf/requests/issues/4353/events
|
https://github.com/psf/requests/issues/4353
| 267,605,378 |
MDU6SXNzdWUyNjc2MDUzNzg=
| 4,353 |
Misleading exception with invalid protocol in proxy variable
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1779189?v=4",
"events_url": "https://api.github.com/users/nehaljwani/events{/privacy}",
"followers_url": "https://api.github.com/users/nehaljwani/followers",
"following_url": "https://api.github.com/users/nehaljwani/following{/other_user}",
"gists_url": "https://api.github.com/users/nehaljwani/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nehaljwani",
"id": 1779189,
"login": "nehaljwani",
"node_id": "MDQ6VXNlcjE3NzkxODk=",
"organizations_url": "https://api.github.com/users/nehaljwani/orgs",
"received_events_url": "https://api.github.com/users/nehaljwani/received_events",
"repos_url": "https://api.github.com/users/nehaljwani/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nehaljwani/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nehaljwani/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nehaljwani",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 10 |
2017-10-23T09:48:27Z
|
2021-09-08T06:00:28Z
|
2017-11-15T22:16:34Z
|
CONTRIBUTOR
|
resolved
|
When the value of `https_proxy` or `HTTPS_PROXY` variable(s) accidentally miss one '/' in the protocol, a traceback is thrown to the user which doesn't pin point that the issue is with the proxy configuration.
## Expected Result
A better exception
## Actual Result
An exception which doesn't pin point exactly what went wrong.
## Reproduction Steps
```
(req2) nwani@dockerub01:~/requests$ export https_proxy=http:/my.proxy.com:3128
(req2) nwani@dockerub01:~/requests$ python -c "import requests; requests.get('https://google.com')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/nehaljwani/requests/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/home/nehaljwani/requests/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/home/nehaljwani/requests/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/home/nehaljwani/requests/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/home/nehaljwani/requests/requests/adapters.py", line 440, in send
timeout=timeout
File "/home/nehaljwani/m3/envs/req2/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connectionpool.py", line 595, in urlopen
self._prepare_proxy(conn)
File "/home/nehaljwani/m3/envs/req2/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connectionpool.py", line 816, in _prepare_proxy
conn.connect()
File "/home/nehaljwani/m3/envs/req2/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connection.py", line 284, in connect
conn = self._new_conn()
File "/home/nehaljwani/m3/envs/req2/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/home/nehaljwani/m3/envs/req2/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/util/connection.py", line 51, in create_connection
if host.startswith('['):
AttributeError: 'NoneType' object has no attribute 'startswith'
```
## System Information
```
(req2) nwani@dockerub01:~/requests$ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.3"
},
"platform": {
"release": "4.4.0-93-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
I am not sure what is the correct place to fix this. Should the fix/check be in requests, urllib3, or urlparse?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4353/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4353/timeline
| null |
completed
| null | null | false |
[
"On dumping the connection object right before calling `conn.urlopen()`, the output for `print(vars(conn))` reveals:\r\n```\r\n'proxy': Url(scheme='http', auth=None, host=None, port=80, path='/my.proxy.com:3128', query=None, fragment=None), \r\n```\r\nAnd this makes urllib3 think that the proxy to be reached is: `http://:80/my.proxy.com:3128`",
"requests calls `prepend_scheme_if_needed()` in the function `get_connection()` and in this case changes the url to http:///my.proxy.com:3128\r\n```\r\n>>> from requests.utils import prepend_scheme_if_needed \r\n>>> prepend_scheme_if_needed(\"https:/myproxy.com:3128\", \"http\")\r\n'https:///myproxy.com:3128'\r\n```\r\n... which when passed to parse_url() from `urllib3.util`:\r\n```\r\n>>> from urllib3.util import parse_url\r\n>>> parse_url(\"https:///myproxy.com:3128\")\r\nUrl(scheme='https', auth=None, host=None, port=None, path='/myproxy.com:3128', query=None, fragment=None)\r\n```\r\n... makes the host and port vanish.",
"Yeah, we could maybe have a specific check for a not `None` `host` value, but there's nothing actually wrong in what we're doing. Further, urllib3 is parsing the URI you're providing it, correctly. The authority portion of a URI begins with `//` and contains the userinfo, host, and port. Paths begin with `/` and come after an `authority` or after the scheme which is terminated by `:`. So your typo is actually a valid URI. It just doesn't have an authority section.\r\n\r\nSo, like I said, we could provide a more understandable exception but in reality, this is RFC 3986 working against you (as well as the fact that we implement it correctly).",
"Sure, but semantically speaking, an empty `authority` section doesn't make sense for a proxy URI right?",
"@nehaljwani exactly. This is why I suggest checking for that and raising a more helpful/understandable exception.",
"> This is why I suggest checking for that and raising a more helpful/understandable exception.\r\n\r\nThat would be great. Otherwise, at the level of a using requests as a library for another application, I think we're forced into [something like](https://github.com/conda/conda/pull/6205/files)\r\n\r\n```python\r\nexcept AttributeError as e:\r\n if text_type(e) == \"'NoneType' object has no attribute 'startswith'\":\r\n raise ProxyError()\r\n else:\r\n raise\r\n```",
"@sigmavirus24 If someone were to submit a PR, is \r\n\r\nhttps://github.com/requests/requests/blob/81b63419cbd8a6f0c9c2b79083d25dc2260156e3/requests/exceptions.py#L36-L37\r\n\r\nthe correct exception to raise? Or should a new exception be created, something like\r\n\r\n```python\r\nclass InvalidProxy(RequestException, ValueError):\r\n \"\"\"The proxy value provided was somehow invalid.\"\"\"\r\n```",
"@kalefranz I've already opened a PR at https://github.com/requests/requests/pull/4356",
"Hey @kalefranz, ProxyError should be sufficient for our needs here. We have an open PR (#4356) which is currently addressing this.",
"Just saw #4356! Apologies for the noise."
] |
https://api.github.com/repos/psf/requests/issues/4352
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4352/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4352/comments
|
https://api.github.com/repos/psf/requests/issues/4352/events
|
https://github.com/psf/requests/pull/4352
| 267,567,146 |
MDExOlB1bGxSZXF1ZXN0MTQ4MDU3ODEz
| 4,352 |
Add something to the docs about hooks on Session()
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/301220?v=4",
"events_url": "https://api.github.com/users/alexwlchan/events{/privacy}",
"followers_url": "https://api.github.com/users/alexwlchan/followers",
"following_url": "https://api.github.com/users/alexwlchan/following{/other_user}",
"gists_url": "https://api.github.com/users/alexwlchan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alexwlchan",
"id": 301220,
"login": "alexwlchan",
"node_id": "MDQ6VXNlcjMwMTIyMA==",
"organizations_url": "https://api.github.com/users/alexwlchan/orgs",
"received_events_url": "https://api.github.com/users/alexwlchan/received_events",
"repos_url": "https://api.github.com/users/alexwlchan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alexwlchan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alexwlchan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alexwlchan",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2017-10-23T07:31:21Z
|
2021-09-04T00:06:43Z
|
2017-10-24T18:50:03Z
|
CONTRIBUTOR
|
resolved
|
I had to work this out by reading the source code for `Session` – better to put it front-and-centre in the docs.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4352/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4352/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4352.diff",
"html_url": "https://github.com/psf/requests/pull/4352",
"merged_at": "2017-10-24T18:50:03Z",
"patch_url": "https://github.com/psf/requests/pull/4352.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4352"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4352?src=pr&el=h1) Report\n> Merging [#4352](https://codecov.io/gh/requests/requests/pull/4352?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/c4c031fc5c62fac25c155e6870962736eb363dc9?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4352?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4352 +/- ##\n=======================================\n Coverage 88.28% 88.28% \n=======================================\n Files 18 18 \n Lines 2031 2031 \n=======================================\n Hits 1793 1793 \n Misses 238 238\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4352?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4352?src=pr&el=footer). Last update [c4c031f...c5ed41e](https://codecov.io/gh/requests/requests/pull/4352?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Is http://docs.python-requests.org/en/master/user/advanced/?highlight=hooks#event-hooks not helpful? It's in the same document.",
"Ah, I see, it doesn't explain you can have hooks on a session. (Sorry, still ingesting coffee)",
"(Review markups in progress.)\r\n\r\nI’ve pushed the change to switch to dict literals, and clarified the use of multiple hooks on a session – I’ll do the same for the functional API later.",
"Does “later” mean “in this PR when I next have time” or “in a follow-up PR”? Just want to make sure we’re all on the same page. ",
"Later = “in this PR, when I am slightly less crushed under PyCon UK prep”",
"👍",
"Turns out the train is a convenient time for doing small changes. How’s this for an example of multiple hooks?"
] |
https://api.github.com/repos/psf/requests/issues/4351
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4351/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4351/comments
|
https://api.github.com/repos/psf/requests/issues/4351/events
|
https://github.com/psf/requests/issues/4351
| 267,497,957 |
MDU6SXNzdWUyNjc0OTc5NTc=
| 4,351 |
Postback woes
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3728987?v=4",
"events_url": "https://api.github.com/users/JohnCC330/events{/privacy}",
"followers_url": "https://api.github.com/users/JohnCC330/followers",
"following_url": "https://api.github.com/users/JohnCC330/following{/other_user}",
"gists_url": "https://api.github.com/users/JohnCC330/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/JohnCC330",
"id": 3728987,
"login": "JohnCC330",
"node_id": "MDQ6VXNlcjM3Mjg5ODc=",
"organizations_url": "https://api.github.com/users/JohnCC330/orgs",
"received_events_url": "https://api.github.com/users/JohnCC330/received_events",
"repos_url": "https://api.github.com/users/JohnCC330/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/JohnCC330/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JohnCC330/subscriptions",
"type": "User",
"url": "https://api.github.com/users/JohnCC330",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-10-22T20:55:21Z
|
2021-09-08T06:00:34Z
|
2017-10-23T12:08:12Z
|
NONE
|
resolved
|
Summary.
When trying to simulate postBack messages in an ASP.NET system, I find that Requests quotes
spaces as '+', but the server seems to expect '%20'. I've ready quite a few posts on the 'net about this,
but no (more or less) elegant solution to solve this using Requests. I tried to convert quote the dict to a string 'manually' using `requests.utils.quote`, which works for the spaces, but this function does not quote '/', which seems to be expected by eg. `__VIEWSTATE`.
## Expected Result
A possibility to specify POST operations with %20 quoting
## Actual Result
POST is quoting with '+'
## Reproduction Steps
s = requests.session()
...
testdata = {"name": "MARIA "}
self.s.post(LAST_MOV,
data = testdata)
...
Logged from wireshark:
(POST header mostly removed)
Content-Type: application/x-www-form-urlencoded
name=MARIA++++
## System Information
requests 2.13.0
python 3.6.0
Slackware 14 current
|
{
"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/4351/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4351/timeline
| null |
completed
| null | null | false |
[
"The [HTML RFC](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1) says:\r\n\r\n> Space characters are replaced by '+', and then reserved characters are escaped as described in [RFC1738], section 2.2: Non-alphanumeric characters are replaced by `%HH', a percent sign and two hexadecimal digits representing the ASCII code of the character.\r\n\r\nSo Requests is doing the right thing.",
"@lutzhorn I don't believe @JohnCC330 is requesting we change the behaviour here. I believe they're looking for help. That said, there's no explicit ask and this is not a Q&A forum.\r\n\r\nA short answer, is to URL encode the data yourself using the stdlib.\r\n\r\n```py\r\n>>> urllib.parse.urlencode({b'name': b'MARIA '}, quote_via=urllib.parse.quote)\r\n'name=MARIA%20%20%20%20'\r\n```\r\n\r\nIf you then pass that to us, e.g.,\r\n\r\n```py\r\ndata = urllib.parse.urlencode({b'name': b'MARIA '}, quote_via=urllib.parse.quote)\r\nrequests.post(LAST_MOV, data=data, headers={'Content-Type\r\n: 'application/x-www-form-urlencoded'})\r\n```\r\n\r\nThat should achieve what you want. Either way, the server you're talking to is not specification compliant (as @lutzhorn already mentioned) so your best bet is to handle the data yourself.\r\n\r\nIn the future, please direct all questions to [StackOverflow](https://stackoverflow.com)"
] |
https://api.github.com/repos/psf/requests/issues/4350
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4350/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4350/comments
|
https://api.github.com/repos/psf/requests/issues/4350/events
|
https://github.com/psf/requests/issues/4350
| 267,253,921 |
MDU6SXNzdWUyNjcyNTM5MjE=
| 4,350 |
Exception when preparing a request using a value from future.builtins str
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2209022?v=4",
"events_url": "https://api.github.com/users/avilaton/events{/privacy}",
"followers_url": "https://api.github.com/users/avilaton/followers",
"following_url": "https://api.github.com/users/avilaton/following{/other_user}",
"gists_url": "https://api.github.com/users/avilaton/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/avilaton",
"id": 2209022,
"login": "avilaton",
"node_id": "MDQ6VXNlcjIyMDkwMjI=",
"organizations_url": "https://api.github.com/users/avilaton/orgs",
"received_events_url": "https://api.github.com/users/avilaton/received_events",
"repos_url": "https://api.github.com/users/avilaton/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/avilaton/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/avilaton/subscriptions",
"type": "User",
"url": "https://api.github.com/users/avilaton",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2017-10-20T17:51:02Z
|
2021-09-06T00:06:44Z
|
2017-11-13T13:55:35Z
|
NONE
|
resolved
|
Hi all,
I found an issue while passing data to requests which was wrapped in a call to `str(` imported with `from builtins import str` on python 2.7.13.
The request fails to prepare with a KeyError.
I tracked it down to here https://github.com/requests/requests/blob/master/requests/models.py#L104 where the value I'm passing in is being encoded. It is returning `bytes` and `urlencode` is choking on that. I tested changing
`v.encode('utf-8') if isinstance(v, str) else v` to
`str(v.encode('utf-8')) if isinstance(v, str) else v`
and all tests passed while the issue I'm reporting is gone but I don't think that is the end of the story.
## Expected Result
I sort of expected it not to blow up. I'm using `from builtins import str` to deal with python 2 and 3 compatibliity issues and did not see this one comming.
## Actual Result
The `prepare` method raises an exception `KeyError: 98`
## Reproduction Steps
```python
from builtins import str
import requests
req = requests.Request('GET', 'http://httpbin.org/get')
req.params = {'email':str('[email protected]')}
req.prepare()
```
results in
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "requests/models.py", line 259, in prepare
hooks=self.hooks,
File "requests/models.py", line 305, in prepare
self.prepare_url(url, params)
File "requests/models.py", line 423, in prepare_url
enc_params = self._encode_params(params)
File "requests/models.py", line 105, in _encode_params
return urlencode(result, doseq=True)
File "/usr/lib/python2.7/urllib.py", line 1349, in urlencode
v = quote_plus(v)
File "/usr/lib/python2.7/urllib.py", line 1306, in quote_plus
return quote(s, safe)
File "/usr/lib/python2.7/urllib.py", line 1299, in quote
return ''.join(map(quoter, s))
KeyError: 98
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.13"
},
"platform": {
"release": "4.10.0-38-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2209022?v=4",
"events_url": "https://api.github.com/users/avilaton/events{/privacy}",
"followers_url": "https://api.github.com/users/avilaton/followers",
"following_url": "https://api.github.com/users/avilaton/following{/other_user}",
"gists_url": "https://api.github.com/users/avilaton/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/avilaton",
"id": 2209022,
"login": "avilaton",
"node_id": "MDQ6VXNlcjIyMDkwMjI=",
"organizations_url": "https://api.github.com/users/avilaton/orgs",
"received_events_url": "https://api.github.com/users/avilaton/received_events",
"repos_url": "https://api.github.com/users/avilaton/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/avilaton/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/avilaton/subscriptions",
"type": "User",
"url": "https://api.github.com/users/avilaton",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4350/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4350/timeline
| null |
completed
| null | null | false |
[
"I am confused. How does calling `str` deal with your Python 2/3 issues? Isn’t it just identical to using the naked string? Or are you using `from __future__ import unicode_literals`?",
"I suspect this is a Python 2/3 \"compatibility\" module the op is using that is doing something very weird/wrong.",
"I think they're using http://python-future.org/reference.html?highlight=str#past.builtins.strwhich has caused innumerable problems in the past around magically replacing imports in a quite terrible way.",
"I am certainly making that mistake and would be glad if you could enlighten me.\r\nWe had some `unicode(stuff)` on our code and was able to support python 3 by using \r\n`from builtins import str`\r\nAnd changing that to `str(stuff)`, right until we hit this bump.\r\nI read through some of the code in requests and I'm thinking I might just have to imitate what is done in the compat module.",
"@avilaton `six` is a significantly better library if you're trying to maintain compatibility on both Python 2 and Python 3.\r\n\r\nI have no clue what `python-future` is trying to do in your code-sample, but you could more simply do `u'[email protected]'` That will ensure that it is text and will DTRT with Requests, etc. ",
"Fixed removing the usage of `from builtins import str` in favor of `from six import text_type`.\r\nI read through the implementation of the former and there is clearly a lot of stuff in there I did not expect.\r\nClosing, thanks for your advice @sigmavirus24 .",
"Just for the records, I had the same KeyError in _encode_params() in combination with python future.\r\n\r\n It was very strange. \r\n\r\nI was able to reproduce the exception in a test. \r\n\r\nThe string which caused this issue was coming from `str(platform.uname())`. \r\n\r\nI could work-around this by using `repr(platform.uname())`.\r\n\r\nIn my case this was at the top of the file:\r\n\r\n```\r\n# -*- coding: utf-8 -*-\r\nfrom __future__ import absolute_import, division, print_function, unicode_literals\r\nfrom future import standard_library\r\nstandard_library.install_aliases()\r\nfrom builtins import str\r\n```",
"Just for the records, and to help other people who might have the same issue.\r\n\r\nwe use \"from my_builtins import *\" instead of the python-future now \r\n\r\nmy_builtins looks like this\r\n\r\n```\r\n# -*- coding: utf-8 -*-\r\nfrom __future__ import absolute_import, division, print_function, unicode_literals\r\n\r\n# noinspection PyUnresolvedReferences\r\nfrom builtins import *\r\n\r\nstr = unicode\r\n```"
] |
https://api.github.com/repos/psf/requests/issues/4349
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4349/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4349/comments
|
https://api.github.com/repos/psf/requests/issues/4349/events
|
https://github.com/psf/requests/pull/4349
| 266,578,791 |
MDExOlB1bGxSZXF1ZXN0MTQ3MzY0Njk2
| 4,349 |
Fix case-insensitive comparison in Session.get_adapter
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1329104?v=4",
"events_url": "https://api.github.com/users/alvarogzp/events{/privacy}",
"followers_url": "https://api.github.com/users/alvarogzp/followers",
"following_url": "https://api.github.com/users/alvarogzp/following{/other_user}",
"gists_url": "https://api.github.com/users/alvarogzp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alvarogzp",
"id": 1329104,
"login": "alvarogzp",
"node_id": "MDQ6VXNlcjEzMjkxMDQ=",
"organizations_url": "https://api.github.com/users/alvarogzp/orgs",
"received_events_url": "https://api.github.com/users/alvarogzp/received_events",
"repos_url": "https://api.github.com/users/alvarogzp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alvarogzp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alvarogzp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alvarogzp",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2017-10-18T17:35:37Z
|
2021-09-04T00:06:44Z
|
2017-10-21T13:26:32Z
|
CONTRIBUTOR
|
resolved
|
While trying to get the adapter for an url, the url is lowered before comparing with the prefix, but the prefix is not, so if it contains non-lowercase characters (eg. `https://example.com/sOmE_WeiRD_pReFIX/`), it won't return the correct adapter.
The other solution is to lower the prefix while adding the adapter. I have opted for the first solution to isolate in one place the case-insensitivity feature.
Edit:
Another alternative could be to document that the prefix should be passed lowered to Session.mount() (this is what I am doing for now to work-around the issue).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4349/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4349/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4349.diff",
"html_url": "https://github.com/psf/requests/pull/4349",
"merged_at": "2017-10-21T13:26:32Z",
"patch_url": "https://github.com/psf/requests/pull/4349.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4349"
}
| true |
[
"Yes, I will update the pull request with them.",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4349?src=pr&el=h1) Report\n> Merging [#4349](https://codecov.io/gh/requests/requests/pull/4349?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/db9da3e0d24c9902e801c45031beb3588d98b3e5?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `100%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4349?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4349 +/- ##\n=======================================\n Coverage 88.28% 88.28% \n=======================================\n Files 18 18 \n Lines 2031 2031 \n=======================================\n Hits 1793 1793 \n Misses 238 238\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4349?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4349?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `95.55% <100%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4349?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4349?src=pr&el=footer). Last update [db9da3e...2afc1cb](https://codecov.io/gh/requests/requests/pull/4349?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"@Lukasa I have added one test to check that it works with mixed case, another to check that the comparison is case-insensitive (this two are the ones that would have been failing before), and also another test to check prefix matching works as expected, ie. returning the adapter with the longest prefix that match (as I haven't found any test about it).",
"Mind bringing this branch up to date with master?",
"Done!",
"Thanks! 🎉"
] |
https://api.github.com/repos/psf/requests/issues/4348
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4348/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4348/comments
|
https://api.github.com/repos/psf/requests/issues/4348/events
|
https://github.com/psf/requests/issues/4348
| 266,404,905 |
MDU6SXNzdWUyNjY0MDQ5MDU=
| 4,348 |
TypeError: __str__ returned non-string (type Error)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/32895810?v=4",
"events_url": "https://api.github.com/users/PalashSharma15/events{/privacy}",
"followers_url": "https://api.github.com/users/PalashSharma15/followers",
"following_url": "https://api.github.com/users/PalashSharma15/following{/other_user}",
"gists_url": "https://api.github.com/users/PalashSharma15/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/PalashSharma15",
"id": 32895810,
"login": "PalashSharma15",
"node_id": "MDQ6VXNlcjMyODk1ODEw",
"organizations_url": "https://api.github.com/users/PalashSharma15/orgs",
"received_events_url": "https://api.github.com/users/PalashSharma15/received_events",
"repos_url": "https://api.github.com/users/PalashSharma15/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/PalashSharma15/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/PalashSharma15/subscriptions",
"type": "User",
"url": "https://api.github.com/users/PalashSharma15",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-10-18T08:34:17Z
|
2021-09-08T06:00:35Z
|
2017-10-19T06:54:02Z
|
NONE
|
resolved
|
**Summary.**
I want to install arduino-sketch on my raspberry pi. I have python 3 and 2.7 already installed.
But while installing it with pip following error has been occurred...
## **Expected Result**
Successfully installed arduino-sketch
## **Actual Result**
/usr/local/bin/pip run on Mon Apr 10 02:00:33 2017
Downloading/unpacking arduino-sketch
Getting page https://pypi.python.org/simple/arduino-sketch/
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 290, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundl$ File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1178, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 194, in find_requirement
page = self._get_page(main_index_url, req)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_page
session=self.session,
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 694, in get_page
req, link, "connection error: %s" % exc, url,
TypeError: __str__ returned non-string (type Error)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4348/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4348/timeline
| null |
completed
| null | null | false |
[
"Okay guys I resolved the error.\r\nThe error was due to inaccurate date and time of Raspberry PI. To resolve date and time you can do this:\r\n\r\n sudo raspi-config\r\n Internationalization options\r\n Change Time Zone\r\n Select geographical area\r\n Select city or region\r\n Reboot your pi\r\nOR you can manually correct time by:\r\nsudo date -s \"Mon Aug 12 20:14:11 UTC 2014\"",
"@PalashSharma15 Since you have resolved the error, you can close this issue.",
"Thanks @lutzhorn and @nateprewitt..\r\nI am a beginner to github and didn't checked out the close feature."
] |
https://api.github.com/repos/psf/requests/issues/4347
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4347/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4347/comments
|
https://api.github.com/repos/psf/requests/issues/4347/events
|
https://github.com/psf/requests/issues/4347
| 266,397,952 |
MDU6SXNzdWUyNjYzOTc5NTI=
| 4,347 |
HTTP_PROXY/HTTPS_PROXY not used with urllib3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1178673?v=4",
"events_url": "https://api.github.com/users/alexcchan/events{/privacy}",
"followers_url": "https://api.github.com/users/alexcchan/followers",
"following_url": "https://api.github.com/users/alexcchan/following{/other_user}",
"gists_url": "https://api.github.com/users/alexcchan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alexcchan",
"id": 1178673,
"login": "alexcchan",
"node_id": "MDQ6VXNlcjExNzg2NzM=",
"organizations_url": "https://api.github.com/users/alexcchan/orgs",
"received_events_url": "https://api.github.com/users/alexcchan/received_events",
"repos_url": "https://api.github.com/users/alexcchan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alexcchan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alexcchan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alexcchan",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-18T08:10:32Z
|
2021-09-08T06:00:36Z
|
2017-10-19T02:48:41Z
|
NONE
|
resolved
|
It appears that environment variables `HTTP_PROXY` and `HTTPS_PROXY` as described here:
http://docs.python-requests.org/en/master/user/advanced/#proxies
are no longer effective, since requests uses urllib3 instead of urllib.
## Expected Result
```shell
$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"
$ python
>>> import requests
>>> requests.get('http://example.org')
```
## Actual Result
`HTTP_PROXY` and `HTTPS_PROXY` not used.
## Reproduction Steps
```shell
$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"
$ python
>>> import requests
>>> requests.get('http://example.org')
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.1.1"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.14"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "17.3.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4347/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4347/timeline
| null |
completed
| null | null | false |
[
"Request hasn’t used urllib in more than 5 years, and those environment variables have worked fine that entire time. What makes you think they don’t work?"
] |
https://api.github.com/repos/psf/requests/issues/4346
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4346/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4346/comments
|
https://api.github.com/repos/psf/requests/issues/4346/events
|
https://github.com/psf/requests/issues/4346
| 266,073,580 |
MDU6SXNzdWUyNjYwNzM1ODA=
| 4,346 |
Downloading gzip files is broken
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240594?v=4",
"events_url": "https://api.github.com/users/sztomi/events{/privacy}",
"followers_url": "https://api.github.com/users/sztomi/followers",
"following_url": "https://api.github.com/users/sztomi/following{/other_user}",
"gists_url": "https://api.github.com/users/sztomi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sztomi",
"id": 240594,
"login": "sztomi",
"node_id": "MDQ6VXNlcjI0MDU5NA==",
"organizations_url": "https://api.github.com/users/sztomi/orgs",
"received_events_url": "https://api.github.com/users/sztomi/received_events",
"repos_url": "https://api.github.com/users/sztomi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sztomi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sztomi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sztomi",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-10-17T10:30:42Z
|
2021-09-08T06:00:35Z
|
2017-10-19T09:12:27Z
|
NONE
|
resolved
|
I'm trying to download a binary gzip file with a GET request.
## Expected Result
When I download a gzip binary file I would expect the file to be the same size and content as it is on the server.
## Actual Result
The file is uncompressed without any indication and written with a different size and contents.
## Reproduction Steps
```py
def download_file_chunked(url, filename, user, password):
req = requests.get(url, auth=(user, password), stream=True)
total_size = int(req.headers.get('content-length', 0));
with open(filename, "wb") as f:
for chunk in req.iter_content(1024):
if chunk:
f.write(chunk)
```
Some headers in the response:
```
{
'Date': 'Tue, 17 Oct 2017 10:07:37 GMT',
'Server': 'Apache/ProXad [Jul 22 2015 14:50:04]',
'Connection': 'close', 'Accept-Ranges': 'bytes',
'Content-Length': '17762',
'Content-Type': 'application/x-gzip',
'Content-Encoding': 'gzip'
}
```
It seems that requests is not only automatically decoding the response (which is gzip-encoded), but also jumps on the gzip data in the response and decodes that as well. This is very counter-intuitive and hard to debug. I found that the following works:
```py
def download_file_copyfileobj(url, filename, user, password):
import shutil
req = requests.get(url, auth=(user, password), stream=True)
print(req.headers)
with open(filename, "wb") as f:
req.raw.decode_content = False
shutil.copyfileobj(req.raw, f)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.9"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.2"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "17.3.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240594?v=4",
"events_url": "https://api.github.com/users/sztomi/events{/privacy}",
"followers_url": "https://api.github.com/users/sztomi/followers",
"following_url": "https://api.github.com/users/sztomi/following{/other_user}",
"gists_url": "https://api.github.com/users/sztomi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sztomi",
"id": 240594,
"login": "sztomi",
"node_id": "MDQ6VXNlcjI0MDU5NA==",
"organizations_url": "https://api.github.com/users/sztomi/orgs",
"received_events_url": "https://api.github.com/users/sztomi/received_events",
"repos_url": "https://api.github.com/users/sztomi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sztomi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sztomi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sztomi",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4346/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4346/timeline
| null |
completed
| null | null | false |
[
"Please see that linked issue, I have a theory why this occurs. ",
"@sztomi is correct. If the server is sending Content-Type *and* Content-Encoding set to `gzip` for a file that was compressed only once then it is in error. Requests will still only decompress the data once though.",
"Thanks, this indeed was the problem."
] |
https://api.github.com/repos/psf/requests/issues/4345
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4345/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4345/comments
|
https://api.github.com/repos/psf/requests/issues/4345/events
|
https://github.com/psf/requests/issues/4345
| 265,896,016 |
MDU6SXNzdWUyNjU4OTYwMTY=
| 4,345 |
ERROR - TeleBot: "ProxyError occurred Caused by ProxyError('Cannot connect to proxy.', [Errno 11001]
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7896106?v=4",
"events_url": "https://api.github.com/users/falconych/events{/privacy}",
"followers_url": "https://api.github.com/users/falconych/followers",
"following_url": "https://api.github.com/users/falconych/following{/other_user}",
"gists_url": "https://api.github.com/users/falconych/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/falconych",
"id": 7896106,
"login": "falconych",
"node_id": "MDQ6VXNlcjc4OTYxMDY=",
"organizations_url": "https://api.github.com/users/falconych/orgs",
"received_events_url": "https://api.github.com/users/falconych/received_events",
"repos_url": "https://api.github.com/users/falconych/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/falconych/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/falconych/subscriptions",
"type": "User",
"url": "https://api.github.com/users/falconych",
"user_view_type": "public"
}
|
[
{
"color": "e11d21",
"default": false,
"description": null,
"id": 136589914,
"name": "Needs Info",
"node_id": "MDU6TGFiZWwxMzY1ODk5MTQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Needs%20Info"
},
{
"color": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
}
] |
closed
| true | null |
[] | null | 2 |
2017-10-16T19:57:55Z
|
2021-09-08T05:00:50Z
|
2017-11-28T13:15:22Z
|
NONE
|
resolved
|
Hello,
I was trying to create a new bot.
It was running correctly, but when I run the code today, which was just copying the message which is written, it failed to run due to some proxy issues
import config
import telebot
bot = telebot.TeleBot(config.token)
@bot.message_handler(content_types=["text"])
def repeat_all_messages(message):
bot.send_message(message.chat.id, message.text)
if __name__ == '__main__':
bot.polling(none_stop=True)
## Expected Result
**the code is running without errors**
## Actual Result
**Proxy issues**
## Reproduction Steps
```python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18)
What was done before -
I don't use proxy
I installed heroku to run the bot there.
and tried to set HTTP_PROXY and HTTPS_proxy
\\\
set HTTP_PROXY=http://proxy.server.com:portnumber
set HTTPS_PROXY=https://proxy.server.com:portnumber
\\\
that's basically all.
After this I cannot start the bot successfully
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.5.2"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000208f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
So the error is :
2017-10-16 21:34:15,195 (util.py:64 PollingThread) ERROR - TeleBot: "ProxyError occurred, args=(MaxRetryError("HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botXXX:XXX/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))",),)
Traceback (most recent call last):
File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "C:\Python\Python35-32\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Python\Python35-32\lib\socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 595, in urlopen
self._prepare_proxy(conn)
File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 816, in _prepare_proxy
conn.connect()
File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 284, in connect
conn = self._new_conn()
File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\Python35-32\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Python\Python35-32\lib\site-packages\urllib3\util\retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxx:xxxx/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\Python35-32\lib\site-packages\telebot\util.py", line 58, in run
task(*args, **kwargs)
File "C:\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 159, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "C:\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 129, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "C:\Python\Python35-32\lib\site-packages\telebot\apihelper.py", line 175, in get_updates
return _make_request(token, method_url, params=payload)
File "C:\Python\Python35-32\lib\site-packages\telebot\apihelper.py", line 54, in _make_request
timeout=(connect_timeout, read_timeout), proxies=proxy)
File "C:Python\Python35-32\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python\Python35-32\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Python\Python35-32\lib\site-packages\requests\adapters.py", line 502, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxx:xxxx/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))
"
Traceback (most recent call last):
File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "C:\Python\Python35-32\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Python\Python35-32\lib\socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 595, in urlopen
self._prepare_proxy(conn)
File "C:\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 816, in _prepare_proxy
conn.connect()
File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 284, in connect
conn = self._new_conn()
File "C:\Python\Python35-32\lib\site-packages\urllib3\connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\\Python\Python35-32\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "C:\\Python\Python35-32\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\\Python\Python35-32\lib\site-packages\urllib3\util\retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxx:xxx/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/PycharmProjects/QuizPollbot/bot.py", line 34, in <module>
bot.polling()
File "C:\\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 264, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "C:\\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 287, in __threaded_polling
polling_thread.raise_exceptions()
File "C:\\Python\Python35-32\lib\site-packages\telebot\util.py", line 77, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "C:\\Python\Python35-32\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\\Python\Python35-32\lib\site-packages\telebot\util.py", line 58, in run
task(*args, **kwargs)
File "C:\\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 159, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "C:\\Python\Python35-32\lib\site-packages\telebot\__init__.py", line 129, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "C:\\Python\Python35-32\lib\site-packages\telebot\apihelper.py", line 175, in get_updates
return _make_request(token, method_url, params=payload)
File "C:\\Python\Python35-32\lib\site-packages\telebot\apihelper.py", line 54, in _make_request
timeout=(connect_timeout, read_timeout), proxies=proxy)
File "C:\\Python\Python35-32\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\\Python\Python35-32\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\\Python\Python35-32\lib\site-packages\requests\adapters.py", line 502, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxx:xxx/getUpdates?offset=1&timeout=20 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0351BA10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)))
Process finished with exit code 1
I saw the issue #2875 with the same error 1101, but in my code I did not set the proxy
I saw the issue #3990 again it was set in code to use proxy ( not my situation)
hope that I provided all possible information.
|
{
"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/4345/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4345/timeline
| null |
completed
| null | null | false |
[
"getaddrinfo is failing. This means you are failing the DNS lookup. are you sure the proxy hostname is resolvable from your host?",
"Without any new information, I'm going to close this. Of course, if you're able to provide new information, @falconych we can reopen this and resume investigation.\r\n\r\nCheers,\r\nIan"
] |
https://api.github.com/repos/psf/requests/issues/4344
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4344/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4344/comments
|
https://api.github.com/repos/psf/requests/issues/4344/events
|
https://github.com/psf/requests/issues/4344
| 265,685,429 |
MDU6SXNzdWUyNjU2ODU0Mjk=
| 4,344 |
headers shouldn't be a dictionary, it should be a list
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/82182?v=4",
"events_url": "https://api.github.com/users/paul-hammant/events{/privacy}",
"followers_url": "https://api.github.com/users/paul-hammant/followers",
"following_url": "https://api.github.com/users/paul-hammant/following{/other_user}",
"gists_url": "https://api.github.com/users/paul-hammant/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/paul-hammant",
"id": 82182,
"login": "paul-hammant",
"node_id": "MDQ6VXNlcjgyMTgy",
"organizations_url": "https://api.github.com/users/paul-hammant/orgs",
"received_events_url": "https://api.github.com/users/paul-hammant/received_events",
"repos_url": "https://api.github.com/users/paul-hammant/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/paul-hammant/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/paul-hammant/subscriptions",
"type": "User",
"url": "https://api.github.com/users/paul-hammant",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2017-10-16T08:28:41Z
|
2021-09-08T05:00:43Z
|
2017-10-20T15:08:49Z
|
NONE
|
resolved
|
## Summary.
Requests lib has implemented headers as a dictionary, yet the web supports a repeating header with the same key. Subversion via WebDAV is tech that uses that. For example, "svn log" sends up:
```
DAV: http://subversion.tigris.org/xmlns/dav/svn/depth
DAV: http://subversion.tigris.org/xmlns/dav/svn/mergeinfo
DAV: http://subversion.tigris.org/xmlns/dav/svn/log-revprops
```
## Expected Result
All three 'A' headers got sent to the server
## Actual Result
Only one did
## Reproduction Steps
```python
foo = requests.request(verb, url, headers={"A": "one", "A": "two", "A": "three"})
```
## System Information
All versions of requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/82182?v=4",
"events_url": "https://api.github.com/users/paul-hammant/events{/privacy}",
"followers_url": "https://api.github.com/users/paul-hammant/followers",
"following_url": "https://api.github.com/users/paul-hammant/following{/other_user}",
"gists_url": "https://api.github.com/users/paul-hammant/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/paul-hammant",
"id": 82182,
"login": "paul-hammant",
"node_id": "MDQ6VXNlcjgyMTgy",
"organizations_url": "https://api.github.com/users/paul-hammant/orgs",
"received_events_url": "https://api.github.com/users/paul-hammant/received_events",
"repos_url": "https://api.github.com/users/paul-hammant/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/paul-hammant/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/paul-hammant/subscriptions",
"type": "User",
"url": "https://api.github.com/users/paul-hammant",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4344/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4344/timeline
| null |
completed
| null | null | false |
[
"Ha! You can fool it with trailing spaces on the key:\r\n\r\n```\r\n headers={\r\n \"DAV\" : \"http://subversion.tigris.org/xmlns/dav/svn/depth\",\r\n \"DAV \" : \"http://subversion.tigris.org/xmlns/dav/svn/mergeinfo\",\r\n \"DAV \" : \"http://subversion.tigris.org/xmlns/dav/svn/log-revprops\"\r\n }\r\n```\r\n\r\n",
"Did you try doing `headers=[('A', 'one'), ('A', 'two'), ('A', 'three')]`? I believe we support this use case when sent that way.",
"`headers` must be a `dict`which is verified here:\r\n\r\nhttps://github.com/requests/requests/blob/54ad3d6dcc173576d3f9784985e88d31a4997677/requests/utils.py#L858-L861\r\n\r\nA `list` is not supported.\r\n\r\n@paul-hammant What API would you propose to verify multiple-value headers? `headers={\"A\": \"one\", \"A\": \"two\", \"A\": \"three\"}` makes no sense because this is `{'A': 'three'}`. What about a list:\r\n\r\n````python\r\nheaders = {\r\n \"A\": [\"1st value of multi-value header\", \"2nd value of multi-value header],\r\n \"B\": \"single value header\"\r\n}",
"@lutzhorn, I don't believe we'll allow the user to pass a list since it would go against our stance of not guessing on what the user wants in their header.\r\n\r\nWhile we don't currently support a list of tuples, we use that in other places such as the `data` param and it seems like a possible option.\r\n\r\nI'm not convinced we need to make a change here though. RFC 7230 states pretty clearly that:\r\n```\r\n3.2.2. Field Order\r\n [...]\r\n A sender MUST NOT generate multiple header fields with the same field\r\n name in a message unless either the entire field value for that\r\n header field is defined as a comma-separated list [i.e., #(values)]\r\n or the header field is a well-known exception (as noted below).\r\n```\r\n\r\nSo @paul-hammant you should be able to accomplish what you're looking for with something like:\r\n\r\n```python\r\ndav_vals = [\"one\", \"two\", \"three\"]\r\nheaders = { 'DAV': ','.join(dav_vals)}\r\nfoo = requests.request(verb, url, headers=headers)\r\n```\r\n\r\nI'm proposing we close this, because this is solvable with one line and probably doesn't warrant the weight of adding tuple support.\r\n\r\n",
"Yes, the RFC is strict on that. Using `join` is a good idea for how to follow the RFC and accomplish what @paul-hammant has in mind. ",
"@paul-hammant I think is related to #4290",
"Apache2/Subversion are not as strict as the RFC. No matter - there are multiple ways through this. Thanks for not insta-closing :)"
] |
https://api.github.com/repos/psf/requests/issues/4343
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4343/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4343/comments
|
https://api.github.com/repos/psf/requests/issues/4343/events
|
https://github.com/psf/requests/pull/4343
| 265,632,247 |
MDExOlB1bGxSZXF1ZXN0MTQ2Njg2NjIy
| 4,343 |
Add missing trove classifier to document Python2 support
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-16T02:48:47Z
|
2021-09-03T00:11:12Z
|
2017-10-16T08:21:20Z
|
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/4343/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4343/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4343.diff",
"html_url": "https://github.com/psf/requests/pull/4343",
"merged_at": "2017-10-16T08:21:20Z",
"patch_url": "https://github.com/psf/requests/pull/4343.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4343"
}
| true |
[
"Thanks @jdufresne!"
] |
|
https://api.github.com/repos/psf/requests/issues/4342
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4342/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4342/comments
|
https://api.github.com/repos/psf/requests/issues/4342/events
|
https://github.com/psf/requests/pull/4342
| 265,631,896 |
MDExOlB1bGxSZXF1ZXN0MTQ2Njg2Mzkw
| 4,342 |
Include license file in the generated wheel package
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/347634?v=4",
"events_url": "https://api.github.com/users/jdufresne/events{/privacy}",
"followers_url": "https://api.github.com/users/jdufresne/followers",
"following_url": "https://api.github.com/users/jdufresne/following{/other_user}",
"gists_url": "https://api.github.com/users/jdufresne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdufresne",
"id": 347634,
"login": "jdufresne",
"node_id": "MDQ6VXNlcjM0NzYzNA==",
"organizations_url": "https://api.github.com/users/jdufresne/orgs",
"received_events_url": "https://api.github.com/users/jdufresne/received_events",
"repos_url": "https://api.github.com/users/jdufresne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdufresne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdufresne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdufresne",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-10-16T02:45:47Z
|
2021-09-03T00:11:12Z
|
2017-10-21T23:53:02Z
|
CONTRIBUTOR
|
resolved
|
The wheel package format supports including the license file. This is done using the `[metadata]` section in the `setup.cfg` file. For additional information on this feature, see:
https://wheel.readthedocs.io/en/stable/index.html#including-the-license-in-the-generated-wheel-file
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4342/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4342/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4342.diff",
"html_url": "https://github.com/psf/requests/pull/4342",
"merged_at": "2017-10-21T23:53:02Z",
"patch_url": "https://github.com/psf/requests/pull/4342.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4342"
}
| true |
[
"@jdufresne can rebase this commit onto master when you have a moment. Thanks!",
"Rebased on latest master.",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4342?src=pr&el=h1) Report\n> Merging [#4342](https://codecov.io/gh/requests/requests/pull/4342?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/8982efa9e46172b42c8cf6cdcc1a3f4c75e670ce?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4342?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4342 +/- ##\n=======================================\n Coverage 88.28% 88.28% \n=======================================\n Files 18 18 \n Lines 2031 2031 \n=======================================\n Hits 1793 1793 \n Misses 238 238\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4342?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4342?src=pr&el=footer). Last update [8982efa...1595e43](https://codecov.io/gh/requests/requests/pull/4342?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Thanks @jdufresne! ✨ "
] |
https://api.github.com/repos/psf/requests/issues/4341
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4341/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4341/comments
|
https://api.github.com/repos/psf/requests/issues/4341/events
|
https://github.com/psf/requests/pull/4341
| 265,586,469 |
MDExOlB1bGxSZXF1ZXN0MTQ2NjU4NDIy
| 4,341 |
Python 3.7 not officially supported yet
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1324225?v=4",
"events_url": "https://api.github.com/users/hugovk/events{/privacy}",
"followers_url": "https://api.github.com/users/hugovk/followers",
"following_url": "https://api.github.com/users/hugovk/following{/other_user}",
"gists_url": "https://api.github.com/users/hugovk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hugovk",
"id": 1324225,
"login": "hugovk",
"node_id": "MDQ6VXNlcjEzMjQyMjU=",
"organizations_url": "https://api.github.com/users/hugovk/orgs",
"received_events_url": "https://api.github.com/users/hugovk/received_events",
"repos_url": "https://api.github.com/users/hugovk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hugovk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hugovk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hugovk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2017-10-15T16:56:46Z
|
2021-09-04T00:06:46Z
|
2017-10-15T20:35:53Z
|
CONTRIBUTOR
|
resolved
|
We don't actually test on 3.7 and 3.7 isn't released for another eight months, so don't yet claim support.
Re: https://github.com/requests/requests/pull/4329#pullrequestreview-69421398 and closes https://github.com/requests/requests/pull/4329.
Also, Python 3.3 was also dropped in https://github.com/requests/requests/pull/4231 so remove mention of those.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4341/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4341/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4341.diff",
"html_url": "https://github.com/psf/requests/pull/4341",
"merged_at": "2017-10-15T20:35:53Z",
"patch_url": "https://github.com/psf/requests/pull/4341.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4341"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/4340
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4340/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4340/comments
|
https://api.github.com/repos/psf/requests/issues/4340/events
|
https://github.com/psf/requests/issues/4340
| 265,401,997 |
MDU6SXNzdWUyNjU0MDE5OTc=
| 4,340 |
Issue with certs.where()
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/141466?v=4",
"events_url": "https://api.github.com/users/Downchuck/events{/privacy}",
"followers_url": "https://api.github.com/users/Downchuck/followers",
"following_url": "https://api.github.com/users/Downchuck/following{/other_user}",
"gists_url": "https://api.github.com/users/Downchuck/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Downchuck",
"id": 141466,
"login": "Downchuck",
"node_id": "MDQ6VXNlcjE0MTQ2Ng==",
"organizations_url": "https://api.github.com/users/Downchuck/orgs",
"received_events_url": "https://api.github.com/users/Downchuck/received_events",
"repos_url": "https://api.github.com/users/Downchuck/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Downchuck/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Downchuck/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Downchuck",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-13T19:55:11Z
|
2021-09-08T06:00:36Z
|
2017-10-14T02:09:47Z
|
NONE
|
resolved
|
I'm seeing a cascading failure from the certifi project with no particular way to override the behavior other than changing python code.
Would be nice to be able to at least supply an environment variable to override the CERTS path.
## Expected Result
A usable request object that validates over HTTPS.
## Actual Result
This is not a file, it's a location in a zip file
```
/tmp/spark-7b667869-6fa4-4a2d-af58-87f6218ce59f/userFiles-bc90eb3c-0796-4c83-844f-14333c8090b0/google-cloud-storage-py27-none-any.all.zip/certifi/cacert.pem
```
```
IOError: Could not find a suitable TLS CA certificate bundle, invalid path: /tmp/spark-7b667869-6fa4-4a2d-af58-87f6218ce59f/userFiles-bc90eb3c-0796-4c83-844f-14333c8090b0/google-cloud-storage-py27-none-any.all.zip/certifi/cacert.pem
```
## Reproduction Steps
Note, this is using PySpark
```python
sc.addPyFile("s3a://big-data-analytics-scratch-prod/project_mesoads/eggs/google-cloud-storage-py27-none-any.all.zip")
import requests
brokencrt = requests.utils.DEFAULT_CA_BUNDLE_PATH
print(brokencrt)
requests.get('https://google.com/')
```
## System Information
This is run via PySpark on Python 2.7 caused by certifi: https://github.com/certifi/certifi.io/issues/14
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4340/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4340/timeline
| null |
completed
| null | null | false |
[
"You can provide an environment variable: `REQUESTS_CA_BUNDLE`."
] |
https://api.github.com/repos/psf/requests/issues/4339
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4339/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4339/comments
|
https://api.github.com/repos/psf/requests/issues/4339/events
|
https://github.com/psf/requests/pull/4339
| 265,374,362 |
MDExOlB1bGxSZXF1ZXN0MTQ2NTIwNjAx
| 4,339 |
Respect the NETRC environment variable, if set.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/238952?v=4",
"events_url": "https://api.github.com/users/chrislawlor/events{/privacy}",
"followers_url": "https://api.github.com/users/chrislawlor/followers",
"following_url": "https://api.github.com/users/chrislawlor/following{/other_user}",
"gists_url": "https://api.github.com/users/chrislawlor/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chrislawlor",
"id": 238952,
"login": "chrislawlor",
"node_id": "MDQ6VXNlcjIzODk1Mg==",
"organizations_url": "https://api.github.com/users/chrislawlor/orgs",
"received_events_url": "https://api.github.com/users/chrislawlor/received_events",
"repos_url": "https://api.github.com/users/chrislawlor/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chrislawlor/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chrislawlor/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chrislawlor",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-10-13T18:11:04Z
|
2021-09-03T00:11:08Z
|
2018-03-08T18:02:46Z
|
NONE
|
resolved
|
If the NETRC environment variable is set, use it to
load the user's netrc file. If not set, default to
searching the user's home directory for a `.netrc`
or `_netrc` file.
Issue #4318
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4339/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4339/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4339.diff",
"html_url": "https://github.com/psf/requests/pull/4339",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4339.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4339"
}
| true |
[
"Not too sure how to go about testing this, at least with the `os.environ` check done at module load time. I'm thinking about moving it inside `get_netrc_auth` to facilitate testing. With the check done there, a test could look something like:\r\n\r\n1. Create an .netrc file in the temp directory\r\n1. Use `utils.set_environ` context manager to temporarily set `NETRC`\r\n1. Call `get_netrc_auth` and test that it is using the values from the temp file, in a similar manner as the `test_basicauth_with_netrc` test.\r\n\r\nDoes that sound like a good approach? I'm not sure that I like having the `os.environ` check inside the function, but I can't think of a good alternative.",
"Closing due to inactivity."
] |
https://api.github.com/repos/psf/requests/issues/4338
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4338/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4338/comments
|
https://api.github.com/repos/psf/requests/issues/4338/events
|
https://github.com/psf/requests/issues/4338
| 265,333,061 |
MDU6SXNzdWUyNjUzMzMwNjE=
| 4,338 |
s.get("https://manage.office.com") fails with _ssl.c:504: EOF occurred in violation of protocol
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/15867001?v=4",
"events_url": "https://api.github.com/users/Akhpatel/events{/privacy}",
"followers_url": "https://api.github.com/users/Akhpatel/followers",
"following_url": "https://api.github.com/users/Akhpatel/following{/other_user}",
"gists_url": "https://api.github.com/users/Akhpatel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Akhpatel",
"id": 15867001,
"login": "Akhpatel",
"node_id": "MDQ6VXNlcjE1ODY3MDAx",
"organizations_url": "https://api.github.com/users/Akhpatel/orgs",
"received_events_url": "https://api.github.com/users/Akhpatel/received_events",
"repos_url": "https://api.github.com/users/Akhpatel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Akhpatel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Akhpatel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Akhpatel",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 10 |
2017-10-13T15:40:13Z
|
2021-09-08T06:00:34Z
|
2017-10-24T10:43:31Z
|
NONE
|
resolved
|
I am behind a proxy. When I execute sess.get("https://google.com") I get a 200 status_code but when I try the same with sess.get("https://manage.office.com") it fails with _ssl.c:504: EOF occurred in violation of protocol
Also requests is not installed. I have placed it in ./lib/ and import it form there. There is another folder named requests-2.9.1.dist-info. So I guess the requests version is 2.9.1. Let me know if I can provide any other information to debug this.
This is the first time I am submitting an issue on github. Let me know if I have made any mistakes and will rectify it.
********************************************************************
[root@xcpnhigas003 office365audit]# python test_proxy
200
Traceback (most recent call last):
File "test_proxy", line 17, in <module>
response = sess.get('https://manage.office.com', proxies=proxies, verify=False)
File "/etc/netwitness/ng/logcollection/content/collection/cmdscript/office365audit/lib/requests/sessions.py", line 480, in get
return self.request('GET', url, **kwargs)
File "/etc/netwitness/ng/logcollection/content/collection/cmdscript/office365audit/lib/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/etc/netwitness/ng/logcollection/content/collection/cmdscript/office365audit/lib/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/etc/netwitness/ng/logcollection/content/collection/cmdscript/office365audit/lib/requests/adapters.py", line 447, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol
******************************************************************************8
## Python code
```
import os
os.sys.path.append(os.path.dirname(os.path.abspath('__file__')))
os.sys.path.append(os.path.join(os.path.dirname(os.path.abspath('__file__')), "lib"))
import requests
proxies = {
'http':'http://xxx:xxx@yyy:8080',
'https':'http://xxx:xxx@yyy:8080'
}
sess = requests.Session()
a = requests.adapters.HTTPAdapter(max_retries=20)
sess.mount('https://', a)
response = sess.get('https://google.com', proxies=proxies, verify=False)
print(response.status_code)
response = sess.get('https://manage.office.com', proxies=proxies, verify=False)
print(response.status_code)
```
System info:
Python 2.7.5 (default, Jul 10 2014, 16:10:08)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/15867001?v=4",
"events_url": "https://api.github.com/users/Akhpatel/events{/privacy}",
"followers_url": "https://api.github.com/users/Akhpatel/followers",
"following_url": "https://api.github.com/users/Akhpatel/following{/other_user}",
"gists_url": "https://api.github.com/users/Akhpatel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Akhpatel",
"id": 15867001,
"login": "Akhpatel",
"node_id": "MDQ6VXNlcjE1ODY3MDAx",
"organizations_url": "https://api.github.com/users/Akhpatel/orgs",
"received_events_url": "https://api.github.com/users/Akhpatel/received_events",
"repos_url": "https://api.github.com/users/Akhpatel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Akhpatel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Akhpatel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Akhpatel",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4338/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4338/timeline
| null |
completed
| null | null | false |
[
"It’s highly likely that you are having problems with the TLS connection: you are running an *ancient* operating system and it will lack a bunch of features we need. I strongly, strongly suggest you try a newer distribution to see if your problem reproduces.",
"Thanks Lukasa for your comment.\r\n\r\nI have tried this from a different box with the same os and openssl version and there it works. This is a production environment where we are trying to run our script and don't have the option to update any software. Is there any workaround I can try.\r\n\r\nAlso I had a more conceptual question. Since we are using ssl proxy(B), the ssl connection is established between my system(A) and proxy(B), and between B and https://manage.office.com right? So would it be right to say that the actual problem would be with the ssl libraries being used at the proxy and not at A?\r\n\r\nI tried wget and that works\r\n********************************************\r\n[root@xcpnhigas003 office365audit]# wget --no-check-certificate https://manage.office.com\r\n--2017-10-14 11:06:06-- https://manage.office.com/\r\nResolving proxy.xxx.com... yyy.yyy.yyy.yyy\r\nConnecting to proxy.xxx.com|yyy.yyy.yyy.yyy|:8080... connected.\r\nWARNING: cannot verify manage.office.com's certificate, issued by `/C=ES/ST=Barcelona/L=yyy/O=xxx/OU=IT/CN=proxybc01.xxx.com/[email protected]':\r\n Self-signed certificate encountered.\r\nProxy request sent, awaiting response... 200 OK\r\nLength: 0\r\nSaving to: `index.html.2'\r\n\r\n [ <=> ] 0 --.-K/s in 0s\r\n\r\n2017-10-14 11:06:07 (0.00 B/s) - `index.html.2' saved [0/0]\r\n***************************************************************************************\r\nSo is the issue with the python libraries?",
"> I have tried this from a different box with the same os and openssl version and there it works. This is a production environment where we are trying to run our script and don't have the option to update any software. Is there any workaround I can try.\r\n\r\nCan you try showing me the output of using `curl -v` to make a similar request on the box with the problem?\r\n\r\n> Also I had a more conceptual question. Since we are using ssl proxy(B), the ssl connection is established between my system(A) and proxy(B), and between B and https://manage.office.com right? So would it be right to say that the actual problem would be with the ssl libraries being used at the proxy and not at A?\r\n\r\nNo, Requests doesn’t support that proxy model. Instead Requests is using CONNECT to tunnel a TCP connection through proxy B and then establishing the TLS handshake, so the proxy is only relevant if it is deliberately intercepting that handshake and trying to perform a MITM attack on the connection. \r\n\r\n",
"curl output below. Is this what you wanted\r\n******************************************************************************************* \r\n```\r\n[root@xcpnhigas003 office365audit]# curl -v https://manage.office.com\r\n* About to connect() to proxy proxy.xxx.com port 8080 (#0)\r\n* Trying yyy.yyy.yyy.yyy... connected\r\n* Connected to proxy.xxx.com (yyy.yyy.yyy.yyy) port 8080 (#0)\r\n* Establish HTTP proxy tunnel to manage.office.com:443\r\n* Proxy auth using Basic with user 'svc_s_siemllbab'\r\n> CONNECT manage.office.com:443 HTTP/1.1\r\n> Host: manage.office.com:443\r\n> Proxy-Authorization: Basic c3ZjX3Nfc2llbXRzYjAxOlh6eUpRNXU2b05BaGRsN0w=\r\n> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2\r\n> Proxy-Connection: Keep-Alive\r\n>\r\n< HTTP/1.1 200 Connection established\r\n< Set-Cookie: BIGipServerPool_VIPProxys=1779244972.36895.0000; expires=Sat, 14-Oct-2017 18:01:07 GMT; path=/\r\n<\r\n* Proxy replied OK to CONNECT request\r\n* Initializing NSS with certpath: sql:/etc/pki/nssdb\r\n* warning: ignoring value of ssl.verifyhost\r\n* skipping SSL peer certificate verification\r\n* SSL connection using TLS_RSA_WITH_AES_256_CBC_SHA\r\n* Server certificate:\r\n* subject: CN=manage.office.com,OU=Microsoft Corporation,O=Microsoft Corporation,L=Redmond,ST=WA,C=US\r\n* start date: Feb 14 21:26:10 2017 GMT\r\n* expire date: Mar 14 21:26:10 2018 GMT\r\n* common name: manage.office.com\r\n* issuer: [email protected],CN=proxybc03.xxx.com,OU=IT,O=some org,L=Sabadell,ST=Barcelona,C=ES\r\n> GET / HTTP/1.1\r\n> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2\r\n> Host: manage.office.com\r\n> Accept: */*\r\n>\r\n< HTTP/1.1 200 OK\r\n< Cache-Control: no-cache\r\n< Pragma: no-cache\r\n< Expires: -1\r\n< Server: Microsoft-IIS/8.5\r\n< X-AspNet-Version: 4.0.30319\r\n< X-Powered-By: ASP.NET\r\n< Date: Sat, 14 Oct 2017 17:56:08 GMT\r\n< Content-Length: 0\r\n< Proxy-Connection: Keep-Alive\r\n< Connection: Keep-Alive\r\n< Age: 0\r\n<\r\n* Connection #0 to host proxy.xxx.com left intact\r\n* Closing connection #0\r\n```\r\n***************************************************************************************\r\n\r\nThe only difference between the other box where it worked and this one is that the other was not behind a proxy. But I have tested it from behind a proxy as well on a different box but that was a normal proxy and not a ssl proxy. Not sure if this makes a difference",
"You seem to have authenticated with the proxy here: I wonder if we used netrc for the proxy request with Requests. Mind adding your username and password to the proxy URL in Requests to see if that fixes it? That is: `http://proxyusername:proxypassword@proxyhost:proxyport`",
"I had added the proxyusername and proxypassword in the original request. I just replaced the actual username and password with xxx before posting it here. Reposting that part of the code.\r\n\r\n```\r\nimport os\r\nos.sys.path.append(os.path.dirname(os.path.abspath('__file__')))\r\nos.sys.path.append(os.path.join(os.path.dirname(os.path.abspath('__file__')), \"lib\"))\r\nimport requests\r\nproxies = {\r\n 'http':'http://xxx:xxx@yyy:8080',\r\n 'https':'http://xxx:xxx@yyy:8080'\r\n}\r\nsess = requests.Session()\r\na = requests.adapters.HTTPAdapter(max_retries=20)\r\nsess.mount('https://', a)\r\nresponse = sess.get('https://google.com', proxies=proxies, verify=False)\r\nprint(response.status_code)\r\nresponse = sess.get('https://manage.office.com', proxies=proxies, verify=False)\r\nprint(response.status_code)\r\n```\r\n",
"Did that work any better for you?",
"No. same issue. I am able to make a call to https://google.com and https://login.microsoftonline.com but for https://manage.office.com I get the same ssl error.",
"I don't know anything about your issue with requests, but you can also test ssl connections using openssl to see what it thinks about it:\r\n\r\n```openssl s_client -connect $HOSTNAME:$PORT -CAfile $PATH_TO_CA_ROOT```\r\n\r\nThat will be a good sanity check.",
"Thanks @bkreider. This system has an old version of openssl and it does not have the -proxy option so that I can run openssl s_client from behind a ssl proxy. \r\nI no longer have access to the system. We can close this issue. I will reopen it later if required. "
] |
https://api.github.com/repos/psf/requests/issues/4337
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4337/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4337/comments
|
https://api.github.com/repos/psf/requests/issues/4337/events
|
https://github.com/psf/requests/issues/4337
| 265,251,280 |
MDU6SXNzdWUyNjUyNTEyODA=
| 4,337 |
Requests hang multiprocessing
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/29649428?v=4",
"events_url": "https://api.github.com/users/ironsilk/events{/privacy}",
"followers_url": "https://api.github.com/users/ironsilk/followers",
"following_url": "https://api.github.com/users/ironsilk/following{/other_user}",
"gists_url": "https://api.github.com/users/ironsilk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ironsilk",
"id": 29649428,
"login": "ironsilk",
"node_id": "MDQ6VXNlcjI5NjQ5NDI4",
"organizations_url": "https://api.github.com/users/ironsilk/orgs",
"received_events_url": "https://api.github.com/users/ironsilk/received_events",
"repos_url": "https://api.github.com/users/ironsilk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ironsilk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ironsilk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ironsilk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-10-13T11:02:50Z
|
2021-09-08T06:00:33Z
|
2017-10-24T17:22:49Z
|
NONE
|
resolved
|
I'm trying to `get `4 Stack-overflow pages simultaneously with `Requests `and `multiprocessing`.
## Actual Result
Instead of the processes finishing, i get 4 zombie processes. I really tried 100 things, i read everything i could find(or understand) including the documentation, especially [here](http://docs.python-requests.org/en/latest/user/advanced/#keep-alive). I frankly don't know if this is a matter of requests or of multiprocessing but...
## Reproduction Steps
```python
import multiprocessing as mp
import requests
from bs4 import BeautifulSoup
from random import randint
import threading
import sys
sys.setrecursionlimit(10000)
class Spider(object):
# define a example function
def rand_string(self,length, output):
s = requests.session()
#s.keep_alive=False
random_post=randint(1000000,9999999)
response=s.get('https://stackoverflow.com/questions/'+str(random_post))
soup=BeautifulSoup(response.content,'lxml')
try:
title=soup.find('a',{'class':'question-hyperlink'}).string
except:
title="not found"
output.put(title)
# Setup a list of processes that we want to run
def run(self,output):
processes = [mp.Process(target=self.rand_string, args=(x, output)) for x in range(3)]
for p in processes:
p.start()
# Exit the completed processes
for p in processes:
p.join()
p.terminate()
# Get process results from the output queue
results = [output.get() for p in processes]
print(results)
# Run processes
if __name__ == '__main__':
output = mp.Queue()
spider=Spider()
spider.run(output)
```
|
{
"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/4337/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4337/timeline
| null |
completed
| null | null | false |
[
"Try setting a timeout of 30 seconds and see if that resolves your issue. I suspect a connection is getting wedged, preventing your program from completing.",
"Hi, the problem got solved, it seems like it wasthe fact that `title` was type `bs.4.Tag` and the attempt to pickle it would hang the program. ( see the answer [here](https://stackoverflow.com/questions/46710707/requests-and-multiprocessing/46733628#46733628))."
] |
https://api.github.com/repos/psf/requests/issues/4336
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4336/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4336/comments
|
https://api.github.com/repos/psf/requests/issues/4336/events
|
https://github.com/psf/requests/issues/4336
| 264,651,861 |
MDU6SXNzdWUyNjQ2NTE4NjE=
| 4,336 |
Pylint can't import requests.packages.urllib3
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/32494444?v=4",
"events_url": "https://api.github.com/users/shiftysymbol/events{/privacy}",
"followers_url": "https://api.github.com/users/shiftysymbol/followers",
"following_url": "https://api.github.com/users/shiftysymbol/following{/other_user}",
"gists_url": "https://api.github.com/users/shiftysymbol/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/shiftysymbol",
"id": 32494444,
"login": "shiftysymbol",
"node_id": "MDQ6VXNlcjMyNDk0NDQ0",
"organizations_url": "https://api.github.com/users/shiftysymbol/orgs",
"received_events_url": "https://api.github.com/users/shiftysymbol/received_events",
"repos_url": "https://api.github.com/users/shiftysymbol/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/shiftysymbol/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shiftysymbol/subscriptions",
"type": "User",
"url": "https://api.github.com/users/shiftysymbol",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-10-11T16:23:16Z
|
2021-09-08T06:00:37Z
|
2017-10-12T03:32:23Z
|
NONE
|
resolved
|
When I import anything from `requests.packages.urllib3`, `pylint` marks such lines as errors: `Unable to import '...' (import-error)`
## Reproduction Steps
```bash
virtualenv -p python3 test
source test/bin/activate
# taken from http://docs.python-requests.org/en/master/user/advanced/#example-specific-ssl-version
echo "from requests.packages.urllib3.poolmanager import PoolManager" > test.py
pip install requests==2.18.4
pip install pylint
pylint --errors-only test.py
************* Module test
E: 1, 0: Unable to import 'requests.packages.urllib3.poolmanager' (import-error)
```
This is only happening with requests>=2.16. Previous versions are fine.
I can see the same behaviour in Python 2.7 (I know, I know... :) )
## Expected Result
Ideally I would like `pylint` to be able to perform the import so it can use the collected information for further variable analysis.
That doesn't necessarily mean changing `requests`, I'm happy to change my code to solve this problem. For example importing "base" `urllib3` instead of the packaged one, although I don't know whether that has any consequences and is safe to do. I saw the comment in `packages.py` that the code is there for compatibility reasons but http://docs.python-requests.org is using it so I assumed that's still the canonical way.
Any recommendations/fixes?
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.5.3"
},
"platform": {
"release": "4.10.0-35-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4336/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4336/timeline
| null |
completed
| null | null | false |
[
"If you know that you’re using the most recent requests you can safely just use the base urllib3. That is my recommendation in this case.",
"Thanks for the recommendation! If it's official it might be worth updating the docs so users don't wonder about the packaged `urllib3`.",
"@shiftysymbol, urllib3 is no longer packaged as of 2.16. We now have a file that points the namespace requests.packages.urllib3 to your currently installed version for backwards compatibility reasons.",
"Cheers @nateprewitt -- I simply wasn't sure how safe it was to use `urllib3` directly and whether it was the right thing to do since the docs don't mention it and examples still use the bundled `urllib3`. But then I saw comments in the source code so wanted to double check."
] |
https://api.github.com/repos/psf/requests/issues/4335
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4335/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4335/comments
|
https://api.github.com/repos/psf/requests/issues/4335/events
|
https://github.com/psf/requests/issues/4335
| 264,479,836 |
MDU6SXNzdWUyNjQ0Nzk4MzY=
| 4,335 |
ssl client certificate requests reponse status code is 400
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/15722064?v=4",
"events_url": "https://api.github.com/users/hugoren/events{/privacy}",
"followers_url": "https://api.github.com/users/hugoren/followers",
"following_url": "https://api.github.com/users/hugoren/following{/other_user}",
"gists_url": "https://api.github.com/users/hugoren/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hugoren",
"id": 15722064,
"login": "hugoren",
"node_id": "MDQ6VXNlcjE1NzIyMDY0",
"organizations_url": "https://api.github.com/users/hugoren/orgs",
"received_events_url": "https://api.github.com/users/hugoren/received_events",
"repos_url": "https://api.github.com/users/hugoren/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hugoren/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hugoren/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hugoren",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-10-11T07:13:38Z
|
2021-09-08T03:00:42Z
|
2018-02-24T15:02:36Z
|
NONE
|
resolved
|
Summary.
The server USES nginx to implement HTTPS
## Expected Result
ssl client certificate requests reponse status code is 400
What you expected.
Certificate request
## Actual Result
the nginx error is 21:unable to verify the first certificate
What happened instead.
## Reproduction Steps
```python
import requests
r = requests.get(url,
cert='0ea.pem'
)
print(r)
```
## System Information
$ python -m requests.help
```
<paste here>
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4335/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4335/timeline
| null |
completed
| null | null | false |
[
"Can you show us the contents of the .pem file please? Can you also provide the output of `python -m requests.help` as the template asked for?",
"From my test, I found that in ubuntu 14.04.3, this won't happened, but in ubuntu 16.04.1, 400 status code is replied when requesting HTTPS.\r\nIt's a clue, I haven't dig any deeper yet, but this may give you some hints."
] |
https://api.github.com/repos/psf/requests/issues/4334
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4334/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4334/comments
|
https://api.github.com/repos/psf/requests/issues/4334/events
|
https://github.com/psf/requests/issues/4334
| 264,450,746 |
MDU6SXNzdWUyNjQ0NTA3NDY=
| 4,334 |
Request blob:domain.com
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/14329460?v=4",
"events_url": "https://api.github.com/users/saade/events{/privacy}",
"followers_url": "https://api.github.com/users/saade/followers",
"following_url": "https://api.github.com/users/saade/following{/other_user}",
"gists_url": "https://api.github.com/users/saade/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/saade",
"id": 14329460,
"login": "saade",
"node_id": "MDQ6VXNlcjE0MzI5NDYw",
"organizations_url": "https://api.github.com/users/saade/orgs",
"received_events_url": "https://api.github.com/users/saade/received_events",
"repos_url": "https://api.github.com/users/saade/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/saade/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/saade/subscriptions",
"type": "User",
"url": "https://api.github.com/users/saade",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-11T04:03:17Z
|
2021-09-08T06:00:37Z
|
2017-10-11T04:18:02Z
|
NONE
|
resolved
|
Summary.
## Expected Result
I want do download blob:domain.com files
## Actual Result
With Requests:
`No connection adapters were found for 'blob:domain.com/aaaaa-bbbbbb-cccc'`
With python urllib2:
`<urlopen error unknown url type: blob>`
## Reproduction Steps
```python
import requests
requests.get('blob:domain.com/aaaaa-bbbbbb-cccc')
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.14"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
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/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4334/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4334/timeline
| null |
completed
| null | null | false |
[
"Requests is a HTTP library, and so only supports HTTP schemed URLs. There will be no support added for other kinds."
] |
https://api.github.com/repos/psf/requests/issues/4333
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4333/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4333/comments
|
https://api.github.com/repos/psf/requests/issues/4333/events
|
https://github.com/psf/requests/issues/4333
| 264,450,645 |
MDU6SXNzdWUyNjQ0NTA2NDU=
| 4,333 |
The latest version requests error(Value for header......must be of type str or bytes, not <class 'dict'>),But use verion 2.3.0 is ok。
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16347301?v=4",
"events_url": "https://api.github.com/users/lovebaicai/events{/privacy}",
"followers_url": "https://api.github.com/users/lovebaicai/followers",
"following_url": "https://api.github.com/users/lovebaicai/following{/other_user}",
"gists_url": "https://api.github.com/users/lovebaicai/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lovebaicai",
"id": 16347301,
"login": "lovebaicai",
"node_id": "MDQ6VXNlcjE2MzQ3MzAx",
"organizations_url": "https://api.github.com/users/lovebaicai/orgs",
"received_events_url": "https://api.github.com/users/lovebaicai/received_events",
"repos_url": "https://api.github.com/users/lovebaicai/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lovebaicai/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lovebaicai/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lovebaicai",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-11T04:02:23Z
|
2021-09-08T06:00:37Z
|
2017-10-11T04:19:54Z
|
NONE
|
resolved
|
Hi,
- I use the latest version requests 2.18.4(Python2 or Python3),An error occurred:
```
requests.exceptions.InvalidHeader: Value for header {clientInfo: {'longitude': '', 'traderName': 'Google Nexus 6 - 5.1.0 - API 22 - 1440x2560', 'partner': 'Tencent', 'nettype': 'wifi', 'clientAppVersion': '2.1.7', 'screenwidth': '1440', 'deviceCode': 'cbbf2edb-340f-3191-b804-46e6f9163fc1', 'clientVersion': '22', 'clientip': 'fe80::a00:27ff:fea4:efdc%eth1', 'screenheight': '2392', 'latitude': '', 'clientSystem': 'android', 'clientYunyuVersion': '7.6.3'}} must be of type str or bytes, not <class 'dict'>
```
- But use version 2.3.0,http request is normal。
- The script like this:
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import requests
headers = {
'timestamp': '1506578296',
'signature': '57c2c971541ef71387742f480f4166e3',
'platform': '3',
'clientInfo': {"clientAppVersion":"2.1.7","clientYunyuVersion":"7.6.3","clientSystem":"android","clientVersion":"22","deviceCode":"cbbf2edb-340f-3191-b804-46e6f9163fc1","traderName":"Google Nexus 6 - 5.1.0 - API 22 - 1440x2560","partner":"Tencent","screenwidth":"1440","screenheight":"2392","nettype":"wifi","latitude":"","longitude":"","clientip":"fe80::a00:27ff:fea4:efdc%eth1"}}
product_nid = '32032002530101'
detail_url = 'http://m.meitun.com/newapi/item/getProdBasicInfo?cityid=&mt=1&promotionid=2552789&promotiontype=0&protocol=http&provinceid=11302&sku={}&topicid=145409'.format(product_nid)
detail_info = json.loads(requests.get(detail_url, headers=headers).text)
title = detail_info['data']['name']
price = detail_info['data']['price']
total_sale_vol = detail_info['data']['unk']
img_url = detail_info['data']['imageurl'][0]
spu_id = detail_info['data']['spu']
```
- Please confirm。Tks!
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4333/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4333/timeline
| null |
completed
| null | null | false |
[
"Requests tightened its interface to only allow header values to be strings, and to not automatically coerce them to strings. You can get the old behaviour back by putting `str()` around your header value."
] |
https://api.github.com/repos/psf/requests/issues/4332
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4332/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4332/comments
|
https://api.github.com/repos/psf/requests/issues/4332/events
|
https://github.com/psf/requests/pull/4332
| 264,311,445 |
MDExOlB1bGxSZXF1ZXN0MTQ1NzUzMzU2
| 4,332 |
Warn about possible slowness on older versions of pyOpenSSL
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4",
"events_url": "https://api.github.com/users/ghost/events{/privacy}",
"followers_url": "https://api.github.com/users/ghost/followers",
"following_url": "https://api.github.com/users/ghost/following{/other_user}",
"gists_url": "https://api.github.com/users/ghost/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ghost",
"id": 10137,
"login": "ghost",
"node_id": "MDQ6VXNlcjEwMTM3",
"organizations_url": "https://api.github.com/users/ghost/orgs",
"received_events_url": "https://api.github.com/users/ghost/received_events",
"repos_url": "https://api.github.com/users/ghost/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ghost/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ghost",
"user_view_type": "public"
}
|
[] |
closed
| false | null |
[] | null | 3 |
2017-10-10T17:24:31Z
|
2017-10-14T15:41:03Z
|
2017-10-14T15:41:03Z
|
NONE
| null |
Give a warning when `cryptography < 1.3.4` and `pyOpenSSL < 16.0.0` as discussed in #4309
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4332/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4332/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4332.diff",
"html_url": "https://github.com/psf/requests/pull/4332",
"merged_at": "2017-10-14T15:41:03Z",
"patch_url": "https://github.com/psf/requests/pull/4332.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4332"
}
| true |
[
"I think I squashed everything right this time. Please let me know if I missed something!",
"Great! Thanks for working with me and helping me get some experience, I really appreciate it!",
"I've updated the changelog, added myself to AUTHORS.rst, and fixed the commit message."
] |
https://api.github.com/repos/psf/requests/issues/4331
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4331/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4331/comments
|
https://api.github.com/repos/psf/requests/issues/4331/events
|
https://github.com/psf/requests/pull/4331
| 264,136,690 |
MDExOlB1bGxSZXF1ZXN0MTQ1NjI1NDYx
| 4,331 |
Fix docs for data param in api
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7973243?v=4",
"events_url": "https://api.github.com/users/rymdhund/events{/privacy}",
"followers_url": "https://api.github.com/users/rymdhund/followers",
"following_url": "https://api.github.com/users/rymdhund/following{/other_user}",
"gists_url": "https://api.github.com/users/rymdhund/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rymdhund",
"id": 7973243,
"login": "rymdhund",
"node_id": "MDQ6VXNlcjc5NzMyNDM=",
"organizations_url": "https://api.github.com/users/rymdhund/orgs",
"received_events_url": "https://api.github.com/users/rymdhund/received_events",
"repos_url": "https://api.github.com/users/rymdhund/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rymdhund/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rymdhund/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rymdhund",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-10-10T08:15:49Z
|
2021-09-03T00:11:08Z
|
2018-03-08T18:01:55Z
|
NONE
|
resolved
|
The data param also accepts a list of tuples. It says so in the docs for request() but not for post(), put() and patch()
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4331/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4331/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4331.diff",
"html_url": "https://github.com/psf/requests/pull/4331",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4331.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4331"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4331?src=pr&el=h1) Report\n> Merging [#4331](https://codecov.io/gh/requests/requests/pull/4331?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/24092b11d74af0a766d9cc616622f38adb0044b9?src=pr&el=desc) will **increase** coverage by `1.07%`.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4331?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4331 +/- ##\n==========================================\n+ Coverage 89% 90.08% +1.07% \n==========================================\n Files 18 15 -3 \n Lines 2065 1543 -522 \n==========================================\n- Hits 1838 1390 -448 \n+ Misses 227 153 -74\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4331?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/api.py](https://codecov.io/gh/requests/requests/pull/4331/diff?src=pr&el=tree#diff-cmVxdWVzdHMvYXBpLnB5) | `81.81% <ø> (ø)` | :arrow_up: |\n| [tests/testserver/\\_\\_init\\_\\_.py](https://codecov.io/gh/requests/requests/pull/4331/diff?src=pr&el=tree#diff-dGVzdHMvdGVzdHNlcnZlci9fX2luaXRfXy5weQ==) | | |\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4331/diff?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | | |\n| [requests/compat.py](https://codecov.io/gh/requests/requests/pull/4331/diff?src=pr&el=tree#diff-cmVxdWVzdHMvY29tcGF0LnB5) | | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4331?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4331?src=pr&el=footer). Last update [24092b1...404aaa8](https://codecov.io/gh/requests/requests/pull/4331?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"this is unnecessary information. "
] |
https://api.github.com/repos/psf/requests/issues/4330
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4330/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4330/comments
|
https://api.github.com/repos/psf/requests/issues/4330/events
|
https://github.com/psf/requests/issues/4330
| 263,685,027 |
MDU6SXNzdWUyNjM2ODUwMjc=
| 4,330 |
Question: How to throttle bandwidth of a given REST call
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1402178?v=4",
"events_url": "https://api.github.com/users/niko-dunixi/events{/privacy}",
"followers_url": "https://api.github.com/users/niko-dunixi/followers",
"following_url": "https://api.github.com/users/niko-dunixi/following{/other_user}",
"gists_url": "https://api.github.com/users/niko-dunixi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/niko-dunixi",
"id": 1402178,
"login": "niko-dunixi",
"node_id": "MDQ6VXNlcjE0MDIxNzg=",
"organizations_url": "https://api.github.com/users/niko-dunixi/orgs",
"received_events_url": "https://api.github.com/users/niko-dunixi/received_events",
"repos_url": "https://api.github.com/users/niko-dunixi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/niko-dunixi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/niko-dunixi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/niko-dunixi",
"user_view_type": "public"
}
|
[
{
"color": "777777",
"default": false,
"description": null,
"id": 162780722,
"name": "Question/Not a bug",
"node_id": "MDU6TGFiZWwxNjI3ODA3MjI=",
"url": "https://api.github.com/repos/psf/requests/labels/Question/Not%20a%20bug"
}
] |
closed
| true | null |
[] | null | 2 |
2017-10-08T01:32:27Z
|
2021-09-08T06:00:38Z
|
2017-10-08T16:33:39Z
|
NONE
|
resolved
|
I'm transitively using Requests, by using [locustio](https://github.com/locustio/locust).
Basically, we're loadtesting a service that accepts file-uploads (pretty much just a vanilla POST request). We want to slow down the upload to resemble what a real user's bandwidth would look like. (For clarification, the machine that runs the test is high-powered to replicate a large number of users. This, however, has the trade off that a large file upload that a user normally performs takes seconds instead of minutes; which falsely tests the application we're hitting).
We're looking at systemically slowing the bandwidth of the machine itself to replicate what a user would see, but we want to know: is it possible to do this programmatically?
|
{
"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/4330/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4330/timeline
| null |
completed
| null | null | false |
[
"There is nothing built into requests to do this. Depending on how you're trying to upload files you can either implement a generator that sleeps the appropriate amount of time or a file-like object that sleeps the appropriate amount of time.\r\n\r\nIn the future, please ask questions on [StackOverflow](https://stackoverflow.com).",
"@sigmavirus24 Thank you, and will do"
] |
https://api.github.com/repos/psf/requests/issues/4329
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4329/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4329/comments
|
https://api.github.com/repos/psf/requests/issues/4329/events
|
https://github.com/psf/requests/pull/4329
| 263,345,997 |
MDExOlB1bGxSZXF1ZXN0MTQ1MDc5MDYy
| 4,329 |
Python 3.7 is supported
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1324225?v=4",
"events_url": "https://api.github.com/users/hugovk/events{/privacy}",
"followers_url": "https://api.github.com/users/hugovk/followers",
"following_url": "https://api.github.com/users/hugovk/following{/other_user}",
"gists_url": "https://api.github.com/users/hugovk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hugovk",
"id": 1324225,
"login": "hugovk",
"node_id": "MDQ6VXNlcjEzMjQyMjU=",
"organizations_url": "https://api.github.com/users/hugovk/orgs",
"received_events_url": "https://api.github.com/users/hugovk/received_events",
"repos_url": "https://api.github.com/users/hugovk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hugovk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hugovk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hugovk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-10-06T06:18:21Z
|
2021-09-04T00:06:47Z
|
2017-10-15T20:35:53Z
|
CONTRIBUTOR
|
resolved
|
The README says "Requests officially supports Python 2.6–2.7 & 3.3–3.7, and runs great on PyPy." so update the version in some other places too.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4329/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4329/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4329.diff",
"html_url": "https://github.com/psf/requests/pull/4329",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4329.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4329"
}
| true |
[
"Should we instead remove 3.7 from the README and the commented out 3.7-dev from .travis.yml?\r\n\r\nAlternatively: the commit message for the commenting out was to speed up the build: https://github.com/requests/requests/commit/2758b8b0f029abb9166eb1f124dcabe1bd35e949\r\n\r\nTravis gives up to five parallel build jobs, but only four are taken per build. Should 3.7-dev be re-enabled?\r\n\r\nHaving said that, there's still 8 months until 3.7 release, so I think the best thing to do is not claim support yet, but if possible test it. See https://snarky.ca/how-to-use-your-project-travis-to-help-test-python-itself/",
"See https://github.com/requests/requests/pull/4341 to remove claimed support from the README.",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4329?src=pr&el=h1) Report\n> Merging [#4329](https://codecov.io/gh/requests/requests/pull/4329?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/8c4f78448ab150f336026aa5c74d875c8ad59895?src=pr&el=desc) will **increase** coverage by `0.38%`.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4329?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4329 +/- ##\n==========================================\n+ Coverage 88.28% 88.66% +0.38% \n==========================================\n Files 18 18 \n Lines 2031 2021 -10 \n==========================================\n- Hits 1793 1792 -1 \n+ Misses 238 229 -9\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4329?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [tests/testserver/\\_\\_init\\_\\_.py](https://codecov.io/gh/requests/requests/pull/4329?src=pr&el=tree#diff-dGVzdHMvdGVzdHNlcnZlci9fX2luaXRfXy5weQ==) | `86% <0%> (+12.66%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4329?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4329?src=pr&el=footer). Last update [8c4f784...ed1ccf6](https://codecov.io/gh/requests/requests/pull/4329?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"
] |
https://api.github.com/repos/psf/requests/issues/4328
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4328/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4328/comments
|
https://api.github.com/repos/psf/requests/issues/4328/events
|
https://github.com/psf/requests/pull/4328
| 263,344,710 |
MDExOlB1bGxSZXF1ZXN0MTQ1MDc4MTU2
| 4,328 |
Remove redundant Python 2.6 stuff
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1324225?v=4",
"events_url": "https://api.github.com/users/hugovk/events{/privacy}",
"followers_url": "https://api.github.com/users/hugovk/followers",
"following_url": "https://api.github.com/users/hugovk/following{/other_user}",
"gists_url": "https://api.github.com/users/hugovk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hugovk",
"id": 1324225,
"login": "hugovk",
"node_id": "MDQ6VXNlcjEzMjQyMjU=",
"organizations_url": "https://api.github.com/users/hugovk/orgs",
"received_events_url": "https://api.github.com/users/hugovk/received_events",
"repos_url": "https://api.github.com/users/hugovk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hugovk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hugovk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hugovk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-10-06T06:09:11Z
|
2021-09-04T00:06:45Z
|
2017-10-19T16:58:54Z
|
CONTRIBUTOR
|
resolved
|
Same as https://github.com/requests/requests/pull/4326 but for the proposed/3.0.0 branch.
The good news is nearly everything was already in this branch from https://github.com/requests/requests/pull/4118, except for tidying up some OrderedDict compat stuff.
Also, pytest>=3.0.0 is required for the Python 3.3 build, otherwise:
```
py.test -n 8 --boxed --junitxml=report.xml
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.3.6/bin/py.test", line 11, in <module>
sys.exit(main())
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/config.py", line 39, in main
config = _prepareconfig(args, plugins)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/config.py", line 118, in _prepareconfig
pluginmanager=pluginmanager, args=args)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
_MultiCall(methods, kwargs, hook.spec_opts).execute()
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
return _wrapped_call(hook_impl.function(*args), self.execute)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
wrap_controller.send(call_outcome)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/helpconfig.py", line 28, in pytest_cmdline_parse
config = outcome.get_result()
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/vendored_packages/pluggy.py", line 278, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/vendored_packages/pluggy.py", line 264, in __init__
self.result = func()
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
res = hook_impl.function(*args)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/config.py", line 861, in pytest_cmdline_parse
self.parse(args)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/config.py", line 966, in parse
self._preparse(args, addopts=addopts)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/config.py", line 927, in _preparse
self.pluginmanager.load_setuptools_entrypoints("pytest11")
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/_pytest/vendored_packages/pluggy.py", line 501, in load_setuptools_entrypoints
plugin = ep.load()
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/pkg_resources/__init__.py", line 2404, in load
self.require(*args, **kwargs)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/pkg_resources/__init__.py", line 2427, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages/pkg_resources/__init__.py", line 872, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pytest 2.9.2 (/home/travis/virtualenv/python3.3.6/lib/python3.3/site-packages), Requirement.parse('pytest>=3.0.0'))
```
https://travis-ci.org/hugovk/requests/jobs/284048190
The other CI failures are related to cookies and also occur in latest master and fresh builds of proposed/3.0.0.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4328/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4328/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4328.diff",
"html_url": "https://github.com/psf/requests/pull/4328",
"merged_at": "2017-10-19T16:58:54Z",
"patch_url": "https://github.com/psf/requests/pull/4328.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4328"
}
| true |
[
"I've removed that commit and rebased onto current proposed/3.0.0 and update AUTHORS.rst on this branch.\r\n\r\n> We could also use a CHANGELOG entry stating that the OrderedDict import no longer exists in compat.py.\r\n\r\n@nateprewitt Is the changelog in https://github.com/requests/requests/blob/proposed/3.0.0/3.0-HISTORY.rst?",
"@hugovk yep, that'd be the place.",
"@nateprewitt CLI example updated and changelog added.",
"Alright, I think we're set here. Thanks for again for putting this together @hugovk!"
] |
https://api.github.com/repos/psf/requests/issues/4327
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4327/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4327/comments
|
https://api.github.com/repos/psf/requests/issues/4327/events
|
https://github.com/psf/requests/pull/4327
| 263,202,203 |
MDExOlB1bGxSZXF1ZXN0MTQ0OTczMjA5
| 4,327 |
removed python2 unicode literals from documentation examples
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2715854?v=4",
"events_url": "https://api.github.com/users/miguelgrinberg/events{/privacy}",
"followers_url": "https://api.github.com/users/miguelgrinberg/followers",
"following_url": "https://api.github.com/users/miguelgrinberg/following{/other_user}",
"gists_url": "https://api.github.com/users/miguelgrinberg/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/miguelgrinberg",
"id": 2715854,
"login": "miguelgrinberg",
"node_id": "MDQ6VXNlcjI3MTU4NTQ=",
"organizations_url": "https://api.github.com/users/miguelgrinberg/orgs",
"received_events_url": "https://api.github.com/users/miguelgrinberg/received_events",
"repos_url": "https://api.github.com/users/miguelgrinberg/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/miguelgrinberg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/miguelgrinberg/subscriptions",
"type": "User",
"url": "https://api.github.com/users/miguelgrinberg",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2017-10-05T17:16:00Z
|
2021-09-04T00:06:44Z
|
2017-10-15T15:44:36Z
|
NONE
|
resolved
|
The documentation has a bunch of examples showing unicode literals in Python 2's `u'foo'` syntax, including one in the front page right below the note encouraging users to switch to Python 3.
|
{
"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/4327/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4327/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4327.diff",
"html_url": "https://github.com/psf/requests/pull/4327",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4327.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4327"
}
| true |
[
"Given the currently supported versions of Python 3 (e.g., Python 3.4+), using `u''` is a cross-version compatible way of ensuring one always has text when dealing with native strings. I don't think we want to remove this.\r\n\r\nNote: All versions of Python 3 in which unicode-literals were invalid syntax have been EOL'd. That said, the documentation examples that do\r\n\r\n```\r\nprint(u'foo')\r\nu'foo'\r\n```\r\n\r\nAre wrong on *some* of the versions of Python that Requests supports. We can't easily document both though.\r\n\r\n---\r\n\r\nComplete aside: Hi @miguelgrinberg! Hope all is well!",
"Hi @sigmavirus24!\r\n\r\nOkay. Just looks weird to see the `u`s when you are used to working with Py3, specially in a highly prominent example in the front page of the docs. The PEP that introduced back the `u` was made to simplify the porting of code from Py2, not to encourage people to use it on brand new code.\r\n\r\nWould you want to keep this PR in the back burner until 2020 and then merge it, when the `u`s become completely unnecessary?",
"> The PEP that introduced back the u was made to simplify the porting of code from Py2, not to encourage people to use it on brand new code.\r\n\r\nWe're well aware of that. However, for those of us stuck writing code compatible on Python 2 and Python 3, `u` is one of the better solutions to ensuring we have text everywhere.\r\n\r\n> Would you want to keep this PR in the back burner until 2020 and then merge it, when the `u` s become completely unnecessary?\r\n\r\nNot particularly. We periodically go through the list and close old and stale pull requests so since there's no plan to remove this right now, it doesn't make sense to try to keep this PR alive until then. I'd be happy to merge it when we drop 2.7 but we'll need you to resubmit it then.\r\n\r\nThanks @miguelgrinberg ",
"@sigmavirus24 I agree with the use of `u` for writing compatible code inside requests, but disagree with favoring a Python 2 idiom that is on its way out in public facing documentation and examples.\r\n\r\nI respect your decision, but to paraphrase @kennethreitz, as a \"person of excellent taste\", I don't want to see those `u` prefixes any more than I have to. :)",
"> I agree with the use of u for writing compatible code inside requests\r\n\r\nI'm talking about writing code that *uses* requests on Python 2 and 3 that is compatible with both and behaves exactly the same. Which is in better taste, code using requests on 2 and 3 that does\r\n\r\n```py\r\nmy_maybe_text = 'foo bar bogus'\r\nif isinstance(my_maybe_text, bytes):\r\n my_text = my_maybe_text.decode('utf-8')\r\nelse:\r\n my_text = my_maybe_text\r\n```\r\n\r\nor \r\n\r\n```py\r\nmy_text = u'foo bar bogus'\r\n```\r\n\r\nThat's really the reason to use both. While we handle both cases well, they may be handled slightly differently from the user's perspective and advising them to be explicit and clear to themselves and others doesn't seem like the worst thing ever. It's like providing examples using `b'some bytes here'` that work the same across 2 and 3. At the moment it's a necessary evil. ",
"It is best practice to use the unicodecode literals at this time. \r\n\r\nThis will change, in about a year, or maybe sooner. "
] |
https://api.github.com/repos/psf/requests/issues/4326
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4326/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4326/comments
|
https://api.github.com/repos/psf/requests/issues/4326/events
|
https://github.com/psf/requests/pull/4326
| 263,118,728 |
MDExOlB1bGxSZXF1ZXN0MTQ0OTExMzQy
| 4,326 |
Remove redundant Python 2.6 stuff
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1324225?v=4",
"events_url": "https://api.github.com/users/hugovk/events{/privacy}",
"followers_url": "https://api.github.com/users/hugovk/followers",
"following_url": "https://api.github.com/users/hugovk/following{/other_user}",
"gists_url": "https://api.github.com/users/hugovk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/hugovk",
"id": 1324225,
"login": "hugovk",
"node_id": "MDQ6VXNlcjEzMjQyMjU=",
"organizations_url": "https://api.github.com/users/hugovk/orgs",
"received_events_url": "https://api.github.com/users/hugovk/received_events",
"repos_url": "https://api.github.com/users/hugovk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/hugovk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hugovk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/hugovk",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2017-10-05T13:07:16Z
|
2021-09-04T00:06:47Z
|
2017-10-05T15:32:19Z
|
CONTRIBUTOR
|
resolved
|
Python 2.6 support was dropped in https://github.com/requests/requests/pull/4118.
This removes some other redundant 2.6 code.
Also mention Python 3.7 as officially supported, to reflect the README.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4326/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4326/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4326.diff",
"html_url": "https://github.com/psf/requests/pull/4326",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4326.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4326"
}
| true |
[
"Looks like some failures regarding cookies, could you check those out?",
"Similar cookie failures are happening on latest master:\r\n\r\nhttps://travis-ci.org/requests/requests/builds/279556831",
"You're right, those will have to be fixed in a different PR. I'm :+1: from my brief look at these changes.",
"Hey @hugovk, thanks for taking the time to put this PR together! Unfortunately it's pointed against our master branch rather than our proposed/3.0.0 branch where the original #4118 was made. It appears some of this is redundant but there are also new changes. If you'd like to move those over to a PR against the correct branch, we'd be happy to review them. Thanks again for you work!",
"@nateprewitt Thanks, I've created https://github.com/requests/requests/pull/4328 against proposed/3.0.0.\r\n\r\nBut don't you want this stuff in master as well? Or do you have another process for merging 3.0.0 back into master at some point? \r\n\r\nI guess you don't want to support 2.6 in releases after 3.0.0 either :)",
"@hugovk, yes, we'll be merging the 3.0.0 branch back into master when we're ready to release. Until that time though, we're not planning on removing 2.6 support so these need to stay out of the master branch to allow future releases in the 2.x series."
] |
https://api.github.com/repos/psf/requests/issues/4325
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4325/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4325/comments
|
https://api.github.com/repos/psf/requests/issues/4325/events
|
https://github.com/psf/requests/issues/4325
| 262,873,207 |
MDU6SXNzdWUyNjI4NzMyMDc=
| 4,325 |
Session adapter doesn't update https connections cert data
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2819491?v=4",
"events_url": "https://api.github.com/users/aleperno/events{/privacy}",
"followers_url": "https://api.github.com/users/aleperno/followers",
"following_url": "https://api.github.com/users/aleperno/following{/other_user}",
"gists_url": "https://api.github.com/users/aleperno/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/aleperno",
"id": 2819491,
"login": "aleperno",
"node_id": "MDQ6VXNlcjI4MTk0OTE=",
"organizations_url": "https://api.github.com/users/aleperno/orgs",
"received_events_url": "https://api.github.com/users/aleperno/received_events",
"repos_url": "https://api.github.com/users/aleperno/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/aleperno/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aleperno/subscriptions",
"type": "User",
"url": "https://api.github.com/users/aleperno",
"user_view_type": "public"
}
|
[] |
open
| false | null |
[] | null | 4 |
2017-10-04T17:45:28Z
|
2019-01-04T17:38:35Z
| null |
NONE
| null |
Under a session, the first https request sets the HTTPSConnectionPool certs data.
If in a subsequent request, we change the certs data (eg: Set verify to True), the adaptor will update the ConnectionPool attributes, however each connection in the pool will still contain the old certs data, thus when requesting a connection from the pool, its info will differ from what we would expect.
## Expected Result
The used connection should have updated certs data
## Actual Result
The used connection have "old" certs data.
## Reproduction Steps
These tests where performed against a server with a self-signed CA.
```python
In [1]: from requests import Session
In [2]: url = "https://somepage"
In [3]: auth = ("admin", "admin123")
In [4]: s = Session()
In [5]: s.get(url, auth=auth, verify=False)
Out[5]: <Response [200]>
# This should fail, but doesnt
In [6]: s.get(url, auth=auth, verify=True)
Out[6]: <Response [200]>
# Create a new session
In [7]: Session().get(url, auth=auth, verify=True)
# Raises certificate verify failed
```
I'm aware ConnectionPool is in urllib realm, but since it's the adaptor who is updating the pool data, perhaps it should also handle this scenario?
## System Information
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.7.2"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.12"
},
"platform": {
"release": "4.4.0-59-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1000207f",
"version": "16.0.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
| null |
{
"+1": 0,
"-1": 0,
"confused": 1,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/4325/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4325/timeline
| null | null | null | null | false |
[
"Yeah. Requests is using some old APIs in urllib3 that don’t interact with the connection pooling. It should update to pass the TLS data into the pool manager to ensure that the TLS info factors in. ",
"@Lukasa thanks for your prompt reply",
"This is also true of the certificate/key paths provided in the `cert` keyword argument. It seems that the `certfile` and `keyfile` attributes are maintained on the connection and not reset if a new `cert` kwarg is given on a subsequent request on the session.",
"Still observing this in 2.21.0, but you can issue session.close() to clear out the poolmanager, which will allow new requests with different verify values to be paid attention to. "
] |
https://api.github.com/repos/psf/requests/issues/4324
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4324/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4324/comments
|
https://api.github.com/repos/psf/requests/issues/4324/events
|
https://github.com/psf/requests/issues/4324
| 262,612,074 |
MDU6SXNzdWUyNjI2MTIwNzQ=
| 4,324 |
Request with method-level auth differs from request with equivalent session-level auth
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/32467112?v=4",
"events_url": "https://api.github.com/users/mysteryegg/events{/privacy}",
"followers_url": "https://api.github.com/users/mysteryegg/followers",
"following_url": "https://api.github.com/users/mysteryegg/following{/other_user}",
"gists_url": "https://api.github.com/users/mysteryegg/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mysteryegg",
"id": 32467112,
"login": "mysteryegg",
"node_id": "MDQ6VXNlcjMyNDY3MTEy",
"organizations_url": "https://api.github.com/users/mysteryegg/orgs",
"received_events_url": "https://api.github.com/users/mysteryegg/received_events",
"repos_url": "https://api.github.com/users/mysteryegg/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mysteryegg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mysteryegg/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mysteryegg",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2017-10-03T22:34:57Z
|
2021-09-08T03:00:42Z
|
2018-02-24T15:01:29Z
|
NONE
|
resolved
|
## Summary
Explicitly calling out method-level auth parameter that matches associated session-level auth seems to yield functionally different behavior.
## Expected Results
I am parsing a CSV file containing references to local filenames that I am uploading via Requests to a RESTful API I'm helping test. The intended behavior is for the script to upload the files referenced in the CSV after establishing Digest authentication. The server should respond 401, then requests should respond accordingly, followed by a 200 response from the server.
## Actual Results
I recently encountered an error response from the server and found I got a different response simply by updating my python code to use Session() objects. Upon further testing, I have developed two code blocks that appear to be functionally equivalent but receive very different responses from the server. I am having a hard time determining why these two code blocks behave differently.
The first code block shown below properly negotiates Digest authentication, receiving a 401 response from the server, sending the second part of the request, then receiving a 200 response.
The second code block is as close to the first as I can make it while still reproducing the problem. Notice the code snippet contains a method-level auth argument which is an exact duplicate of the session-level authentication. However, for whatever reason, the API I'm testing responds 502 to this latter code block in response to the initial request, i.e. the point at which I would expect a 401 response. I will address the server-side error, but I'm confused regarding how the two blocks of code are functionally different.
```
import sys, time, requests, csv
from requests.auth import HTTPDigestAuth, HTTPBasicAuth
custom_header = {'X-Requested-Auth': 'Digest'}
host = raw_input("Enter host address, including scheme: ")
user = raw_input("Enter username: ")
password = raw_input("Enter password: ")
#v1 is a string representation of some xml
with open('myFiles.csv', 'rb') as csvfile:
csvin = csv.DictReader(csvfile, delimiter=',', quotechar='"')
with requests.Session() as s:
#Define session-level auth method and custom header
s.auth = HTTPDigestAuth(user, password)
s.headers.update(custom_header)
for row in csvin:
data = {'param1': v1, 'param2': 'some value'}
with open(row['Presentation File'], 'rb') as f:
print "Track found. Uploading..."
r = s.post(host+'/api/uploadTrack', data=data, files={'file': (row['Presentation File'],f)}, verify=False, timeout=(6.05, 70))
```
```
import sys, time, requests, csv
from requests.auth import HTTPDigestAuth, HTTPBasicAuth
custom_header = {'X-Requested-Auth': 'Digest'}
host = raw_input("Enter host address, including scheme: ")
user = raw_input("Enter username: ")
password = raw_input("Enter password: ")
#v1 is a string representation of some xml
with open('myFiles.csv', 'rb') as csvfile:
csvin = csv.DictReader(csvfile, delimiter=',', quotechar='"')
with requests.Session() as s:
#Define session-level auth method and custom header
s.auth = HTTPDigestAuth(user, password)
s.headers.update(custom_header)
for row in csvin:
data = {'param1': v1, 'param2': 'some value'}
with open(row['Presentation File'], 'rb') as f:
print "Track found. Uploading..."
r = s.post(host+'/api/uploadTrack', auth=HTTPDigestAuth(user, password), data=data, files={'file': (row['Presentation File'],f)}, verify=False, timeout=(6.05, 70))
```
## System Information
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.5"
},
"platform": {
"release": "3.10.0-693.2.2.el7.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000105f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
Note that I can reproduce in a Windows environment using request 2.11.1, so this is not a recent regression.
|
{
"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/4324/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4324/timeline
| null |
completed
| null | null | false |
[
"Do you have a `~/.netrc` file? What happens if you set `trust_env=False` in the request?",
"I don't have a ~/.netrc file.\r\nWhen I inject trust_env=False in the individual s.post kwargs, I get a TypeError for unexpected argument trust_env.\r\n\r\nIf I set the session attribute `s.trust_env = False`, then I still get a 200 when omitting the auth argument from the s.post and 502 when including it directly within s.post args.",
"What happens if you unset your custom auth header?",
"With respect to the test API behavior, without the custom header set, the test API generally responds with a 302 redirect. However, once the session has successfully negotiated digest authentication once, it appears the client does not need to continue providing the custom header assuming the client continues to provide the digest headers and calculates the appropriate response string. In other words, the custom header is only needed to get the initial 401 response.\r\n\r\nWhen I test with curl without preemptively generating the digest headers with each subsequent call, I get the 302 response as expected when omitting the custom header.\r\n\r\nHowever, using python and Requests, for this particular request, if I omit the custom header (so it is defined neither defined session-wide nor as an argument for the post method) and explicitly call out the auth in the post method, I receive a 502 instead of the expected 302.\r\n\r\nI decided to remove an intermediate proxy from my test setup, so where I previously saw 502, I now get requests.exceptions.ConnectionError: ('Connection aborted.', error(104, 'Connection reset by peer'))\r\n\r\nI'm adding additional debug prints to see if anything else stands out.",
"Without the proxy in place, it appears that I can get a 200 response if I accompany the duplicate auth argument with the custom header at the method level.\r\nv_v I am starting to wonder if there the issue is tied to the timing of packets sent. Functionally I don't see what would be different in the generated requests.",
"This seems to be an issue with the server at use. Without further evidence and with such a long period of silence, I'm closing this issue."
] |
https://api.github.com/repos/psf/requests/issues/4323
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4323/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4323/comments
|
https://api.github.com/repos/psf/requests/issues/4323/events
|
https://github.com/psf/requests/issues/4323
| 262,203,652 |
MDU6SXNzdWUyNjIyMDM2NTI=
| 4,323 |
Make sessions safe[r] in multi-process environment
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/290258?v=4",
"events_url": "https://api.github.com/users/rabbbit/events{/privacy}",
"followers_url": "https://api.github.com/users/rabbbit/followers",
"following_url": "https://api.github.com/users/rabbbit/following{/other_user}",
"gists_url": "https://api.github.com/users/rabbbit/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rabbbit",
"id": 290258,
"login": "rabbbit",
"node_id": "MDQ6VXNlcjI5MDI1OA==",
"organizations_url": "https://api.github.com/users/rabbbit/orgs",
"received_events_url": "https://api.github.com/users/rabbbit/received_events",
"repos_url": "https://api.github.com/users/rabbbit/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rabbbit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rabbbit/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rabbbit",
"user_view_type": "public"
}
|
[
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
},
{
"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 | 8 |
2017-10-02T19:44:08Z
|
2024-05-19T18:56:37Z
| null |
NONE
| null |
tldr; in multi-process environment (Celery) sessions might lead to request/responses being mixed up.
It is unsafe to use Session in a multi-process environment - if the fork happens after Session initialisation the underlying connection pool will be shared across both processes, leading to potentially dangerous and hard to debug issues.
I'm not sure what should happen - whather a code change is necessary, or a documentation change is enough. Please advise :)
## Use case
It is likely to happen if Session is created at module load time, like:
```python
class MyClient(object):
session = requests.Session()
def do_things(self, **params):
self.session.get(**params)
```
or if a 3rd party client is imported at the module level, where it becomes totally invisible:
```python
my_database_client = database.DatabaseClient(**params)
class MyDatabaseWrapper(object):
def do_things(self, **params):
my_database_client.update(**params)
```
This is particularly tricky in a **Celery**, where a previously working function might start causing troubles if invoked from Celery. Celery seems like a common Python use case.
I've seen this pattern in 3 different repos written by 3 different developers - it feels common enough for it to be a problem.
## Reason
This is related to https://github.com/shazow/urllib3/issues/850 in urllib3, where it was stated that it's the callers' responsibility to worry about forking - in this case, it's Requests.
## Expected Result
Ideally, a new Session with the same parameters would be started by Requests.
If that's too complicated, I'd expect an exception to be thrown if PID change was detected.
At the very least, docs should state the expected behaviour.
## Actual Result
The responses are mixed up - one process might receive a response made for a call it didn't make.
## Reproduction Steps
```python
import os
import sys
import requests
MAX = 20
s = requests.Session()
for n in range(MAX):
pid = os.fork()
if pid == 0:
try:
# s.mount("http://", requests.adapters.HTTPAdapter()) # uncomment to fix
r = s.get('http://httpstat.us/300?sleep=100')
except Exception:
# ignoring intermittent http errors
pass
sys.exit(0)
else:
try:
r = s.get('http://httpstat.us/200')
except Exception as exc:
# ignoring intermittent http errors
pass
if r.status_code != 200:
print 'pid: {} Call {}/{}. Wrong status code detected {}'.format(
os.getpid(),
n,
MAX,
r.status_code
)
```
```
pid: 30996 Call 7/20. Wrong status code detected 300
pid: 30996 Call 9/20. Wrong status code detected 300
pid: 30996 Call 14/20. Wrong status code detected 300
pid: 30996 Call 17/20. Wrong status code detected 300
pid: 30996 Call 19/20. Wrong status code detected 300
```
## System Information
$ python -m requests.help
```
pawel@pawel-C02V306VHTDH ~/Uber/tokenizer-python $ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.14"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
| null |
{
"+1": 6,
"-1": 0,
"confused": 0,
"eyes": 1,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 7,
"url": "https://api.github.com/repos/psf/requests/issues/4323/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4323/timeline
| null | null | null | null | false |
[
"So my suggestion here is that we simply document this as a risk. It can’t happen merely by creating a `Session` before forking, it has to actually be *used* before the fork. The difficulty is that forking combined with multi threading and streaming means that we need to check PIDs constantly: additionally, there is no appropriate recovery in many cases. \r\n\r\nAs a result I suggest this is best handled at application scope: either create sessions after forking or wrap them in a data structure that understands your forking paradigm. There is just no general solution to this problem. ",
"I second to this suggestion. I was using same sessions object across multiple independent processes, and boy, I had to literally spend 3 hours scratching my head before I could finally pinpoint to this as a root cause. \r\n\r\nOddly though, my code was working perfectly on a windows platform. On Linux, I was having a issue with responses mixups. I think may be because windows and Linux handle multiprocessing differently? Not sure here. ",
"> I think may be because windows and Linux handle multiprocessing differently? Not sure here.\r\n\r\nThey do. multiprocessing on Windows can't fork in the same was as linux so you were not actually sharing the same session across processes",
"I am also having issues with celery and requests, this results in unexplained hangups while .get'ing , bad content, and auth tokens being randomly invalidated.",
"Quoting:\r\n\r\n> As a result I suggest this is best handled at application scope: either create sessions after forking or wrap them in a data structure that understands your forking paradigm. There is just no general solution to this problem.",
"Would using two session objects, one for authentication pre-fork, extracting the cookiejar , passing the cookiejar to the to-be-forked task (-celery) and then using it to do whatever needs to be done against the server work? ",
"So I think I've got it, and have a code recipe for a best practice, should I go ahead and write something and then submit a PR for the docs? ",
"@sivang Can you please share your code recipe for best practice?\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4322
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4322/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4322/comments
|
https://api.github.com/repos/psf/requests/issues/4322/events
|
https://github.com/psf/requests/issues/4322
| 262,174,050 |
MDU6SXNzdWUyNjIxNzQwNTA=
| 4,322 |
Reuse ssl.SSLContext across all SSL connections within a requests.Sesssion
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/772?v=4",
"events_url": "https://api.github.com/users/alex/events{/privacy}",
"followers_url": "https://api.github.com/users/alex/followers",
"following_url": "https://api.github.com/users/alex/following{/other_user}",
"gists_url": "https://api.github.com/users/alex/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alex",
"id": 772,
"login": "alex",
"node_id": "MDQ6VXNlcjc3Mg==",
"organizations_url": "https://api.github.com/users/alex/orgs",
"received_events_url": "https://api.github.com/users/alex/received_events",
"repos_url": "https://api.github.com/users/alex/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alex/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alex/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alex",
"user_view_type": "public"
}
|
[
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
},
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
}
] |
closed
| false | null |
[] | null | 5 |
2017-10-02T18:05:53Z
|
2024-05-19T19:07:12Z
|
2024-05-19T19:07:12Z
|
MEMBER
| null |
requests should pass `ssl_context` to `urllib3.PoolManager`: https://github.com/requests/requests/blob/2a4dd64fb4c072c646277c9d057737b05351b86f/requests/adapters.py#L161-L162
Otherwise a new SSLContext is allocated for all requests. SSLContexsts can be huge, like 1MB, so doing this will be a performance and memory usage win.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4322/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4322/timeline
| null |
completed
| null | null | false |
[
"It looks like Requests doesn't define `ssl_context` anywhere. Where should it be created?",
"How is the status of this issue?",
"Hello, me and my group mates are going to be working on this issue.",
"@alex Could you tell me where you have an instance of ssl_context within the code? Thank you.",
"This should be largely addressed in 9a40d1277807f0a4f26c9a37eea8ec90faa8aadc."
] |
https://api.github.com/repos/psf/requests/issues/4321
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4321/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4321/comments
|
https://api.github.com/repos/psf/requests/issues/4321/events
|
https://github.com/psf/requests/issues/4321
| 262,027,085 |
MDU6SXNzdWUyNjIwMjcwODU=
| 4,321 |
Feature request: Session optio for "strict body content"
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3591955?v=4",
"events_url": "https://api.github.com/users/melvyn-sopacua/events{/privacy}",
"followers_url": "https://api.github.com/users/melvyn-sopacua/followers",
"following_url": "https://api.github.com/users/melvyn-sopacua/following{/other_user}",
"gists_url": "https://api.github.com/users/melvyn-sopacua/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/melvyn-sopacua",
"id": 3591955,
"login": "melvyn-sopacua",
"node_id": "MDQ6VXNlcjM1OTE5NTU=",
"organizations_url": "https://api.github.com/users/melvyn-sopacua/orgs",
"received_events_url": "https://api.github.com/users/melvyn-sopacua/received_events",
"repos_url": "https://api.github.com/users/melvyn-sopacua/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/melvyn-sopacua/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/melvyn-sopacua/subscriptions",
"type": "User",
"url": "https://api.github.com/users/melvyn-sopacua",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-10-02T09:25:02Z
|
2021-09-08T06:00:39Z
|
2017-10-02T12:06:38Z
|
NONE
|
resolved
|
When building an Api client, I abstract the authentication to be able to passed through via headers, params, post data or json. As a result I created a "context dict" that is passed to `Session().method()` consisting of headers, params, data and json. These dict keys were intialized with empty dicts to allow simple `context['headers'].update()` by consumers.
## Expected Result
I expected this to be able to send requests and get responses.
## Actual Result
However, when testing a GET request for an API behind Cloudfront (not sure that's related, as they use the 403 code for a number of issues) I was presented with an error. After removing headers one by one via `curl` the `Content-Length` header was fingered as the culprit.
## Reproduction Steps
```python
import requests
context = { 'headers': {}, 'params': {}, 'data': {}, 'json': {} }
s = requests.Session()
r = s.get('http://someserver.choking.on.content-length.example.com')
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.2+"
},
"platform": {
"release": "4.10.0-35-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
## Analysis
The culprit was the intialization of the json keyword argument as an empty dict. This causes the prepared request to inject a body being an "empty object", without taking the request method into account.
Since I'm unsure this is a feature, I would appreciate a setting that disables this behavior and does not send a body if the request method does not support one.
I can see two approaches:
1. A bool `strict_request_body` or something similarly named, that does not send request bodies for GET, HEAD and possibly others. This requires maintenance for new request methods and for "custom request methods" it requires extra code to check this value.
2. An iterable listing which requests shall never have a body, like `no_request_body=['get', 'head']`. This has the drawback that one can disable bodies for requests that require them, aka footshooting.
|
{
"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/4321/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4321/timeline
| null |
completed
| null | null | false |
[
"> Since I'm unsure this is a feature, I would appreciate a setting that disables this behavior and does not send a body if the request method does not support one.\r\n\r\nEvery request method allows request bodies. Some methods, however, do not assign semantic meaning to them and allow intermediaries (e.g., Cloudflare) to strip them or provide a 4xx response when using them. Some services, e.g., Elasticsearch, rely on sending bodies with certain methods that are otherwise not used in that way. So this option is fairly wrong just from that perspective. It also has the ability to be a gun pointed directly at users' feet (as you mentioned). And finally, Requests is under a hard feature freeze. We're not expanding our API surface unless it is severely necessary.\r\n\r\nFinally, I would strongly advise you look into the standard library's `collections` module at the `defaultdict` class. You could then say\r\n\r\n```py\r\ncontext = collections.defaultdict(dict)\r\ncontext['json'].update({'foo': 'bar'})\r\n```\r\n\r\nAnd you can then splat that in your requests calls. It will avoid this problem for you.",
"@sigmavirus24 Thanks a bunch! Learning something new every day. My context dict is in fact an object extending `collections.MutableMapping`, but that won't interfere much from the looks of it."
] |
https://api.github.com/repos/psf/requests/issues/4320
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4320/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4320/comments
|
https://api.github.com/repos/psf/requests/issues/4320/events
|
https://github.com/psf/requests/issues/4320
| 261,940,329 |
MDU6SXNzdWUyNjE5NDAzMjk=
| 4,320 |
SSLError(SSLError("bad handshake: SysCallError(10060, 'WSAETIMEDOUT')",),) on windows 10
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18638605?v=4",
"events_url": "https://api.github.com/users/rnmhdn/events{/privacy}",
"followers_url": "https://api.github.com/users/rnmhdn/followers",
"following_url": "https://api.github.com/users/rnmhdn/following{/other_user}",
"gists_url": "https://api.github.com/users/rnmhdn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rnmhdn",
"id": 18638605,
"login": "rnmhdn",
"node_id": "MDQ6VXNlcjE4NjM4NjA1",
"organizations_url": "https://api.github.com/users/rnmhdn/orgs",
"received_events_url": "https://api.github.com/users/rnmhdn/received_events",
"repos_url": "https://api.github.com/users/rnmhdn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rnmhdn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rnmhdn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rnmhdn",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2017-10-01T19:37:59Z
|
2018-12-26T15:47:06Z
|
2017-10-04T18:00:49Z
|
NONE
|
resolved
|
I'm using python 3.5.3 on windows 10 and I get The following Error while trying to send a head or get request to a webpage:
**Here is my Traceback:**
> Traceback (most recent call last):
> File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 441, in wrap_socket
> cnx.do_handshake()
> File "C:\Users\aran\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1426, in do_handshake
> self._raise_ssl_error(self._ssl, result)
> File "C:\Users\aran\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1166, in _raise_ssl_error
> raise SysCallError(errno, errorcode.get(errno))
> OpenSSL.SSL.SysCallError: (10060, 'WSAETIMEDOUT')
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
> chunked=chunked)
> File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
> self._validate_conn(conn)
> File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
> conn.connect()
> File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connection.py", line 326, in connect
> ssl_context=context)
> File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket
> return context.wrap_socket(sock, server_hostname=server_hostname)
> File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 448, in wrap_socket
> raise ssl.SSLError('bad handshake: %r' % e)
> ssl.SSLError: ("bad handshake: SysCallError(10060, 'WSAETIMEDOUT')",)
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "C:\Users\aran\Anaconda3\lib\site-packages\requests\adapters.py", line 440, in send
> timeout=timeout
> File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
> _stacktrace=sys.exc_info()[2])
> File "C:\Users\aran\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 388, in increment
> raise MaxRetryError(_pool, url, error or ResponseError(cause))
> urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='sites.google.com', port=443): Max retries exceeded with url: /a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations (Caused by SSLError(SSLError("bad handshake: SysCallError(10060, 'WSAETIMEDOUT')",),))
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "Z:/my files/projects/programing/python/courseAssist/ce_course_crawler.py", line 138, in <module>
> response = requests.head('https://sites.google.com/a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations')
> File "C:\Users\aran\Anaconda3\lib\site-packages\requests\api.py", line 98, in head
> return request('head', url, **kwargs)
> File "C:\Users\aran\Anaconda3\lib\site-packages\requests\api.py", line 58, in request
> return session.request(method=method, url=url, **kwargs)
> File "C:\Users\aran\Anaconda3\lib\site-packages\requests\sessions.py", line 508, in request
> resp = self.send(prep, **send_kwargs)
> File "C:\Users\aran\Anaconda3\lib\site-packages\requests\sessions.py", line 618, in send
> r = adapter.send(request, **kwargs)
> File "C:\Users\aran\Anaconda3\lib\site-packages\requests\adapters.py", line 506, in send
> raise SSLError(e, request=request)
> requests.exceptions.SSLError: HTTPSConnectionPool(host='sites.google.com', port=443): Max retries exceeded with url: /a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations (Caused by SSLError(SSLError("bad handshake: SysCallError(10060, 'WSAETIMEDOUT')",),))
**And Here is my code:**
```
import requests
response = requests.head('https://sites.google.com/a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations')
```
## System Information
```
C:\Users\aran>python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.7.1"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.5.3"
},
"platform": {
"release": "10",
"system": "Windows"
},
"pyOpenSSL": {
"openssl_version": "100020af",
"version": "16.2.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020af"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4320/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4320/timeline
| null |
completed
| null | null | false |
[
"The error seems to be an underlying syscall issue: specifically, the handshake timing out. What happens if you uninstall PyOpenSSL?",
"This is What I get:\r\n\r\n```\r\nPython 3.5.3 | packaged by conda-forge | (default, Jan 23 2017, 20:04:35) [MSC v.1900 64 bit (AMD64)] on win32\r\nIn[2]: import requests\r\nresponse = requests.head('https://sites.google.com/a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations')\r\nTraceback (most recent call last):\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py\", line 601, in urlopen\r\n chunked=chunked)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py\", line 346, in _make_request\r\n self._validate_conn(conn)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py\", line 850, in _validate_conn\r\n conn.connect()\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\connection.py\", line 326, in connect\r\n ssl_context=context)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\util\\ssl_.py\", line 329, in ssl_wrap_socket\r\n return context.wrap_socket(sock, server_hostname=server_hostname)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\ssl.py\", line 385, in wrap_socket\r\n _context=self)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\ssl.py\", line 760, in __init__\r\n self.do_handshake()\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\ssl.py\", line 996, in do_handshake\r\n self._sslobj.do_handshake()\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\ssl.py\", line 641, 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\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\requests\\adapters.py\", line 440, in send\r\n timeout=timeout\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py\", line 639, in urlopen\r\n _stacktrace=sys.exc_info()[2])\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\util\\retry.py\", line 357, in increment\r\n raise six.reraise(type(error), error, _stacktrace)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\packages\\six.py\", line 685, in reraise\r\n raise value.with_traceback(tb)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py\", line 601, in urlopen\r\n chunked=chunked)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py\", line 346, in _make_request\r\n self._validate_conn(conn)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\connectionpool.py\", line 850, in _validate_conn\r\n conn.connect()\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\connection.py\", line 326, in connect\r\n ssl_context=context)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\urllib3\\util\\ssl_.py\", line 329, in ssl_wrap_socket\r\n return context.wrap_socket(sock, server_hostname=server_hostname)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\ssl.py\", line 385, in wrap_socket\r\n _context=self)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\ssl.py\", line 760, in __init__\r\n self.do_handshake()\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\ssl.py\", line 996, in do_handshake\r\n self._sslobj.do_handshake()\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\ssl.py\", line 641, in do_handshake\r\n self._sslobj.do_handshake()\r\nurllib3.exceptions.ProtocolError: ('Connection aborted.', TimeoutError(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', None, 10060, None))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3066, in run_code\r\n exec(code_obj, self.user_global_ns, self.user_ns)\r\n File \"<ipython-input-2-21b5e28bac10>\", line 2, in <module>\r\n response = requests.head('https://sites.google.com/a/aims-senegal.org/scipy/roots-finding-numerical-integrations-and-differential-equations')\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\requests\\api.py\", line 98, in head\r\n return request('head', url, **kwargs)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\requests\\api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\requests\\sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\requests\\sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"C:\\Users\\aran\\Anaconda3\\lib\\site-packages\\requests\\adapters.py\", line 490, in send\r\n raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: ('Connection aborted.', TimeoutError(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', None, 10060, None))\r\n```\r\n\r\nAfter running this to uninstall pyopenssl:\r\n```\r\n(C:\\Users\\aran\\Anaconda3) C:\\Users\\aran>pip uninstall pyopenssl\r\nUninstalling pyOpenSSL-16.2.0:\r\n c:\\users\\aran\\anaconda3\\lib\\site-packages\\openssl\r\n c:\\users\\aran\\anaconda3\\lib\\site-packages\\pyopenssl-16.2.0-py3.5.egg-info\r\nProceed (y/n)? y\r\n Successfully uninstalled pyOpenSSL-16.2.0\r\n```",
"Yup, so the remote server is timing out. That seems like a bug with the server. ",
"But I never get that Error from ubuntu",
"@aranmohyeddin I have the same issue you mentioned here with python 3 and windows 10, I uninstalled pyopenssl and got the exact same error, did you find any solution??the only way is to change my OS??",
"@Tara-Morovatdar This is from a long time ago and I don't remember much about it but I think I ended up doing it on Ubuntu, however If I recall currently I didn't have Ubuntu in my system at that time, so I must have either done it on my digital ocean VPS or on the VPS I have from my university. I find the first much more likely, assuming you are also from Iran seeing your name, and considering that the Digital ocean VPS was located outside Iran, I find it likely that the issue be related to the internet censorship we are suffering from in Iran. So I'd recommend you to try using a VPN or Tor. By the way, a few months after I had this issue I got rid of windows and installed Ubuntu, 6 months after that I switched to Archlinux, a month after installing Arch I can't imagine to ever come back to Windows again. And I have no way to express how happy I am with using Archlinux, therefore, I would strongly recommend you to go about the same path and go to Ubuntu and then to Arch, although I don't really expect it to affect your current issue. (I have to point out that I'm a heavy keyboard user(I hardy use my mouse), I don't like interfaces(I prefer to setup my system editing files rather than clicking buttons), and I don't like proprietary software if I have alternatives(Right now I only use FOSS and Cloud based Software(google docs, sharelatex, etc)) so maybe you don't like to change your OS if you find yourself so different from me from these three aspects) ",
"Hi AranThank you for your complete and nice answer. You are right I am from Iran but I live in germany so the problem cant be the censorship. I also dont have ubunto right now on my system but I believe that every programmer should move to ubunto in a point of time so thank you for your tips.TaraOn Aug 16, 2018 06:37, Aran Mohyeddin <[email protected]> wrote:@Tara-Morovatdar This is from a long time ago and I don't remember much about it but I think I ended up doing it on Ubuntu, however If I recall currently I didn't have Ubuntu in my system at that time, so I must have either done it on my digital ocean VPS or on the VPS I have from my university. I find the first much more likely, assuming you are also from Iran seeing your name, and considering that the Digital ocean VPS was located outside Iran, I find it likely that the issue be related to the internet censorship we are suffering from in Iran. So I'd recommend you to try using a VPN or Tor. By the way, a few months after I had this issue I got rid of windows and installed Ubuntu, 6 months after that I switched to Archlinux, a month after installing Arch I can't imagine to ever come back to Windows again. And I have no way to express how happy I am with using Archlinux, therefore, I would strongly recommend you to go about the same path and go to Ubuntu and then to Arch, although I don't really expect it to affect your current issue. (I have to point out that I'm a heavy keyboard user(I hardy use my mouse), I don't like interfaces(I prefer to setup my system editing files rather than clicking buttons), and I don't like proprietary software if I have alternatives(Right now I only use FOSS and Cloud based Software(google docs, sharelatex, etc)) so maybe you don't like to change your OS if you find yourself so different from me from these three aspects)\r\n\r\n—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.",
"I got the same error I just want to get the raw data from BLE beacon\r\nFor this i have to install bluepy but it gives error \r\nI found that Aran and tara got the same problem \r\nWould any of you help me in resolving it \r\nOr another method to get raw data from BLE Beacon\r\n\r\n[ERROR.txt](https://github.com/requests/requests/files/2709513/ERROR.txt)\r\n"
] |
https://api.github.com/repos/psf/requests/issues/4319
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4319/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4319/comments
|
https://api.github.com/repos/psf/requests/issues/4319/events
|
https://github.com/psf/requests/issues/4319
| 261,924,323 |
MDU6SXNzdWUyNjE5MjQzMjM=
| 4,319 |
SSL Proxy Support
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9809130?v=4",
"events_url": "https://api.github.com/users/clusby/events{/privacy}",
"followers_url": "https://api.github.com/users/clusby/followers",
"following_url": "https://api.github.com/users/clusby/following{/other_user}",
"gists_url": "https://api.github.com/users/clusby/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/clusby",
"id": 9809130,
"login": "clusby",
"node_id": "MDQ6VXNlcjk4MDkxMzA=",
"organizations_url": "https://api.github.com/users/clusby/orgs",
"received_events_url": "https://api.github.com/users/clusby/received_events",
"repos_url": "https://api.github.com/users/clusby/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/clusby/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/clusby/subscriptions",
"type": "User",
"url": "https://api.github.com/users/clusby",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2017-10-01T15:33:07Z
|
2021-09-08T06:00:39Z
|
2017-10-01T15:57:49Z
|
NONE
|
resolved
|
When accessing HTTPS urls via an NTLM proxy, the get request fails with a request.exceptions.ProxyError
I believe this is because the hook to use requests-ntlm isn't dispatched when performing the SSL tunnel. That is, a socket error is thrown when I get a 407 in httplib._tunnel().
Are there any plans to support https queries using a proxy auth extension?
## Expected Result
HTTPS NTLM requests should authenticate on the proxy and get the external site.
## Actual Result
A request.exceptions.ProxyError is thrown
## Reproduction Steps
```python
import requests
from requests_ntlm import HttpNtlmAuth
session = requests.Session()
session.auth = HttpNtlmAuth(user, pass)
session.proxies = {'http': 'http://ntlm-proxy:8080', 'https': 'http://ntlm-proxy:8080'}
resp = session.get('https://httpbin.org/get')
# resp.status_code should = 200, however received 407
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.9"
},
"implementation": {
"name": "CPython",
"version": "2.7.6"
},
"platform": {
"release": "2008ServerR2",
"system": "Windows",
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "17.0.0"
},
"requests": {
"version": "2.17.3"
},
"system_ssl": {
"version": "90819f"
},
"urllib3": {
"version": "1.21.1"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4319/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4319/timeline
| null |
completed
| null | null | false |
[
"Requests-NTLM is a separate project from Requests: please raise this issue on that repository. ",
"Sure - I think this may involve both projects though. \r\n\r\nThe exception is thrown within sessions.py:\r\n```python\r\n# Send the request\r\nr = adapter.send(request, **kwargs)\r\n```\r\n\r\nWithin send(), the SSL tunnel is attempted - and reaches down into httplib._tunnel()\r\n```python\r\ndef _tunnel(self):\r\n ...\r\n response = self.response_class(self.sock, strict = self.strict, method = self._method)\r\n (version, code, message) = response._read_status()\r\n \r\n if code != 200:\r\n self.close()\r\n raise socket.error(\"Tunnel connection failed: %d %s\" % (code, message.strip)))\r\n```\r\nWe would need the 407 handled here to handle custom authentication.\r\nI think it would be an issue with ntlm, kerberos, etc, etc. tunnelling.\r\n",
"As a general rule no Requests sub-project handles authing on TLS tunnelling. This is ultimately because httplib simply doesn’t give us appropriate hooks to do so. 🙁",
"Yeh makes sense thanks @Lukasa . I'll take a look at monkeypatching or using pycurl instead. :-(\r\n\r\nDoes urllib3 v2 still have momentum?",
"Due to my job change it has less momentum than it did before. Hopefully I'll find some quiet time to take more of a run at it, or we'll decide to land it as-is."
] |
https://api.github.com/repos/psf/requests/issues/4318
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4318/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4318/comments
|
https://api.github.com/repos/psf/requests/issues/4318/events
|
https://github.com/psf/requests/issues/4318
| 261,902,183 |
MDU6SXNzdWUyNjE5MDIxODM=
| 4,318 |
netrc reading does not respect NETRC environment variable
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/585279?v=4",
"events_url": "https://api.github.com/users/mitar/events{/privacy}",
"followers_url": "https://api.github.com/users/mitar/followers",
"following_url": "https://api.github.com/users/mitar/following{/other_user}",
"gists_url": "https://api.github.com/users/mitar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mitar",
"id": 585279,
"login": "mitar",
"node_id": "MDQ6VXNlcjU4NTI3OQ==",
"organizations_url": "https://api.github.com/users/mitar/orgs",
"received_events_url": "https://api.github.com/users/mitar/received_events",
"repos_url": "https://api.github.com/users/mitar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mitar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mitar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mitar",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-10-01T08:56:47Z
|
2021-08-29T00:06:40Z
|
2020-11-01T16:52:02Z
|
NONE
|
resolved
|
As described [here](https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html), there is an environment variable `NETRC` which one can use to control where `.netrc` file is. Requests always searches in user's home directory.
## System Information
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.5.2"
},
"platform": {
"release": "14.5.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 3,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 3,
"url": "https://api.github.com/repos/psf/requests/issues/4318/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4318/timeline
| null |
completed
| null | null | false |
[
"Do we still want this feature? I want this feature, but I don't know overall sentiment among users.\r\n\r\nI see that https://github.com/psf/requests/pull/4339 was closed because it wasn't finished. I volunteer to finish the work with appropriate test coverage and documentation.",
"This has been open very long without response. How will this case be handled? This would be a very good feature to implement.",
"This project has generally had a terrible experience with it's netrc support. It causes confusion and isn't convenient to disable. If anything, I'd expect the current maintainers to want to drop support for finding/parsing netrc files and close this as something they won't implement. (And they'd be right to do so)",
"Awesome! Thanks!"
] |
https://api.github.com/repos/psf/requests/issues/4317
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4317/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4317/comments
|
https://api.github.com/repos/psf/requests/issues/4317/events
|
https://github.com/psf/requests/issues/4317
| 261,901,848 |
MDU6SXNzdWUyNjE5MDE4NDg=
| 4,317 |
Option to set server name in HTTPs request
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10564697?v=4",
"events_url": "https://api.github.com/users/soumoks/events{/privacy}",
"followers_url": "https://api.github.com/users/soumoks/followers",
"following_url": "https://api.github.com/users/soumoks/following{/other_user}",
"gists_url": "https://api.github.com/users/soumoks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/soumoks",
"id": 10564697,
"login": "soumoks",
"node_id": "MDQ6VXNlcjEwNTY0Njk3",
"organizations_url": "https://api.github.com/users/soumoks/orgs",
"received_events_url": "https://api.github.com/users/soumoks/received_events",
"repos_url": "https://api.github.com/users/soumoks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/soumoks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/soumoks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/soumoks",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-10-01T08:49:39Z
|
2021-09-08T05:00:39Z
|
2017-12-29T13:38:12Z
|
NONE
|
resolved
|
Summary.
Server name is being read from the request URI resulting in SSL handshake failure when making request to IP address. Setting host_header does not help as the value of ssl.handshake.extensions_server_name is still being set to the IP address.
## Expected Result
Need an option similar to openssl s_client -servername
https://wiki.openssl.org/index.php/Manual:S_client(1)
What you expected.
## Actual Result
What happened instead.
ssl.handshake.extensions_server_name is being set to the URI
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 560, in urlopen
body=body, headers=headers)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 787, in _validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 252, in connect
ssl_version=resolved_ssl_version)
File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 305, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.5/ssl.py", line 377, in wrap_socket
_context=self)
File "/usr/lib/python3.5/ssl.py", line 752, in __init__
self.do_handshake()
File "/usr/lib/python3.5/ssl.py", line 988, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.5/ssl.py", line 633, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 376, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 589, in urlopen
raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "python_requests_sni.py", line 4, in <module>
r = requests.get(request_url,headers=headers,verify=False)
File "/usr/lib/python3/dist-packages/requests/api.py", line 67, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python3/dist-packages/requests/api.py", line 53, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 447, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)
## Reproduction Steps
import requests
headers = {'host': 'host_header'}
request_url = "https://1.1.1.1/index.html"
r = requests.get(request_url,headers=headers,verify=False)
print(r.content)
```python
import requests
```
## System Information
$ python -m requests.help
```
<paste here>
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
Operating system -
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
Python version -
Python 3.5.2
|
{
"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/4317/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4317/timeline
| null |
completed
| null | null | false |
[
"That's provided by this [transport adapter](http://toolbelt.readthedocs.io/en/latest/adapters.html#hostheaderssladapter).\r\n\r\nCheers!"
] |
https://api.github.com/repos/psf/requests/issues/4316
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4316/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4316/comments
|
https://api.github.com/repos/psf/requests/issues/4316/events
|
https://github.com/psf/requests/pull/4316
| 261,853,405 |
MDExOlB1bGxSZXF1ZXN0MTQ0MDMzODQx
| 4,316 |
Avoid importing platform
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/199592?v=4",
"events_url": "https://api.github.com/users/methane/events{/privacy}",
"followers_url": "https://api.github.com/users/methane/followers",
"following_url": "https://api.github.com/users/methane/following{/other_user}",
"gists_url": "https://api.github.com/users/methane/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/methane",
"id": 199592,
"login": "methane",
"node_id": "MDQ6VXNlcjE5OTU5Mg==",
"organizations_url": "https://api.github.com/users/methane/orgs",
"received_events_url": "https://api.github.com/users/methane/received_events",
"repos_url": "https://api.github.com/users/methane/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/methane/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/methane/subscriptions",
"type": "User",
"url": "https://api.github.com/users/methane",
"user_view_type": "public"
}
|
[] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
] | null | 8 |
2017-09-30T16:09:53Z
|
2021-09-04T00:06:45Z
|
2017-10-20T00:47:40Z
|
CONTRIBUTOR
|
resolved
|
platform module is relatively large: it takes about 5ms to import.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4316/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4316/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4316.diff",
"html_url": "https://github.com/psf/requests/pull/4316",
"merged_at": "2017-10-20T00:47:40Z",
"patch_url": "https://github.com/psf/requests/pull/4316.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4316"
}
| true |
[
"Is `sys.platform` always equal to `win32` even on 64bit windows installations?",
"Might wanna do `sys.platform.startswith('win')`? I've seen that in another library, can't recall which.",
"It is always 'win32'.\r\nhttps://docs.python.org/3/library/sys.html#sys.platform\r\n\r\nhttps://github.com/python/cpython/blob/d6bb65f378e34fe0c11fdb39588357ecf22964eb/PC/pyconfig.h#L297-L301",
"Once https://github.com/kennethreitz/httpbin/pull/392 merges and Kevin releases a pytest-httpbin package, the tests here should start passing.",
"@methane would you mind rebasing this onto the current master branch?",
"done",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4316?src=pr&el=h1) Report\n> Merging [#4316](https://codecov.io/gh/requests/requests/pull/4316?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/54ad3d6dcc173576d3f9784985e88d31a4997677?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `100%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4316?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4316 +/- ##\n=======================================\n Coverage 88.28% 88.28% \n=======================================\n Files 18 18 \n Lines 2031 2031 \n=======================================\n Hits 1793 1793 \n Misses 238 238\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4316?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/utils.py](https://codecov.io/gh/requests/requests/pull/4316?src=pr&el=tree#diff-cmVxdWVzdHMvdXRpbHMucHk=) | `82.87% <100%> (ø)` | :arrow_up: |\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4316?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `95.55% <100%> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4316?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4316?src=pr&el=footer). Last update [54ad3d6...a05aac7](https://codecov.io/gh/requests/requests/pull/4316?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
":tada: LGTM"
] |
https://api.github.com/repos/psf/requests/issues/4315
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4315/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4315/comments
|
https://api.github.com/repos/psf/requests/issues/4315/events
|
https://github.com/psf/requests/issues/4315
| 261,846,209 |
MDU6SXNzdWUyNjE4NDYyMDk=
| 4,315 |
Investigate users with slow import time, and attempt to mitigate in future releases
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[
{
"color": "02e10c",
"default": false,
"description": null,
"id": 76800,
"name": "Feature Request",
"node_id": "MDU6TGFiZWw3NjgwMA==",
"url": "https://api.github.com/repos/psf/requests/labels/Feature%20Request"
}
] |
closed
| true | null |
[] | null | 20 |
2017-09-30T14:10:20Z
|
2022-02-26T04:00:39Z
|
2021-11-28T03:04:04Z
|
CONTRIBUTOR
|
resolved
|
Letter from a fan:
> Hi Kenneth!
> Lol I'm named Kenneth too :) - but just call me Ken.
> Thanks for Requests! I use it for my bots, and it really simplifies everything.
> It helps my life - I work with a MediaWiki wiki, and Requests condenses all the (guess what) > requests I have to make.
> My only qualm is how long it takes to import - but I love it all the same.
> Thank you!
This pretty much sums up many people's perception of Requests, and I'd like for us to fix this — be it pyopenssl's fault or not.
|
{
"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/4315/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4315/timeline
| null |
completed
| null | null | false |
[
"See https://gist.github.com/methane/96d58a29e57e5be97769897462ee1c7e",
"@methane can you share how you generated that?",
"This is produced by patched Python.\r\nSee python/cpython#3490",
"Hi \r\nAre there any plans to improve this issue?.\r\n**request** is used in a CLI tool named **iocage** that is used to control virtual instances of FreeBSD,\r\nImporting requests is significantly slower than creating, and starting a new VM by cloning 100000 files. :-)\r\nSince iocage is started every time a command is issued, it is like a 3-4 sec. delay is introduced into bash, ..pretty annoying..\r\nand in most cases it actually does not need the functionality provided by requests.. :-| \r\nhttps://forums.freenas.org/index.php?threads/iocage-is-slow-at-loading-request.63109/\r\n",
"Is pyOpenSSL installed?\r\nIf so, could you try uninstall it?",
"_>Is pyOpenSSL installed?_\r\nSeems like it.\r\n```root@tango:~/requests # find / | grep pyOpenSSL\r\n/usr/local/lib/python3.6/site-packages/pyOpenSSL-16.2.0-py3.6.egg-info\r\n/usr/local/lib/python3.6/site-packages/pyOpenSSL-16.2.0-py3.6.egg-info/PKG-INFO\r\n/usr/local/lib/python3.6/site-packages/pyOpenSSL-16.2.0-py3.6.egg-info/SOURCES.txt\r\n/usr/local/lib/python3.6/site-packages/pyOpenSSL-16.2.0-py3.6.egg-info/top_level.txt\r\n/usr/local/lib/python3.6/site-packages/pyOpenSSL-16.2.0-py3.6.egg-info/requires.txt\r\n/usr/local/lib/python3.6/site-packages/pyOpenSSL-16.2.0-py3.6.egg-info/dependency_links.txt\r\n```\r\n_If so, could you try uninstall it?_\r\nI don't think this is allowed on FreeNAS, the host is pretty much hard coded.",
"OK. Maybe, this part causes slowdown.\r\n\r\nhttps://github.com/requests/requests/blob/b66908e7b647689793e299edc111bf9910e93ad3/requests/__init__.py#L93-L102",
"@NielsDa Have you checked #4332 ?\r\nWhat is version of your pyOpenSSL and cryptography?",
"@NielsDa And would you try #4591 too?",
"@NielsDa historically speaking `pyOpenSSL` and `cryptography` account for the performance issues you're seeing. The \"fix\" is to uninstall them. If you can't do so, there's little that this project can do to help you if those turn out to be the culprits",
"_What is version of your pyOpenSSL and cryptography?_\r\n**pyOpenSSL 16.2** \r\n**cryptography 1.7.2**\r\n\r\n_The \"fix\" is to uninstall them (pyOpenSSL and cryptography)_\r\nHmm..\r\nFreeNAS come as an appliance, with a fixed set of packages installed, and the packet manager is kind of disabled.\r\nThe system is headless with a http GUI written in django/ python.\r\nThe root file system is a tempfs (ramdisk) and the contents of /etc is generated from a configuration database on boot. \r\nThe functionality provided by _request_ might be used to update the system itself.",
"@NielsDa then it seems there's an issue with the configuration of FreeNAS and that should be brought to the attention of that project's maintainers.",
"To quantify just how slow it is (it hasn't been mentioned in this thread yet):\r\n\r\n $ time python -c 'import requests'\r\n real 0m0.135s\r\n user 0m0.116s\r\n sys 0m0.020s\r\n \r\n $ time python3 -c 'import requests'\r\n real 0m0.405s\r\n user 0m0.381s\r\n sys 0m0.025s\r\n\r\nFour hundred milliseconds. That's a good reason to find a different library to use (or write it from scratch -- all I need is some GET requests).\r\n\r\nFor comparison, `time python(3) -c 'import sys'` takes 29ms and 9ms in python 3 and 2, respectively.\r\n\r\nTested on Debian Buster with `requests` version:\r\n\r\n $ dpkg -l | grep -- -requests\r\n ii python-requests 2.18.4-2 [...]\r\n ii python3-requests 2.18.4-2 [...]\r\n\r\nMy version of the package `python-openssl` (I'm guessing that's pyOpenSSL) is 17.5.0-1 for both python 2 and 3. Package `python-cryptography` is 2.1.4-1, again for both python 2 and 3.",
"I tested with clean virtualenv:\r\n\r\n```\r\n$ time py27/bin/python -c 'import requests'\r\n\r\nreal 0m0.137s\r\nuser 0m0.118s\r\nsys 0m0.020s\r\n\r\n$ time py37/bin/python -c 'import requests'\r\n\r\nreal 0m0.183s\r\nuser 0m0.172s\r\nsys 0m0.012s\r\n```",
"And on Ubuntu 17.10:\r\n\r\n```\r\n$ time /usr/bin/python3 -c 'import requests'\r\n\r\nreal 0m0.145s\r\nuser 0m0.115s\r\nsys 0m0.031s\r\n```\r\n\r\nI suspect that something wrong in your environment.",
"I'd say >100ms is still ridiculously slow and a good reason to find another library. It's not an order of magnitude off from my 400ms in py3.\r\n\r\n(My laptop is otherwise very fast with a good CPU and SSD. Something might be wrong with my setup (Debian Buster is currently in \"testing\" after all), but I can at least tell that it's not the hardware. And at any rate, 100ms is still ridiculous.)",
"It's difficult to reduce the 100ms. About 60ms of the 100ms is from stdlib's http module.\r\nAnd 10ms is from chardet. 6ms from cgi...\r\n\r\n```\r\n(After removed pyOpenSSL)\r\n$ time py37/bin/python -c 'import requests'\r\n\r\nreal 0m0.115s\r\nuser 0m0.112s\r\nsys 0m0.004s\r\n\r\n$ time py37/bin/python -c 'import http.client, http.cookies, http.cookiejar, cgi, chardet'\r\n\r\nreal 0m0.081s\r\nuser 0m0.065s\r\nsys 0m0.016s\r\n```",
"@lgommans I appreciate that you feel that it's unacceptable. Repeating that sentiment, however, simply won't magically make it faster. If you have something constructive to contribute, by all means continue. If you're going to keep repeating yourself, however, I'd like to point out that there are 1,274 people all getting notifications (of some sort, some including email) about your opinions on the matter. I'm going to take a guess and say that they now have a firm understanding of your position.",
"@sigmavirus24 The new information I was trying to add was an actual number, which wasn't posted before in this thread. Doing this in fact revealed that my case is exceptionally slow, so if it turns out not to be an isolated issue, you now have someone to ask in case you want to have someone run tests on such a system.\r\n\r\nI appreciate that you feel this was not worth reading for over a thousand people. There aren't a thousand comments so I didn't think to check, but there are actually 4 other participants mentioned on top. Even had I thought of it, I could not have known that >1000 people receive a CC of this. This concept is new to me (whatever concept this is, anyway). Sorry for that. I guess I'll refrain from trying to participate in this project any further because I might be inadvertently talking to thousands of hidden people at the same time, who will become annoyed at getting a natural conversation copied over to their inbox and will post snarky remarks rather than reaching out privately (as to not spam those people further) and letting me know (not in front of the whole group) that there is something I am unaware of. I'm going to take a guess and say you're not aware of how your comment might make people (who come across this thread, let alone to whom it was directed) think twice about adding something that they think is valuable but might, perhaps, not be worth reading for over a thousand people which may or may not be getting it in their inbox.",
"We've removed the mandatory requirement on two of the heaviest libraries in our dependency tree (pyOpenSSL and idna). If import time is still not up to standards we should reopen a new issue investigating the latest performance."
] |
https://api.github.com/repos/psf/requests/issues/4314
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4314/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4314/comments
|
https://api.github.com/repos/psf/requests/issues/4314/events
|
https://github.com/psf/requests/issues/4314
| 261,836,356 |
MDU6SXNzdWUyNjE4MzYzNTY=
| 4,314 |
In reponse, jQuery****({...});
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/20521264?v=4",
"events_url": "https://api.github.com/users/kimyoungjin06/events{/privacy}",
"followers_url": "https://api.github.com/users/kimyoungjin06/followers",
"following_url": "https://api.github.com/users/kimyoungjin06/following{/other_user}",
"gists_url": "https://api.github.com/users/kimyoungjin06/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kimyoungjin06",
"id": 20521264,
"login": "kimyoungjin06",
"node_id": "MDQ6VXNlcjIwNTIxMjY0",
"organizations_url": "https://api.github.com/users/kimyoungjin06/orgs",
"received_events_url": "https://api.github.com/users/kimyoungjin06/received_events",
"repos_url": "https://api.github.com/users/kimyoungjin06/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kimyoungjin06/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kimyoungjin06/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kimyoungjin06",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-09-30T10:51:02Z
|
2021-09-08T06:00:41Z
|
2017-09-30T11:02:42Z
|
NONE
|
resolved
|
Summary.
## Expected Result
I expected to return this form.
{"success":true,"code":"1000",...}
## Actual Result
I return this form with request.get()
jQuery1708155690935019391_1506579003758({"success":true,"code":"1000",...});
## Reproduction Steps
```python
url = 'https://apis.naver.com/commentBox/cbox/web_naver_list_jsonp.json?ticket=news&templateId=default_society&pool=cbox5&_callback=jQuery1708155690935019391_1506579003758&lang=ko&country=&objectId=news032%2C0002793071&categoryId=&pageSize=20&indexSize=10&groupId=&listType=OBJECT&page=1&initialize=true&userType=&useAltSort=true&replyPageSize=20&moveTo=&sort=favorite&includeAllStatus=true&_=1506579003809'
header = {
"Referer": 'http://www.naver.com' # The referer means my access was from this referer. In this case, referer can be any site from naver
}
res = rq.get(url, headers = header)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.9"
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.6.2"
},
"platform": {
"release": "4.4.0-51-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "100020bf",
"version": "17.2.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4314/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4314/timeline
| null |
completed
| null | null | false |
[
"@kimyoungjin06, the endpoint you're hitting seems to be returning exactly what you're asking for, a JSON dataset wrapped in a callback function (`jQuery1708155690935019391_1506579003758`) which you have declared in the URL parameters. You'll receive the same result if you perform this request with another tool like curl.\r\n\r\nI'm closing this since it's not a Requests issue."
] |
https://api.github.com/repos/psf/requests/issues/4313
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4313/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4313/comments
|
https://api.github.com/repos/psf/requests/issues/4313/events
|
https://github.com/psf/requests/issues/4313
| 261,824,991 |
MDU6SXNzdWUyNjE4MjQ5OTE=
| 4,313 |
Importing requests takes additional 13MB, more than doubling Python's mem usage
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/731464?v=4",
"events_url": "https://api.github.com/users/erezsh/events{/privacy}",
"followers_url": "https://api.github.com/users/erezsh/followers",
"following_url": "https://api.github.com/users/erezsh/following{/other_user}",
"gists_url": "https://api.github.com/users/erezsh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/erezsh",
"id": 731464,
"login": "erezsh",
"node_id": "MDQ6VXNlcjczMTQ2NA==",
"organizations_url": "https://api.github.com/users/erezsh/orgs",
"received_events_url": "https://api.github.com/users/erezsh/received_events",
"repos_url": "https://api.github.com/users/erezsh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/erezsh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/erezsh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/erezsh",
"user_view_type": "public"
}
|
[
{
"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 | 4 |
2017-09-30T07:17:33Z
|
2022-02-26T04:00:38Z
|
2021-11-28T03:05:00Z
|
NONE
|
resolved
|
Simple running:
import requests
In a new, blank process, raises memory consumption from ~11MB to ~24MB
## Expected Result
Even big libraries like Django raise it by less than 1MB
## Reproduction Steps
```python
import requests
```
:)
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.5.3"
},
"platform": {
"release": "4.10.13-200.fc25.x86_64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020bf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
(Note that pyopenssl doesn't seem to be the cause this time)
|
{
"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/4313/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4313/timeline
| null |
completed
| null | null | false |
[
"P.S. the same effect happens in Python 2",
"I've been looking into this, and it's about what you'd expect: 'requests' uses a lot of libraries, and some of them use a lot of memory.\r\n\r\n(In comparison, Django uses very few memory-hungry modules.)\r\n\r\nThe biggest offenders that I've found in 'requests':\r\n\r\n\r\n 1. urllib3 (> 6 MB)\r\n\r\nI know this one makes dealing with URLs and HTTP a million times easier, and there's no chance 'requests' will stop using it, but there could be sub-dependencies here that have memory optimization opportunities.\r\n\r\nFor example, 'urllib3' (eagerly) imports 'uuid', for creating unique boundaries when encoding multipart/form-data. The 'uuid' module adds almost 2 MB. Is there an alternative that could work? For example, plain 'random' is about half that size. Or import it lazily.\r\n\r\n\r\n 2. cgi (> 4 MB)\r\n\r\nThis is only used for one method (parse_header), which is about 20 lines of code.\r\n\r\nIdea: write our own. Requests doesn't even use the full parse output -- a regex that looked at two parts of the string could do the trick, I think.\r\n\r\n\r\n 3. chardet (> 3 MB)\r\n\r\nThis one seems to include a lot of character frequency tables. In the common case for 'requests' (where the server supplies a Content-Type), it's not even used.\r\n\r\nIdea: lazy load this, when needed. It seems to do some fancy runtime version checking in `__init__`, so I'm not sure what's involved here.\r\n\r\n\r\n### Regarding lazy loading:\r\n\r\nThe 'urllib3' module [lazy-loads 'idna'][idna]. It looks like [this was done][lazy] partially to allow ['requests' to lazy-load it, as well][reqlazy].\r\n\r\n[idna]: https://github.com/shazow/urllib3/pull/1076/files\r\n[lazy]: https://github.com/shazow/urllib3/issues/1075\r\n[reqlazy]: https://github.com/requests/requests/pull/3789\r\n\r\nThat work seems to have been undone. The 'requests' `__init__` now imports `packages`, which calls `__import__()` on 'idna' (and others).\r\n\r\nUnless I'm mistaken, that's no longer lazy. On my system, at least, the memory usage jumps quite a bit when I `import requests`, and then not at all when I `import idna` after that. When I `import urllib3`, and then `import idna`, I see another jump in memory usage, so it does seem to be lazy-loaded by urllib3 still.\r\n\r\nHas #3780 been regressed?\r\n",
"It looks like #4442 and shazow/urllib3#1270 help mitigate the uuid and cgi issues.\r\n\r\nAs for IDNA, when we unvendored our dependencies, we added a \"symlink\" of sorts in packages.py. We now auto import our formerly vendored packages to allow things like `import requests.packages.idna` to continue working. This is what's causing idna to be imported unconditionally. I don't immediately see a good solution to maintain this linking and the lazy load functionality of #3780. We may have to wait till 3.0.0 to break that API.",
"We've removed the mandatory requirement on two of the heaviest libraries in our dependency tree (pyOpenSSL and idna). If import time is still not up to standards we should reopen a new issue investigating the latest performance."
] |
https://api.github.com/repos/psf/requests/issues/4312
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4312/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4312/comments
|
https://api.github.com/repos/psf/requests/issues/4312/events
|
https://github.com/psf/requests/issues/4312
| 261,759,004 |
MDU6SXNzdWUyNjE3NTkwMDQ=
| 4,312 |
Connecting from HTTPAdapter: Forbidden: Access is denied
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/25555558?v=4",
"events_url": "https://api.github.com/users/edsonitk/events{/privacy}",
"followers_url": "https://api.github.com/users/edsonitk/followers",
"following_url": "https://api.github.com/users/edsonitk/following{/other_user}",
"gists_url": "https://api.github.com/users/edsonitk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/edsonitk",
"id": 25555558,
"login": "edsonitk",
"node_id": "MDQ6VXNlcjI1NTU1NTU4",
"organizations_url": "https://api.github.com/users/edsonitk/orgs",
"received_events_url": "https://api.github.com/users/edsonitk/received_events",
"repos_url": "https://api.github.com/users/edsonitk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/edsonitk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/edsonitk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/edsonitk",
"user_view_type": "public"
}
|
[
{
"color": "f7c6c7",
"default": false,
"description": null,
"id": 167537670,
"name": "Propose Close",
"node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=",
"url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close"
},
{
"color": "fef2c0",
"default": false,
"description": null,
"id": 298537994,
"name": "Needs More Information",
"node_id": "MDU6TGFiZWwyOTg1Mzc5OTQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Needs%20More%20Information"
}
] |
closed
| true | null |
[] | null | 4 |
2017-09-29T20:17:05Z
|
2021-09-08T04:00:53Z
|
2018-01-13T21:21:15Z
|
NONE
|
resolved
|
I'm trying to connect with certificate via HTTPAdapter, but the server always returns me error: 403 - Forbidden: Access is denied. This is the code:
```
class DESAdapter (HTTPAdapter):
def __init __ (self, cert=None, key=None):
self.cert_file = cert
self.key_file = key
super (DESAdapter, self) .__ init __ ()
def init_poolmanager (self, connections, maxsize, block = False):
self.poolmanager = poolmanager.PoolManager (
num_pools = connections, maxsize = maxsize,
block = block,
cert_file = self.cert_file,
key_file = self.key_file)
con = requests.Session ()
Adapter = DESAdapter (cert = certi, key = key)
con.mount (self.url, Adapter)
res = con.post ('url', data = 'xml_soap', verify = False, headers = 'header')
```
If you try without `HTTPAdapter()`, as the code below, then it works:
```
res = requests.post ('url', data = 'xml_soap', cert = (cert_path, key_path)
verify = False, headers = 'header')
```
|
{
"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/4312/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4312/timeline
| null |
completed
| null | null | false |
[
"Please provide us with the output of\r\n\r\n```\r\npython -m requests.help\r\n```\r\n\r\nIf that is unavailable on your version of Requests please provide some basic information about your system (Python version, operating system, etc).",
"{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"1.7.1\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"2.7.10\"\r\n },\r\n \"platform\": {\r\n \"release\": \"XP\",\r\n \"system\": \"Windows\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"100020af\",\r\n \"version\": \"16.2.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1000201f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n },\r\n \"using_pyopenssl\": true\r\n}",
"Hi,\r\nI am having the same problem with HTTPAdapter.\r\nForbidden: Access is denied",
"Hi there! Upon furthur review of this issue, 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/4311
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4311/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4311/comments
|
https://api.github.com/repos/psf/requests/issues/4311/events
|
https://github.com/psf/requests/issues/4311
| 261,607,211 |
MDU6SXNzdWUyNjE2MDcyMTE=
| 4,311 |
[bug]request http over https proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2764106?v=4",
"events_url": "https://api.github.com/users/foxundermoon/events{/privacy}",
"followers_url": "https://api.github.com/users/foxundermoon/followers",
"following_url": "https://api.github.com/users/foxundermoon/following{/other_user}",
"gists_url": "https://api.github.com/users/foxundermoon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/foxundermoon",
"id": 2764106,
"login": "foxundermoon",
"node_id": "MDQ6VXNlcjI3NjQxMDY=",
"organizations_url": "https://api.github.com/users/foxundermoon/orgs",
"received_events_url": "https://api.github.com/users/foxundermoon/received_events",
"repos_url": "https://api.github.com/users/foxundermoon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/foxundermoon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/foxundermoon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/foxundermoon",
"user_view_type": "public"
}
|
[
{
"color": "fef2c0",
"default": false,
"description": null,
"id": 298537994,
"name": "Needs More Information",
"node_id": "MDU6TGFiZWwyOTg1Mzc5OTQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Needs%20More%20Information"
}
] |
closed
| true | null |
[] | null | 4 |
2017-09-29T11:04:37Z
|
2021-09-08T06:00:38Z
|
2017-10-07T09:34:00Z
|
NONE
|
resolved
|
`python 2.7.13`
`requests v2.18.4`
request http website over https proxy always failure.
the proxy is checked pass by `http_proxy=https://ip:port curl ip.sb`
```python
import requests
proxies={'http':'https://proxyhost'}
requests.get('http://targeturl' , proxies=proxies)
```
but request http over https proxy
```python
import requests
proxies={'https':'https://proxyhost'}
requests.get('https://targeturl' , proxies=proxies)
```
it's ok
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4311/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4311/timeline
| null |
completed
| null | null | false |
[
"Please provide us with the output of \r\n\r\n```\r\npython -m requests.help\r\n```",
"```\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n }, \r\n \"cryptography\": {\r\n \"version\": \"2.0.3\"\r\n }, \r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n }, \r\n \"implementation\": {\r\n \"name\": \"CPython\", \r\n \"version\": \"2.7.13\"\r\n }, \r\n \"platform\": {\r\n \"release\": \"16.5.0\", \r\n \"system\": \"Darwin\"\r\n }, \r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010006f\", \r\n \"version\": \"17.2.0\"\r\n }, \r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n }, \r\n \"system_ssl\": {\r\n \"version\": \"100020cf\"\r\n }, \r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n }, \r\n \"using_pyopenssl\": true\r\n}\r\n\r\n```",
"Requests does not support HTTPS proxies, so whatever happens here is going to be almost random. ",
"@Lukasa So what kind of library can I use to replace it?"
] |
https://api.github.com/repos/psf/requests/issues/4310
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4310/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4310/comments
|
https://api.github.com/repos/psf/requests/issues/4310/events
|
https://github.com/psf/requests/issues/4310
| 261,566,506 |
MDU6SXNzdWUyNjE1NjY1MDY=
| 4,310 |
SSLError: SOCKSHTTPSConnectionPool(host='www.google.com', port=443)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22742052?v=4",
"events_url": "https://api.github.com/users/wkatios/events{/privacy}",
"followers_url": "https://api.github.com/users/wkatios/followers",
"following_url": "https://api.github.com/users/wkatios/following{/other_user}",
"gists_url": "https://api.github.com/users/wkatios/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wkatios",
"id": 22742052,
"login": "wkatios",
"node_id": "MDQ6VXNlcjIyNzQyMDUy",
"organizations_url": "https://api.github.com/users/wkatios/orgs",
"received_events_url": "https://api.github.com/users/wkatios/received_events",
"repos_url": "https://api.github.com/users/wkatios/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wkatios/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wkatios/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wkatios",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2017-09-29T08:23:35Z
|
2021-09-01T00:11:37Z
|
2018-05-20T19:28:03Z
|
NONE
|
resolved
|
Open a new issue is to facilitate the view, because #4272 too long.
maybe it can help other people
we know uses socks5 need install
`pip install requests[socks]`
when i use
`pip install --upgrade requests[socks]`
```
import reqeusts
proxies = {'http': 'socks5://127.0.0.1:1080', 'https': 'socks5://127.0.0.1:1080'}
r= requests.get(url,proxies=proxies)
```
failed
`SSLError: SOCKSHTTPSConnectionPool(host='www.google.com', port=443)......`
I use
`pip install -U requests[socks]==2.12.0`
it works,not error infonation.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4310/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4310/timeline
| null |
completed
| null | null | false |
[
"I meet the same error today. Oddly, the error didn't appear when I setup the same programe tomorrow. ",
"Please provide us with the output of\r\n\r\n```\r\npython -m requests.help\r\n```\r\n\r\nIf that is unavailable on your version of Requests please provide some basic information about your system (Python version, operating system, etc).",
"See also https://github.com/requests/requests/issues/4272#issuecomment-345642450, try using `socks5h` instead of `socks5`",
"This does appear to be related to incorrect use of the socks5 vs socks5h scheme. Since we haven't had a response to the requested information in a few months, I'm closing this out. Please feel free to reopen if you have more information. Thanks!",
"> See also [#4272 (comment)](https://github.com/psf/requests/issues/4272#issuecomment-345642450), try using `socks5h` instead of `socks5`\r\n\r\nwow thanks!"
] |
https://api.github.com/repos/psf/requests/issues/4309
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4309/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4309/comments
|
https://api.github.com/repos/psf/requests/issues/4309/events
|
https://github.com/psf/requests/issues/4309
| 261,346,365 |
MDU6SXNzdWUyNjEzNDYzNjU=
| 4,309 |
Warn about possible slowness when using an older version of pyOpenSSL
|
{
"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 |
2017-09-28T14:48:42Z
|
2021-09-08T04:00:46Z
|
2018-01-23T16:11:55Z
|
NONE
|
resolved
|
[This](https://github.com/requests/requests/issues/4278#issuecomment-329516221) comment on #4278 suggests warning about possible slowness for older versions of pyOpenSSL.
I'd love to work on this, I'm just not sure which versions to warn about and would love input from some developers more experienced with the library.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4309/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4309/timeline
| null |
completed
| null | null | false |
[
"So I think @Lukasa or @sigmavirus24 may have a more definitive answer to this, but it looks like `PyOpenSSL 16.0.0` was when the `Cryptography>=1.0` requirement was put in place. From my understanding that's when the speed ups were implemented.\r\n\r\nWe already require `Cryptography>=1.3.4` in both Requests and urllib3 though, so users entering this state are installing the PyOpenSSL requirement from another package. If we implement a warning, I think we should first check that PyOpenSSL is installed, and then if cryptography's version is less than 1.3.4. ",
">so users entering this state are installing the PyOpenSSL requirement from another package. If we implement a warning, I think we should first check that PyOpenSSL is installed\r\n\r\nJust to be clear, do you mean check that the OpenSSL module is available, or check specifically that the module is pyOpenSSL?",
"@PrimordialHelios, I *believe* that PyOpenSSL is sufficient (and much easier to check). We don't import or use cryptography directly in Requests, so the urllib3 pyopenssl contrib module should be our only point of contact.",
"This should be resolved with #4332 merged. Thanks again @PrimordialHelios!"
] |
https://api.github.com/repos/psf/requests/issues/4308
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4308/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4308/comments
|
https://api.github.com/repos/psf/requests/issues/4308/events
|
https://github.com/psf/requests/issues/4308
| 260,546,828 |
MDU6SXNzdWUyNjA1NDY4Mjg=
| 4,308 |
request.get params change
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22809651?v=4",
"events_url": "https://api.github.com/users/kalinlau/events{/privacy}",
"followers_url": "https://api.github.com/users/kalinlau/followers",
"following_url": "https://api.github.com/users/kalinlau/following{/other_user}",
"gists_url": "https://api.github.com/users/kalinlau/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kalinlau",
"id": 22809651,
"login": "kalinlau",
"node_id": "MDQ6VXNlcjIyODA5NjUx",
"organizations_url": "https://api.github.com/users/kalinlau/orgs",
"received_events_url": "https://api.github.com/users/kalinlau/received_events",
"repos_url": "https://api.github.com/users/kalinlau/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kalinlau/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kalinlau/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kalinlau",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-09-26T09:05:37Z
|
2021-09-08T06:00:41Z
|
2017-09-26T14:07:15Z
|
NONE
|
resolved
|
I use` requests.get` to do some web scraping and one key of params, which shows below, changes strangely.
Where is the "25" from? Does it come from the sys environment or language set? Thanks ~
## Expected Result
the `r.url` is
```
'http://www.shufaziti.com/?char=%E7%BA%B5&size=96&forecolor=0&backcolor=0&radio=0'
```
## Actual Result
the `r.url` is
```
'http://www.shufaziti.com/?char=%25E7%25BA%25B5&size=96&forecolor=0&backcolor=0&radio=0'
```
## Reproduction Steps
```python
import requests
web = "http://www.shufaziti.com/"
key = {"zong":"%E7%BA%B5", "xia":"%E4%B8%8B"}
shkey = {"char": key["zong"], "size": "96", "forecolor": "0", "backcolor": "0", "radio": "0"}
r = requests.get(web, params=shkey)
```
## System Information
```
Windows10(64-bit)
Python 3.6.2 | Anaconda custom(64-bit)
Requests version: 2.14.2
```
|
{
"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/4308/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4308/timeline
| null |
completed
| null | null | false |
[
"When you specify `params=` we URL encode the parameters to ensure they're safe. You already have them url-encoded, however, so we're urlencoding the `%` signs as `%25` to make them urlsafe. I can't recall if we've changed this behaviour in newer versions (I think we merely ensure we don't encode something we've already encoded) but you can fix this now by unencoding those parameters yourself before passing them to us.\r\n\r\nCheers,\r\nIan",
"@sigmavirus24 Thanks, and btw how to unencoding by hand?",
"@limTeTE google `urlquote` and `unquote` with the version of Python you're using."
] |
https://api.github.com/repos/psf/requests/issues/4307
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4307/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4307/comments
|
https://api.github.com/repos/psf/requests/issues/4307/events
|
https://github.com/psf/requests/pull/4307
| 260,427,023 |
MDExOlB1bGxSZXF1ZXN0MTQyOTkzNTQy
| 4,307 |
add library authors instructions for depending on requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/413772?v=4",
"events_url": "https://api.github.com/users/graingert/events{/privacy}",
"followers_url": "https://api.github.com/users/graingert/followers",
"following_url": "https://api.github.com/users/graingert/following{/other_user}",
"gists_url": "https://api.github.com/users/graingert/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/graingert",
"id": 413772,
"login": "graingert",
"node_id": "MDQ6VXNlcjQxMzc3Mg==",
"organizations_url": "https://api.github.com/users/graingert/orgs",
"received_events_url": "https://api.github.com/users/graingert/received_events",
"repos_url": "https://api.github.com/users/graingert/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/graingert/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/graingert/subscriptions",
"type": "User",
"url": "https://api.github.com/users/graingert",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-09-25T21:54:03Z
|
2023-04-21T15:10:21Z
|
2017-09-26T14:04:19Z
|
CONTRIBUTOR
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4307/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4307/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4307.diff",
"html_url": "https://github.com/psf/requests/pull/4307",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4307.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4307"
}
| true |
[
"Why are we adding this? It’s a bit of a surprise to find we need to document how versions work. ",
"I agree with @Lukasa. It's not our responsibility to teach users to responsibly use their dependencies. It's also not in our best interest to tell users to cap themselves at version 3."
] |
|
https://api.github.com/repos/psf/requests/issues/4306
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4306/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4306/comments
|
https://api.github.com/repos/psf/requests/issues/4306/events
|
https://github.com/psf/requests/issues/4306
| 260,041,224 |
MDU6SXNzdWUyNjAwNDEyMjQ=
| 4,306 |
urllib3.exceptions.InvalidHeader exception leak
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2237894?v=4",
"events_url": "https://api.github.com/users/piotrjurkiewicz/events{/privacy}",
"followers_url": "https://api.github.com/users/piotrjurkiewicz/followers",
"following_url": "https://api.github.com/users/piotrjurkiewicz/following{/other_user}",
"gists_url": "https://api.github.com/users/piotrjurkiewicz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/piotrjurkiewicz",
"id": 2237894,
"login": "piotrjurkiewicz",
"node_id": "MDQ6VXNlcjIyMzc4OTQ=",
"organizations_url": "https://api.github.com/users/piotrjurkiewicz/orgs",
"received_events_url": "https://api.github.com/users/piotrjurkiewicz/received_events",
"repos_url": "https://api.github.com/users/piotrjurkiewicz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/piotrjurkiewicz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/piotrjurkiewicz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/piotrjurkiewicz",
"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"
}
| 3 |
2017-09-23T21:54:58Z
|
2021-12-01T08:00:27Z
|
2021-08-27T01:17:24Z
|
CONTRIBUTOR
|
resolved
|
In some cases `urlib3.exceptions.InvalidHeader` exception is not being replaced with `requests.InvalidHeader` and leaks.
## Expected Result
Raise `requests.exceptions.InvalidHeader(RequestException, ValueError)`.
## Actual Result
`urllib3.exceptions.InvalidHeader` is raised.
## Stack trace
```
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 515, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 616, in urlopen
**response_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 467, in from_httplib
**response_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 155, in __init__
self.length_remaining = self._init_length(request_method)
File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 229, in _init_length
"unmatching values (%s)" % length)
exception.type: InvalidHeader
exception.value: Content-Length contained multiple unmatching values (0, 9929)
```
## System Information
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "2.7.14"
},
"platform": {
"release": "4.12.0-2-amd64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.1"
},
"system_ssl": {
"version": "1010006f"
},
"urllib3": {
"version": "1.21.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/4306/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4306/timeline
| null |
completed
| null | null | false |
[
"Thanks for opening this issue, @piotrjurkiewicz! It does seem like we should try to wrap this in the Requests exception namespace. It looks like the HTTPError funnel in adapters.py raises everything it doesn't recognize [here](https://github.com/requests/requests/blob/5eb0811ef82244afbcd865a19b796a76cdecfd71/requests/adapters.py#L523). There are actually a few newer exceptions from urllib3 I'm not sure we're accounting for in this case.\r\n\r\nI'm not positive what the best approach is since we'll end up with an increasingly growing exception conditional list if urllib3 continues to add more exceptions. Alternatively, we could return a more generic wrapper exception but that'll likely make debugging harder. I'm sure one of the other maintainers will have a leaning on which direction to go here.",
"Same here. Recieving an exception in console:\r\n\r\n```\r\nurllib3.exceptions.InvalidHeader: Content-Length contained multiple unmatching values (1526, 4578)\r\n```",
"Resolved in #5914."
] |
https://api.github.com/repos/psf/requests/issues/4305
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4305/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4305/comments
|
https://api.github.com/repos/psf/requests/issues/4305/events
|
https://github.com/psf/requests/pull/4305
| 260,038,037 |
MDExOlB1bGxSZXF1ZXN0MTQyNzI5MTU2
| 4,305 |
Fix the invalid restructured text in HISTORY file
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
[] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
] | null | 2 |
2017-09-23T20:55:39Z
|
2021-09-04T00:06:48Z
|
2017-09-23T21:21:49Z
|
CONTRIBUTOR
|
resolved
|
This was breaking the display of our long_description on PyPI.
|
{
"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/4305/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4305/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4305.diff",
"html_url": "https://github.com/psf/requests/pull/4305",
"merged_at": "2017-09-23T21:21:49Z",
"patch_url": "https://github.com/psf/requests/pull/4305.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4305"
}
| true |
[
"It may be worth, in the future, moving the changelog out of our long description. Flake8 has done this to great effect and made the Changelog far more navigable.",
"This is presently failing because of https://github.com/kennethreitz/httpbin/issues/380 which I'm working on a fix for."
] |
https://api.github.com/repos/psf/requests/issues/4304
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4304/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4304/comments
|
https://api.github.com/repos/psf/requests/issues/4304/events
|
https://github.com/psf/requests/issues/4304
| 260,031,541 |
MDU6SXNzdWUyNjAwMzE1NDE=
| 4,304 |
Attempting to send struct packed binary data over requests
|
{
"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 | 1 |
2017-09-23T19:07:55Z
|
2021-09-08T06:00:42Z
|
2017-09-23T19:12:08Z
|
NONE
|
resolved
|
I attempted to send struct-packed binary data over your lib, failed for me. I placed it in the cookie header, as what im doing requires it to be.
For some strange reason, it said connection refused
|
{
"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/4304/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4304/timeline
| null |
completed
| null | null | false |
[
"This does not seem to be a bug in requests, but instead a question better suited for [StackOverflow](https://stackoverflow.com/questions/tagged/python-requests). Please instead direct this and all future questions there."
] |
https://api.github.com/repos/psf/requests/issues/4303
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4303/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4303/comments
|
https://api.github.com/repos/psf/requests/issues/4303/events
|
https://github.com/psf/requests/issues/4303
| 260,022,722 |
MDU6SXNzdWUyNjAwMjI3MjI=
| 4,303 |
Possible to remove some headers?
|
{
"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 | 1 |
2017-09-23T17:12:29Z
|
2021-09-08T06:00:42Z
|
2017-09-23T17:17:12Z
|
NONE
|
resolved
|
Would it be possible to remove some headers from a POST request, ie for example connection, Accept-Encoding, Accept */*. Unfortunately, writing an exploit and unable to continue unless these headers have been removed strangely enough.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4303/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4303/timeline
| null |
completed
| null | null | false |
[
"Requests does not support the removal of arbitrary headers. It is possible to remove *some* by using the [PreparedRequest flow](http://docs.python-requests.org/en/master/user/advanced/#prepared-requests), but this will not cover all headers."
] |
https://api.github.com/repos/psf/requests/issues/4302
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4302/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4302/comments
|
https://api.github.com/repos/psf/requests/issues/4302/events
|
https://github.com/psf/requests/pull/4302
| 259,891,132 |
MDExOlB1bGxSZXF1ZXN0MTQyNjM1NzA4
| 4,302 |
Update no_proxy logic to handle user:password@ in the url.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4935304?v=4",
"events_url": "https://api.github.com/users/bobh66/events{/privacy}",
"followers_url": "https://api.github.com/users/bobh66/followers",
"following_url": "https://api.github.com/users/bobh66/following{/other_user}",
"gists_url": "https://api.github.com/users/bobh66/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bobh66",
"id": 4935304,
"login": "bobh66",
"node_id": "MDQ6VXNlcjQ5MzUzMDQ=",
"organizations_url": "https://api.github.com/users/bobh66/orgs",
"received_events_url": "https://api.github.com/users/bobh66/received_events",
"repos_url": "https://api.github.com/users/bobh66/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bobh66/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bobh66/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bobh66",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-09-22T17:56:57Z
|
2021-09-03T00:11:03Z
|
2018-04-29T19:10:43Z
|
NONE
|
resolved
|
Also updated tests to include user@ and user@password: scenarios
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4302/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4302/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4302.diff",
"html_url": "https://github.com/psf/requests/pull/4302",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4302.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4302"
}
| true |
[
"It looks like this ended up getting resolved in #4427, so I'm going to close this out. Thanks for the PR @bobh66!"
] |
https://api.github.com/repos/psf/requests/issues/4301
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4301/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4301/comments
|
https://api.github.com/repos/psf/requests/issues/4301/events
|
https://github.com/psf/requests/issues/4301
| 259,807,770 |
MDU6SXNzdWUyNTk4MDc3NzA=
| 4,301 |
Sessions apparently corrupting header values on subsequent requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3287067?v=4",
"events_url": "https://api.github.com/users/asieira/events{/privacy}",
"followers_url": "https://api.github.com/users/asieira/followers",
"following_url": "https://api.github.com/users/asieira/following{/other_user}",
"gists_url": "https://api.github.com/users/asieira/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/asieira",
"id": 3287067,
"login": "asieira",
"node_id": "MDQ6VXNlcjMyODcwNjc=",
"organizations_url": "https://api.github.com/users/asieira/orgs",
"received_events_url": "https://api.github.com/users/asieira/received_events",
"repos_url": "https://api.github.com/users/asieira/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/asieira/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/asieira/subscriptions",
"type": "User",
"url": "https://api.github.com/users/asieira",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 8 |
2017-09-22T13:02:09Z
|
2021-09-08T03:00:43Z
|
2018-02-24T14:59:28Z
|
CONTRIBUTOR
|
resolved
|
After reading http://docs.python-requests.org/en/master/user/advanced/#session-objects I tried setting request headers on a session to ensure that all requests made using that session object would include those headers with their values unchanged. However, I am running into a strange corruption issue that I would like to share with you.
## Expected Result
That the `X-Api-Key` header I set on the session would be correctly sent to the server, unchanged, on all requests made using the session object.
## Actual Result
For some reason, the value of the `X-Api-Key` header is being changed and causing a 401 error when authenticating to the API endpoint I am trying to contact.
## Reproduction Steps
```python
import requests
print requests.__version__
s = requests.Session()
s.headers.update({
"X-Api-Key": '<redacted>TU=',
"Accept-Encoding": "gzip, deflate",
"User-Agent": "magnet-sdk-python",
"Accept": "application/json"
})
response = s.request('GET', 'https://api.niddel.com/v2/me')
print response.status_code
response = s.request('GET', 'https://api.niddel.com/v2/me')
print response.status_code
```
The expected output for this is:
```
2.18.4
200
200
```
What I consistently get instead is:
```
2.18.4
200
401
```
More importantly, on the server-side logs I enabled logging of the first and last few characters of the API key for troubleshooting purposes. On the first case, they match the (valid) API key I wrote on the test code. In the failed request, the last few characters inexplicably changed from `xTU=` to `+w==`.
So for some reason the `X-Api-Key` header contents are being corrupted on the 2nd and later requests of a session. Curiously enough, the same thing does not happen if I perform completely separate requests:
```
import requests
headers = {"X-Api-Key": '<redacted>TU=',
"Accept-Encoding": "gzip, deflate",
"User-Agent": "magnet-sdk-python",
"Accept": "application/json"}
response = requests.request('GET', 'https://api.niddel.com/v2/me', headers=headers)
print response.status_code
response = requests.request('GET', 'https://api.niddel.com/v2/me', headers=headers)
print response.status_code
```
Which gives me two 200 status codes, as expected.
I thought long and hard about whether this could be a server-side error related to multiple requests on persistent connections. But I have plenty of code that uses libcurl and also does requests like these using persistent connections at a large scale, and this error never manifested itself. So I am thinking this might be an issue on requests (or perhaps urllib3).
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "2.7.10"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "9081df"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/psf/requests/issues/4301/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4301/timeline
| null |
completed
| null | null | false |
[
"This is an example using the [R binding for libcurl](https://cran.r-project.org/web/packages/curl/index.html) that consistently works as intended:\r\n```\r\n> library(curl)\r\n> h <- new_handle()\r\n> handle_setheaders(h, \"X-Api-Key\" = \"<redacted>tTU=\", \"Accept-Encoding\" = \"gzip, deflate\", \"User-Agent\" = \"magnet-sdk-R\", \"Accept\" = \"application/json\")\r\n> curl_fetch_memory(\"https://api.niddel.com/v2/me\", h)$status\r\n[1] 200\r\n> curl_fetch_memory(\"https://api.niddel.com/v2/me\", h)$status\r\n[1] 200\r\n> curl_fetch_memory(\"https://api.niddel.com/v2/me\", h)$status\r\n[1] 200\r\n> curl_fetch_memory(\"https://api.niddel.com/v2/me\", h)$status\r\n[1] 200\r\n```",
"Does this reproduce if you change the host to `httpbin.org`?",
"Argh, heisenbug. Now I can't reproduce it even with my own API.\r\n\r\nThe weird thing, though, is that accessing https://httpbin.org/headers with a session, it tells me the request was sent with `Connection: close` which is unexpected if HTTP persistent connections are meant to be used.\r\n\r\n```\r\nimport requests\r\nimport json\r\n\r\nprint requests.__version__\r\n\r\ns = requests.Session()\r\ns.headers.update({\r\n \"X-Api-Key\": '1234567890123456789012345678901234567890123=',\r\n \"Accept-Encoding\": \"gzip, deflate\",\r\n \"User-Agent\": \"magnet-sdk-python\",\r\n \"Accept\": \"application/json\"\r\n})\r\n\r\nresponse = s.request('GET', 'https://httpbin.org/headers')\r\nprint response.status_code\r\nprint json.dumps(response.json(), indent=4)\r\nprint response.request.headers\r\n```\r\n\r\nWhich generates the following output:\r\n```\r\n2.18.4\r\n200\r\n{\r\n \"headers\": {\r\n \"Accept-Encoding\": \"gzip, deflate\", \r\n \"Host\": \"httpbin.org\", \r\n \"Accept\": \"application/json\", \r\n \"User-Agent\": \"magnet-sdk-python\", \r\n \"Connection\": \"close\", \r\n \"X-Api-Key\": \"1234567890123456789012345678901234567890123=\"\r\n }\r\n}\r\n{'Connection': 'keep-alive', 'X-Api-Key': '1234567890123456789012345678901234567890123=', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'User-Agent': 'magnet-sdk-python'}\r\n```\r\n\r\nI found it particularly interesting that response.request.headers had `Connection: keep-alive` but that was not what httpbin.org received. 🤔\r\n\r\nNow about the original problem, a few additional pieces of information:\r\n* I've seen this not only running directly from OS X, but also on a Docker container and a customer Linux machine. And the problem stopped after I stopped using sessions and hasn't recurred ever since (https://github.com/Niddel/magnet-api2-sdk-python/commit/47e2795b8bf88f1990106ed000b8fa8113a332ed);\r\n* Looking at the logs, the last digits of the actually submitted API key vary on each request, indicating this might be some sort of memory overrun or corruption issue somewhere along the line.",
"> The weird thing, though, is that accessing https://httpbin.org/headers with a session, it tells me the request was sent with `Connection: close` which is unexpected if HTTP persistent connections are meant to be used.\r\n\r\n`httpbin.org` will lie to you. :wink: It sits behind a reverse proxy or two, and they're the ones setting `Connection: close`. Wireshark will show you that we don't.\r\n\r\nIf there's a memory overrun issue it won't be in our library, but it could be in a dependency. It would be *very* interesting to see if you can pin down where it's coming from.",
"Ah, reverse proxies make sense indeed for the `Connection` header. Thank you for clarifying that.\r\n\r\nBTW I ran my test again and got the corruption again. Heisenbug FTW. :)\r\n\r\nI have a workaround that is working for me, will circle back to this issue when I can. But I wanted to document this here in case this pops up again from someone else, in which case it might help.\r\n\r\nAlso, keep in mind \"memory overrun\" was just a wildly uninformed speculation on my part. I'll leave you to determine if there's any chance that the requests code could be doing weird things with header contents or not.\r\n\r\nFinally, thanks one more time for the wonderful library, requests is just plain awesome. ❤️ ",
"I may be hitting this problem as well. Basically I do (pseudocode):\r\n\r\n```python\r\nurl = 'https://remote.com/v0/api'\r\nheaders = {'Authorization': 'Bearer <access_token>'}\r\n\r\nwhile True:\r\n\r\n client = requests.Session()\r\n client.headers.update(headers)\r\n client.stream = True\r\n\r\n response = client.get(url, params=params, timeout=timeout)\r\n\r\n if response.status_code != 200:\r\n time.delay(10)\r\n continue\r\n \r\n for line in response.iter_lines():\r\n if not line:\r\n continue\r\n process_line(line)\r\n```\r\n\r\nThis works all week just fine, but once in a week (on Monday morning), I start receiving this 401 response status codes non-stop (\"Insufficient authorization to perform request.\"). Now, if I kill the process and restart it it will work just fine (i.e.: no code change, same headers, same API URL, same params...).\r\n\r\nNote that I am actually creating a new `Session` after each failure, not reusing the old one.\r\n\r\nCould it be related to this issue? Do not know if it could be related to #2949 instead (or as well).\r\n\r\n@asieira Which workaround did you use?",
"@Peque my workaround was to not use sessions anymore, basically, as per https://github.com/Niddel/magnet-api2-sdk-python/commit/47e2795b8bf88f1990106ed000b8fa8113a332ed. Can you try doing the same and see if this solves your problem as well?",
"@Peque it looks like you shouldn't be actually running into this. You always create a new session and reconfigure the headers (based on that snippet).\r\n\r\nThere's not enough here to get to the bottom of the problem and I have code that works pretty much the same way as @asieira's without issue, so I'm going to close this. New information would be helpful but should be put into a new issue and reference this one."
] |
https://api.github.com/repos/psf/requests/issues/4300
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4300/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4300/comments
|
https://api.github.com/repos/psf/requests/issues/4300/events
|
https://github.com/psf/requests/issues/4300
| 259,716,044 |
MDU6SXNzdWUyNTk3MTYwNDQ=
| 4,300 |
response(200) always need to wait for 120 seconds
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10825713?v=4",
"events_url": "https://api.github.com/users/etiaxie/events{/privacy}",
"followers_url": "https://api.github.com/users/etiaxie/followers",
"following_url": "https://api.github.com/users/etiaxie/following{/other_user}",
"gists_url": "https://api.github.com/users/etiaxie/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/etiaxie",
"id": 10825713,
"login": "etiaxie",
"node_id": "MDQ6VXNlcjEwODI1NzEz",
"organizations_url": "https://api.github.com/users/etiaxie/orgs",
"received_events_url": "https://api.github.com/users/etiaxie/received_events",
"repos_url": "https://api.github.com/users/etiaxie/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/etiaxie/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/etiaxie/subscriptions",
"type": "User",
"url": "https://api.github.com/users/etiaxie",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-09-22T06:31:17Z
|
2021-09-08T06:00:42Z
|
2017-09-22T16:36:51Z
|
NONE
|
resolved
|
i use requests to send a HTTP request like this:

and the response like this:

and i always need to wait for 120s to get the response
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4300/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4300/timeline
| null |
completed
| null | null | false |
[
"The remote server is sending a HTTP response with no Content-length or Transfer-encoding chunked. This means that the server is saying \"the request body is complete when I close the connection\". Requests is doing the right thing and waiting for that connection close before it returns. The server should set content-length."
] |
https://api.github.com/repos/psf/requests/issues/4299
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4299/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4299/comments
|
https://api.github.com/repos/psf/requests/issues/4299/events
|
https://github.com/psf/requests/issues/4299
| 259,668,998 |
MDU6SXNzdWUyNTk2Njg5OTg=
| 4,299 |
'big5' encoding not detected
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/44229?v=4",
"events_url": "https://api.github.com/users/samuelclay/events{/privacy}",
"followers_url": "https://api.github.com/users/samuelclay/followers",
"following_url": "https://api.github.com/users/samuelclay/following{/other_user}",
"gists_url": "https://api.github.com/users/samuelclay/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/samuelclay",
"id": 44229,
"login": "samuelclay",
"node_id": "MDQ6VXNlcjQ0MjI5",
"organizations_url": "https://api.github.com/users/samuelclay/orgs",
"received_events_url": "https://api.github.com/users/samuelclay/received_events",
"repos_url": "https://api.github.com/users/samuelclay/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/samuelclay/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/samuelclay/subscriptions",
"type": "User",
"url": "https://api.github.com/users/samuelclay",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-09-22T00:20:45Z
|
2021-09-08T06:00:43Z
|
2017-09-22T16:35:19Z
|
NONE
|
resolved
|
See this feed: http://www.digitimes.com.tw/tech/rss/xml/xmlrss_10_0.xml
The top line of the feed is:
<?xml version="1.0" encoding="big5" ?>
But the detected encoding is iso-8859-1. It should be big5.
## Expected Result
r.encoding should be big5.
## Actual Result
r.encoding is iso-8859-1.
## Reproduction Steps
```python
>>> import requests
>>> r = requests.get('http://www.digitimes.com.tw/tech/rss/xml/xmlrss_10_0.xml')
>>> r.encoding
'ISO-8859-1'
>>> print r.text[900:1000]
xÆW¤Ó¶§¯à¹q¦À¤jÁp·ù¡A´Á¯à¶i¦æ¾ã¦X¡A¥Ø«e±À´ú¬ù¦³4®a¼t°Ó°Ñ»P¡A¥i¯à¥é·Ó¦´ÁÁp¹q°Æ¸³¨Æªø«Å©ú´¼¥l¶°²Õ¦¨¥x
>>> r.encoding = 'big5'
>>> print r.text[900:1000]
均三緘其口。即將跨入10月PV Taiwan年度展期,近期台太陽能市場熱鬧非凡,除了對模組聯盟最終拍板......]]></description>
<keyword><![CDATA[太陽能矽晶圓
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.6"
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.10"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "100020af",
"version": "16.2.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "9081df"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4299/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4299/timeline
| null |
completed
| null | null | false |
[
"We rely on `chardet` to determine the encoding of the content. Whatever `chardet` library says is what we auto-detect the content as.",
"Something strange is going on then...\r\n\r\n```\r\n>>> import chardet\r\n>>> chardet.__version__\r\n'3.0.4'\r\n>>> import urllib\r\n>>> r = urllib.urlopen(\"http://www.digitimes.com.tw/tech/rss/xml/xmlrss_10_0.xml\").read()\r\n>>> chardet.detect(r)\r\n{'confidence': 0.99, 'language': 'Chinese', 'encoding': 'Big5'}\r\n>>> requests.get('http://www.digitimes.com.tw/tech/rss/xml/xmlrss_10_0.xml').encoding\r\n'ISO-8859-1'\r\n```",
"I had something similar recently, so I decided to take a look.\r\n\r\nThe encoding that is selected for this response seems to be coming from `get_encoding_from_headers()` at https://github.com/requests/requests/blob/master/requests/utils.py#L428. Because the digitimes.com.tw's server returns a `Content-Type` with 'text' in its value (`text/xml`), `ISO-8859-1` is assumed.\r\n\r\nThe detected character set by `chardet` (`apparent_encoding`) is only used when no `encoding` has been set (before parsing the response content body?)\r\n\r\nOne solution would be to remove the assumption in `get_encoding_from_headers()`, but I don't know what consequences that would have.",
"This is covered by #2086. However, I should note that there is no way that Requests will ever look into the HTML: only that it will use chardet."
] |
https://api.github.com/repos/psf/requests/issues/4298
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4298/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4298/comments
|
https://api.github.com/repos/psf/requests/issues/4298/events
|
https://github.com/psf/requests/issues/4298
| 259,214,059 |
MDU6SXNzdWUyNTkyMTQwNTk=
| 4,298 |
Stop Requests.post from encoding the data field,
|
{
"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 | 10 |
2017-09-20T15:51:53Z
|
2021-09-08T06:00:43Z
|
2017-09-20T17:29:38Z
|
NONE
|
resolved
|
Hello,
I was wondering if it it is possible to stop requests from encoding the data field in a post request?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4298/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4298/timeline
| null |
completed
| null | null | false |
[
"I guess im saying in request body, in a post request.",
"Yes: just pass a string, not a dictionary. ",
"You mean data=\"cmd = blah\"",
"Yes. ",
"Just did that, getting \r\n```python\r\nTraceback (most recent call last):\r\n File \"command_php_exec_noauth.py\", line 9, in <module>\r\n req = requests.post(\"http://{}:{}/command.php\".format(args.target, args.port), data=\"cmd = ls -alt\")\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 112, in post\r\n return request('post', url, data=data, json=json, **kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 490, in send\r\n raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine(\"''\",))\r\n```",
"Just did that, getting \r\n```python\r\nTraceback (most recent call last):\r\n File \"command_php_exec_noauth.py\", line 9, in <module>\r\n req = requests.post(\"http://{}:{}/command.php\".format(args.target, args.port), data=\"cmd = ls -alt\")\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 112, in post\r\n return request('post', url, data=data, json=json, **kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 490, in send\r\n raise ConnectionError(err, request=request)\r\nrequests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine(\"''\",))\r\n```",
"That means the server is closing the connection in our face. Suggests a problem in the server code. ",
"Strange, shouldnt be if im essentially able to send the equivalent of this with curl and it works fine.",
"I take it its not possible to disable URL encoding for the data field?",
"Only using the method I mentioned. "
] |
https://api.github.com/repos/psf/requests/issues/4297
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4297/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4297/comments
|
https://api.github.com/repos/psf/requests/issues/4297/events
|
https://github.com/psf/requests/issues/4297
| 259,177,386 |
MDU6SXNzdWUyNTkxNzczODY=
| 4,297 |
Data request not working
|
{
"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 | 8 |
2017-09-20T14:09:27Z
|
2021-09-08T06:00:44Z
|
2017-09-20T14:55:33Z
|
NONE
|
resolved
|
Summary.
I was sending data via parameter, example :
```python
data = {'req': 'ls -alt'}
r = requests.post(url, data=data, headers=headers)
```
and such. for some reason, only when i send ls does it work, but ls -alt returns nothing. I did an echo server, and it claimed that it was an JSON object? so i tried json=data but it returned bad request on the target.```
## Expected Result
```
drwxr-xr-x 2 root root 4096 Sep blah 10:03 .
-rw-r--r-- 1 root root 558 Sep blah 10:03 file
-rw-r--r-- 1 root root 1555 Sep blah 16:16 file
drwxr-xr-x 4 root root 4096 Sep blah 19:11 ..
```
What you expected.
I expected a directory string to come forth, instead received nothing
## Actual Result
blank output on real test,
on echo server:
```
Exception happened during processing of request from ('127.0.0.1', 59256)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "echo.py", line 35, in do_POST
data = json.loads(post_body)
File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
```
doing it manually via curl produces the result i want:
```
curl --data "req=ls -alt" http://server:blah/req.php
```
produces :
```
drwxr-xr-x 2 root root 4096 Sep blah 10:03 .
-rw-r--r-- 1 root root 558 Sep blah 10:03 file
-rw-r--r-- 1 root root 1555 Sep blah 16:16 file
drwxr-xr-x 4 root root 4096 Sep blah 19:11 ..
```
as expected
----------------------------------------
What happened instead.
I got nothing on the real world object that i designed, and that error on my echo server.
## Reproduction Steps
```python
#!/usr/bin/env python
import requests
import argparse
import urllib
import socket
parser = argparse.ArgumentParser()
parser.add_argument("-t", help="target", dest="target", required=True)
parser.add_argument("-p", help="port", dest="port", required=True)
parser.add_argument("-c", help="command", dest="command", required=False, type=str)
args = parser.parse_args()
data = {'cmd': 'ls -alt'}
headers = {'User-Agent': 'send/1.0'}
print requests.post("http://{}:{}/recv.php".format(args.target, args.port), data=data, headers=headers).text
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "1.9"
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "2.7.13"
},
"platform": {
"release": "4.12.0-kali1-amd64",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "1010006f",
"version": "16.2.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1010006f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/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/4297/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4297/timeline
| null |
completed
| null | null | false |
[
"I updated your issue to correct your formatting. I'm not reading through it in earnest to see if we can understand the bug you're reporting.",
"So if I do:\r\n\r\n```\r\n$ curl --data 'foo=ls -alt' https://httpbin.org/post\r\n```\r\n\r\nI see\r\n\r\n```\r\n{\r\n \"args\": {}, \r\n \"data\": \"\", \r\n \"files\": {}, \r\n \"form\": {\r\n \"foo\": \"ls -alt\"\r\n }, \r\n \"headers\": {\r\n \"Accept\": \"*/*\", \r\n \"Connection\": \"close\", \r\n \"Content-Length\": \"11\", \r\n \"Content-Type\": \"application/x-www-form-urlencoded\", \r\n \"Host\": \"httpbin.org\", \r\n \"User-Agent\": \"curl/7.51.0\"\r\n }, \r\n \"json\": null, \r\n \"origin\": \"my-ip\", \r\n \"url\": \"https://httpbin.org/post\"\r\n}\r\n```\r\n\r\nIf I then do \r\n\r\n```py\r\nimport requests\r\nprint requests.post('https://httpbin.org/post', data={'foo': 'ls -alt'}).text\r\n```\r\n\r\nI see the same output:\r\n\r\n```py\r\n{\r\n \"args\": {}, \r\n \"data\": \"\", \r\n \"files\": {}, \r\n \"form\": {\r\n \"foo\": \"ls -alt\"\r\n }, \r\n \"headers\": {\r\n \"Accept\": \"*/*\", \r\n \"Accept-Encoding\": \"gzip, deflate\", \r\n \"Connection\": \"close\", \r\n \"Content-Length\": \"11\", \r\n \"Content-Type\": \"application/x-www-form-urlencoded\", \r\n \"Host\": \"httpbin.org\", \r\n \"User-Agent\": \"python-requests/2.13.0\"\r\n }, \r\n \"json\": null, \r\n \"origin\": \"my-input\", \r\n \"url\": \"https://httpbin.org/post\"\r\n}\r\n```\r\n\r\nThe only difference I see between your curl command Requests usage is the addition of a user-agent header. Does the server you're talking to care about the User-Agent header?\r\n\r\nFurther, when I specified `-v` to curl, I noticed it said it was uploading 11 bytes from `--data`. That means it might not have encoded the ` ` in the data. Requests will encode it. You can see the exact data Requests sends like so:\r\n\r\n```py\r\n>>> r = requests.post('https://httpbin.org/post', data={'foo': 'ls -alt'})\r\n>>> r.request.body\r\n'foo=ls+-alt'\r\n```\r\n\r\nSo perhaps the server you're talking to isn't unencoding it and that's the source of your problem. As far as I can tell this is not a bug in Requests.",
"Is it possible to stop encoding the data request?",
"a no user agent means nothing, its just there for randomeness",
"Cause the PHP script just takes the DATA request. the data request sent from requests is encoded, i dont want it to be.",
"Its wierd, i get nothing in response...",
"What you want is `requests.post(url, json=data)`",
"Just did that, now i get \"unsupported subtype : json\" :/"
] |
https://api.github.com/repos/psf/requests/issues/4296
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4296/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4296/comments
|
https://api.github.com/repos/psf/requests/issues/4296/events
|
https://github.com/psf/requests/issues/4296
| 258,860,307 |
MDU6SXNzdWUyNTg4NjAzMDc=
| 4,296 |
Still SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",) after enable 3DES
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/32092795?v=4",
"events_url": "https://api.github.com/users/wmj1238/events{/privacy}",
"followers_url": "https://api.github.com/users/wmj1238/followers",
"following_url": "https://api.github.com/users/wmj1238/following{/other_user}",
"gists_url": "https://api.github.com/users/wmj1238/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wmj1238",
"id": 32092795,
"login": "wmj1238",
"node_id": "MDQ6VXNlcjMyMDkyNzk1",
"organizations_url": "https://api.github.com/users/wmj1238/orgs",
"received_events_url": "https://api.github.com/users/wmj1238/received_events",
"repos_url": "https://api.github.com/users/wmj1238/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wmj1238/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wmj1238/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wmj1238",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-09-19T15:18:08Z
|
2021-09-08T06:00:44Z
|
2017-09-19T18:05:48Z
|
NONE
|
resolved
|
Summary.
When I use requests to crawl a url ,the cmd always show me bad handshake,and after I refer other solution,it doesn't make sense.The real reason is that the module requests cann't support 3DES
## Expected Result
The requests support 3DES algorithm.
## Actual Result
For the url using 3DES,the requests module cann't work.
## Reproduction Steps
```
import requests
response=requests.get("https://supply.zte.com.cn/UI/Web/Application/kxscm/kxsup_manager/Portal/index.aspx ")```
## System Information
```
Windows10 python3.6<paste here>
```
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4296/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4296/timeline
| null |
completed
| null | null | false |
[
"This is intentional: 3DES is insecure for bulk data transfer, and so we disabled it to help protect our users. You can re-enable it for specific hosts as [shown here](https://lukasa.co.uk/2017/02/Configuring_TLS_With_Requests/)."
] |
https://api.github.com/repos/psf/requests/issues/4295
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4295/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4295/comments
|
https://api.github.com/repos/psf/requests/issues/4295/events
|
https://github.com/psf/requests/pull/4295
| 258,311,166 |
MDExOlB1bGxSZXF1ZXN0MTQxNDkwNDU3
| 4,295 |
pipfile (work in progress)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2017-09-17T15:25:10Z
|
2021-09-04T00:06:49Z
|
2017-09-17T15:58:46Z
|
CONTRIBUTOR
|
resolved
|
Signed-off-by: Kenneth Reitz <[email protected]>
Pipenv has matured a *lot* since we were last using it — I think it's ready for prime time now.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4295/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4295/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4295.diff",
"html_url": "https://github.com/psf/requests/pull/4295",
"merged_at": "2017-09-17T15:58:46Z",
"patch_url": "https://github.com/psf/requests/pull/4295.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4295"
}
| true |
[
"this looks like it's working great except for 2.6 support — which requests should probably drop anyway. ",
"excellence! builds are working great :)",
"will merge once all green, here in a minute. ",
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4295?src=pr&el=h1) Report\n> Merging [#4295](https://codecov.io/gh/requests/requests/pull/4295?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/fdb9b753b47e7abead1ec75d860c9c9b929ca5f5?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4295?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4295 +/- ##\n=======================================\n Coverage 88.66% 88.66% \n=======================================\n Files 18 18 \n Lines 2021 2021 \n=======================================\n Hits 1792 1792 \n Misses 229 229\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4295?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4295?src=pr&el=footer). Last update [fdb9b75...28ae74d](https://codecov.io/gh/requests/requests/pull/4295?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"All Green! 💚 "
] |
https://api.github.com/repos/psf/requests/issues/4294
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4294/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4294/comments
|
https://api.github.com/repos/psf/requests/issues/4294/events
|
https://github.com/psf/requests/issues/4294
| 258,286,494 |
MDU6SXNzdWUyNTgyODY0OTQ=
| 4,294 |
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8908100?v=4",
"events_url": "https://api.github.com/users/thomaswpp/events{/privacy}",
"followers_url": "https://api.github.com/users/thomaswpp/followers",
"following_url": "https://api.github.com/users/thomaswpp/following{/other_user}",
"gists_url": "https://api.github.com/users/thomaswpp/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/thomaswpp",
"id": 8908100,
"login": "thomaswpp",
"node_id": "MDQ6VXNlcjg5MDgxMDA=",
"organizations_url": "https://api.github.com/users/thomaswpp/orgs",
"received_events_url": "https://api.github.com/users/thomaswpp/received_events",
"repos_url": "https://api.github.com/users/thomaswpp/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/thomaswpp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/thomaswpp/subscriptions",
"type": "User",
"url": "https://api.github.com/users/thomaswpp",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2017-09-17T07:45:49Z
|
2021-09-08T05:00:39Z
|
2017-12-26T17:11:12Z
|
NONE
|
resolved
|
Summary.
I'm on Mint 18.01 and I try requests in site https://www.sifge.caixa.gov.br/Cidadao/Crf/FgeCfSCriteriosPesquisa.asp, but not function.. I did download certificate in the firefox and then
I add certificate in /etc/ssl/cert with comand
```
sudo mkdir /usr/share/ca-certificates/extra
sudo cp WWWSIFGECAIXAGOVBR.crt /usr/share/ca-certificates/extra/WWWSIFGECAIXAGOVBR.crt
sudo dpkg-reconfigure ca-certificates
```
And then I add the variable at the end of the file ~/.bashrc
```
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt # ca-bundle.crt
export REQUESTS_CA_BUNDLE
```
And I executed command
```
source .bashrc
```
## Actual Result
```
During handling of the above exception, another exception occurred:
TrTraceback (most recent call last):
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 441, in wrap_socket
cnx.do_handshake()
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1716, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/OpenSSL/SSL.py", line 1449, in _raise_ssl_error
raise SysCallError(-1, "Unexpected EOF")
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
conn.connect()
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/urllib3/connection.py", line 326, in connect
ssl_context=context)
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/urllib3/contrib/pyopenssl.py", line 448, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/urllib3/util/retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.sifge.caixa.gov.br', port=443): Max retries exceeded with url: /Cidadao/Crf/FgeCfSCriteriosPesquisa.asp?ImportWorkEmpregadorCodigoInscricaoAlfanum=10778237%2F0001-51&ImportURL=..%2FCrf%2FFgeCfSConsultaRegularidade.asp&tipoinscricao=1&ImportEstadoSigla=&resultadopath5=5050-5045-5105-5111-5102&resultadopath3=5049-5045-5105-5111-5102&sltCidade=Produtos%2Be%2BServi%25E7os&resultadopath=5050-5045-5105-5111-5102&ImportWorkEmpregadorTipoInscricao=1&resultadopath4=5053-5045-5105-5111-5102&resultadopath2=5052-5045-5105-5111-5102&navegue=Navegue%2Bpela%2BCAIXA&txtConsulta=35263 (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "crawler.py", line 118, in <module>
r = get_dados()
File "crawler.py", line 109, in get_dados
r = s.get(url_get, headers=HEADERS, params=payload, verify=True, allow_redirects=False);
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/requests/sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/home/thomas/workspace/prime/caixa/venv/lib/python3.5/site-packages/requests/adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.sifge.caixa.gov.br', port=443): Max retries exceeded with url: /Cidadao/Crf/FgeCfSCriteriosPesquisa.asp?ImportWorkEmpregadorCodigoInscricaoAlfanum=10778237%2F0001-51&ImportURL=..%2FCrf%2FFgeCfSConsultaRegularidade.asp&tipoinscricao=1&ImportEstadoSigla=&resultadopath5=5050-5045-5105-5111-5102&resultadopath3=5049-5045-5105-5111-5102&sltCidade=Produtos%2Be%2BServi%25E7os&resultadopath=5050-5045-5105-5111-5102&ImportWorkEmpregadorTipoInscricao=1&resultadopath4=5053-5045-5105-5111-5102&resultadopath2=5052-5045-5105-5111-5102&navegue=Navegue%2Bpela%2BCAIXA&txtConsulta=35263 (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
```
## Reproduction Steps
```python
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.ssl_ import create_urllib3_context
# This is the 2.11 Requests cipher string, containing 3DES.
CIPHERS = (
'DES-CBC-SHA:DES-CBC3-SHA:'
'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'
'!eNULL:!MD5'
)
class DESAdapter(HTTPAdapter):
"""
A TransportAdapter that re-enables 3DES support in Requests.
"""
def init_poolmanager(self, *args, **kwargs):
context = create_urllib3_context(ciphers=CIPHERS)
kwargs['ssl_context'] = context
return super(DESAdapter, self).init_poolmanager(*args, **kwargs)
def proxy_manager_for(self, *args, **kwargs):
context = create_urllib3_context(ciphers=CIPHERS)
kwargs['ssl_context'] = context
return super(DESAdapter, self).proxy_manager_for(*args, **kwargs)
HEADERS = {
'Host':'www.sifge.caixa.gov.br',
'User-Agent':'Mozilla/5.0 (X11; Ubuntu; Linu…) Gecko/20100101 Firefox/55.0',
'Accept':'text/html,application/xhtml+xm…plication/xml;q=0.9,*/*;q=0.8',
'Accept-Language':'en-US,en;q=0.5',
'Accept-Encoding':'gzip, deflate, br',
'Content-Type':'application/x-www-form-urlencoded',
'Content-Length':'460',
'Referer':'https://www.sifge.caixa.gov.br…f/FgeCfSCriteriosPesquisa.asp',
'Cookie':'ASPSESSIONIDQSBASDRB=AMFJMBDCJGFKCOKJPKODJIED',
'Connection':'keep-alive',
'Upgrade-Insecure-Requests':'1'
}
url_get = 'https://www.sifge.caixa.gov.br/Cidadao/Crf/FgeCfSCriteriosPesquisa.asp'
payload = {
'ImportWorkEmpregadorTipoInscricao':'1',
'ImportURL':'../Crf/FgeCfSConsultaRegularidade.asp',
'sltCidade':'Produtos+e+Servi%E7os',
'navegue':'Navegue+pela+CAIXA',
'tipoinscricao':'1',
'ImportWorkEmpregadorCodigoInscricaoAlfanum':'10778237/0001-51',
'ImportEstadoSigla':'',
'resultadopath':'5050-5045-5105-5111-5102',
'resultadopath2':'5052-5045-5105-5111-5102',
'resultadopath3':'5049-5045-5105-5111-5102',
'resultadopath4':'5053-5045-5105-5111-5102',
'resultadopath5':'5050-5045-5105-5111-5102',
'txtConsulta':'35263'
}
s = requests.Session()
s.mount('https://www.sifge.caixa.gov.br', DESAdapter())
r = s.get(url_get, headers=HEADERS, params=payload, verify=True);
```
## System Information
```
$ python --version
Python 3.5.2
$ openssl version
OpenSSL 1.0.2g 1 Mar 2016
Linux Mint 18.1
```
```
$ pip freeze
argh==0.26.2
asn1crypto==0.22.0
beautifulsoup4==4.6.0
blinker==1.4
brotlipy==0.6.0
bs4==0.0.1
certifi==2017.7.27.1
cffi==1.11.0
chardet==3.0.4
click==6.7
construct==2.8.14
cryptography==2.0.3
cssutils==1.0.2
EditorConfig==0.12.1
html2text==2016.9.19
hyperframe==4.0.2
idna==2.6
jsbeautifier==1.6.14
lxml==3.8.0
ndg-httpsclient==0.4.3
packaging==16.8
passlib==1.7.1
pathtools==0.1.2
pkg-resources==0.0.0
pyasn1==0.3.5
pycparser==2.18
pyOpenSSL==17.3.0
pyparsing==2.2.0
PyYAML==3.12
requests==2.18.4
six==1.10.0
sortedcontainers==1.5.7
tornado==4.4.3
urllib3==1.22
watchdog==0.8.3
```
```
$ openssl s_client -tls1 -connect www.sifge.caixa.gov.br:443 -showcerts
CONNECTED(00000003)
depth=0 C = BR, O = ICP-Brasil, OU = Caixa Economica Federal, OU = AC CAIXA PJ SSL v2, CN = WWW.SIFGE.CAIXA.GOV.BR
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 C = BR, O = ICP-Brasil, OU = Caixa Economica Federal, OU = AC CAIXA PJ SSL v2, CN = WWW.SIFGE.CAIXA.GOV.BR
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
0 s:/C=BR/O=ICP-Brasil/OU=Caixa Economica Federal/OU=AC CAIXA PJ SSL v2/CN=WWW.SIFGE.CAIXA.GOV.BR
i:/C=BR/O=ICP-Brasil/OU=Caixa Economica Federal/CN=AC CAIXA PJ SSL v2
-----BEGIN CERTIFICATE-----
MIIGyjCCBLKgAwIBAgIITmChX/KLNhAwDQYJKoZIhvcNAQELBQAwYTELMAkGA1UE
BhMCQlIxEzARBgNVBAoMCklDUC1CcmFzaWwxIDAeBgNVBAsMF0NhaXhhIEVjb25v
bWljYSBGZWRlcmFsMRswGQYDVQQDDBJBQyBDQUlYQSBQSiBTU0wgdjIwHhcNMTcw
NDA3MTI0NDExWhcNMTgwNDA3MTI0NDExWjCBgjELMAkGA1UEBhMCQlIxEzARBgNV
BAoMCklDUC1CcmFzaWwxIDAeBgNVBAsMF0NhaXhhIEVjb25vbWljYSBGZWRlcmFs
MRswGQYDVQQLDBJBQyBDQUlYQSBQSiBTU0wgdjIxHzAdBgNVBAMMFldXVy5TSUZH
RS5DQUlYQS5HT1YuQlIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDI
vvdrLVd1yZVu1Y8ewTZN7GA5OgmsrciO5oLMi+UtfmxbA5ltYKcJGIPJZFglNUwy
ZbW/jTofRxlqjP9xPaOujm6o0rKsP2TzrLM/4ZhVnUmOeUl8ZC9M8S0qfOPNiFj8
lSzq9E7fbpiOX38+WfM9V6h0MAkoGCmM7kw7SkiwmsaIV37WVjWtjq8soqwALLcB
EXlXKB0FJbVs3vuh1CYGzJ2qNrXYZsuChgVS7tXxgE9ndRBqrOh/i2Kp1MITCRPi
ePmkl8aiFhfSNU9ey/cO8liJ231JEM+hQK2CuMxWjlmFSPLHAUAB1sxxo1zhOtEI
CsBuzeQbtzLVfYKpKGUnAgMBAAGjggJiMIICXjAOBgNVHQ8BAf8EBAMCBeAwHQYD
VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB0GA1UdDgQWBBSWCqZPEwyi/9hN
mbpXGmDIXtZmNjAfBgNVHSMEGDAWgBTz1fJRwuxpPdoF61ax83GCrCuC5DCBtQYD
VR0RBIGtMIGqoCIGBWBMAQMIoBkEF0NBSVhBIEVDT05PTUlDQSBGRURFUkFMoEAG
BWBMAQMEoDcENTI1MDUxOTY5MDAwMTg4ODg3MDQxNzAwNjU3MDM3NzAwMDAwMDYz
NDk1NTUzNERFVFJBTlJKoBkGBWBMAQMDoBAEDjAwMzYwMzA1MDAwMTA0oCcGBWBM
AQMCoB4EHFJJQ0FSRE8gUEFTQ0hPRVRPIERPUyBTQU5UT1MwagYDVR0gBGMwYTBf
BgdgTAECAYFKMFQwUgYIKwYBBQUHAgEWRmh0dHA6Ly9jZXJ0aWZpY2Fkb2RpZ2l0
YWwuY2FpeGEuZ292LmJyL2RvY3VtZW50b3MvZHBjYWMtY2FpeGFwanNzbC5wZGYw
bgYDVR0fBGcwZTAwoC6gLIYqaHR0cDovL2xjci5jYWl4YS5nb3YuYnIvYWNjYWl4
YXBqc3NsdjIuY3JsMDGgL6AthitodHRwOi8vbGNyMi5jYWl4YS5nb3YuYnIvYWNj
YWl4YXBqc3NsdjIuY3JsMFkGCCsGAQUFBwEBBE0wSzBJBggrBgEFBQcwAoY9aHR0
cDovL2NlcnRpZmljYWRvZGlnaXRhbC5jYWl4YS5nb3YuYnIvYWlhL2FjY2FpeGFw
anNzbHYyLnA3YjANBgkqhkiG9w0BAQsFAAOCAgEAqziOisz/gHE2Yc8pMRQ9sUjJ
5t7xn0T92lrJlJkeIy6WKqOBUAN9SpAs8O/9QHZGIDJ5yUnUnOjgluH+3RolW7/9
iJDqgv8MI23nKNBPoOedDBE5nSQqVRplEefpjCVFpgoWmzhyLcnz2A3bY4T0qYYj
BsVmOk1xpILAqzaimUhow9JofYolBwHLGJjD3qfzLh29S19GFTuD9MtXroHta/jh
/6PEmKQ7JEitClpx/NBZVukDffh2hBgZ6pDSEltG0vF2gypoezvKCmAYikdLDDim
ALyqM5ZRQ+EJz++5ER4iO9h/NMIMlgm7n7Oq9GD8N4dQ+KqUGWETAjQeRS65aNJG
PIOBmqa5O9Un6XmYR3TXutzdzcI+2ZVUKhnz2SqXVITdAB8XfEbVG4L/DmMzO1FH
0HEmgv53NW9rMqN6iEmeucEP3hl9oZNp0f7/P2jLx6xnpPLXRViPVxfJLZU5fA14
ytS4TTRBI0U4qAJkOQS/O/D6hLpdKlpubrjYR7nzsEy7/W8dbRGmQ3RRhze9iAQ5
pb/p79WmKArJvIm4N0wfFBCxQ35XTjVhls/BT+dEV/uIqfQTu3nZPA7bkIxkpfao
Adq1x9U8rIcgYoNpaGuYyGzYwJddKS828NEJKFT48SkzJNrhJ/P3QOYArqOCnBBg
7HSm9fg7r1DVh0sOeT8=
-----END CERTIFICATE-----
---
Server certificate
subject=/C=BR/O=ICP-Brasil/OU=Caixa Economica Federal/OU=AC CAIXA PJ SSL v2/CN=WWW.SIFGE.CAIXA.GOV.BR
issuer=/C=BR/O=ICP-Brasil/OU=Caixa Economica Federal/CN=AC CAIXA PJ SSL v2
---
No client certificate CA names sent
---
SSL handshake has read 1885 bytes and written 507 bytes
---
New, TLSv1/SSLv3, Cipher is RC4-MD5
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1
Cipher : RC4-MD5
Session-ID: 6F0C0000A0F84D55DBE77861EE7B259F0CE087027969084185C6EFCC96D653EC
Session-ID-ctx:
Master-Key: 34CA4185EAFBACA9D52E27B6C796FADB5C0A9CB1586257C7FCD6F40F74E5C04BEA48C257B71010A3F4AFC301673E32E3
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1505634687
Timeout : 7200 (sec)
Verify return code: 21 (unable to verify the first certificate)
---
```
|
{
"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/4294/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4294/timeline
| null |
completed
| null | null | false |
[
"With modern OpenSSL defaults it turns out that this server shuts the connection down. Likely this is because the remote server is getting confused by us advertising support for TLSv1.1 and 1.2. You could try changing your `context = create_urllib3_context(ciphers=CIPHERS)` line to:\r\n\r\n```python\r\ncontext =create_urllib3_context(ciphers=CIPHERS) \r\ncontext.options |= ssl.OP_NO_TLSv1_2 | ssl.OP_NO_TLSv1_1\r\n```\r\n\r\nthat might help. ",
"I tried, but it's the same mistake. I've tried everything, but my knowledge is limited and I do not know what I can try more.",
"It's very hard to know what's going on here: this server's configuration is so bad that it may simply not be possible to communicate with it using your copy of OpenSSL.",
"Thanks for everything, you're right, the server is really bad.",
"I got the same error message (`SSLError(SSLError(\"bad handshake: SysCallError(-1, 'Unexpected EOF')\",)`), but after doing `pip install ndg-httpsclient` my troubles went away.",
"@epleterte how just installing a module can help? You do not import it at some point?",
"@amirouche Requests detects the presence of certain modules and uses them to enhance security on old and insecure versions of Python."
] |
https://api.github.com/repos/psf/requests/issues/4293
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4293/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4293/comments
|
https://api.github.com/repos/psf/requests/issues/4293/events
|
https://github.com/psf/requests/issues/4293
| 258,183,320 |
MDU6SXNzdWUyNTgxODMzMjA=
| 4,293 |
End to End TLS + SNI with proxy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/382292?v=4",
"events_url": "https://api.github.com/users/jshaw86/events{/privacy}",
"followers_url": "https://api.github.com/users/jshaw86/followers",
"following_url": "https://api.github.com/users/jshaw86/following{/other_user}",
"gists_url": "https://api.github.com/users/jshaw86/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jshaw86",
"id": 382292,
"login": "jshaw86",
"node_id": "MDQ6VXNlcjM4MjI5Mg==",
"organizations_url": "https://api.github.com/users/jshaw86/orgs",
"received_events_url": "https://api.github.com/users/jshaw86/received_events",
"repos_url": "https://api.github.com/users/jshaw86/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jshaw86/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jshaw86/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jshaw86",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 6 |
2017-09-15T22:49:27Z
|
2021-09-08T06:00:44Z
|
2017-09-19T04:43:32Z
|
NONE
|
resolved
|
Summary.
We are running TLS+SNI with fabio https://github.com/fabiolb/fabio and backed by a nodejs running an HTTPS server with self signed certs. We have the application working with curl. We can't get this working with requests. I tried the toolbelt as well as may other adapters I found on the internet. Fundamentally what we need to have happen is the client will connect to the proxy on the given physical IP and PORT. Then pass the logical host through so that the proxy can route the logical server name to the correct backend. Plz halp.
## Expected Result
```
curl -v -X PUT --resolve "logical.server:10000:$IP" \
"https://logical.server:10000/some/uri" -d '{"value": "hello"}' \
-H "X-hmac: $(_hmac)" \
-H "Content-Type: application/json" \
-H "X-nonce: $(_nonce)"
```
## Actual Result
```
With PyOpenSSL: (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
Without PyOpenSSL: (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))
```
## Reproduction Steps
However I can't find a reasonable solution in requests to mimic this curl behavior.
My first go was just following the toolbelt SNI example:
```
s = requests.Session()
s.mount("https://", HostHeaderSSLAdapter())
nonce = _nonce()
data="foo"
r = s.put("https://$IP:10000/some/uri", json={"value": "hello"}, headers={
"Host": "logical.server",
"X-hmac": _hmac(data, SECRET),
"Content-Type": "application/json",
"X-nonce": nonce}, verify=False)
```
I tried other strategies around forcing TLS and spoofing with transparent proxies: https://github.com/jakubroztocil/httpie/issues/422#issuecomment-236398663. None changed the behavior.
## System Information
```
$ python --version
Python 2.7.13
$ openssl version
OpenSSL 1.0.2l 25 May 2017
$ OSX (also tried on linux 14.04)
10.12.6
```
Without pyOpenSSL
```
$ pip freeze
asn1crypto==0.22.0
certifi==2017.7.27.1
cffi==1.10.0
chardet==3.0.4
cryptography==2.0.3
enum34==1.1.6
idna==2.6
ipaddress==1.0.18
pycparser==2.18
requests==2.18.4
requests-toolbelt==0.8.0
six==1.10.0
urllib3==1.22
```
With pyOpenSSL
```
$ pip freeze
asn1crypto==0.22.0
certifi==2017.7.27.1
cffi==1.10.0
chardet==3.0.4
cryptography==2.0.3
enum34==1.1.6
idna==2.6
ipaddress==1.0.18
pycparser==2.18
pyOpenSSL==17.3.0
requests==2.18.4
requests-toolbelt==0.8.0
six==1.10.0
urllib3==1.22
```
Openssl connecting to Fabio
```
$ openssl s_client -connect $IP:$PORT -servername logical.server
CONNECTED(00000003)
depth=0 /C=US/ST=CA/L=San Francisco/O=PubNub/OU=Dev/CN=logical.server
verify error:num=18:self signed certificate
verify return:1
depth=0 /C=US/ST=CA/L=San Francisco/O=PubNub/OU=Dev/CN=logical.server
verify return:1
---
Certificate chain
0 s:/C=US/ST=CA/L=San Francisco/O=PubNub/OU=Dev/CN=logical.server.name
i:/C=US/ST=CA/L=San Francisco/O=PubNub/OU=Dev/CN=logical.server.name
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIDozCCAougAwIBAgIJAM3s1shczk7eMA0GCSqGSIb3DQEBCwUAMGgxCzAJBgNV
BAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEPMA0G
A1UECgwGUHViTnViMQwwCgYDVQQLDANEZXYxFTATBgNVBAMMDHZhdWx0ci5sb2Nh
bDAeFw0xNzA5MTQyMjMzMzJaFw00NTAxMzAyMjMzMzJaMGgxCzAJBgNVBAYTAlVT
MQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEPMA0GA1UECgwG
UHViTnViMQwwCgYDVQQLDANEZXYxFTATBgNVBAMMDHZhdWx0ci5sb2NhbDCCASIw
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKPtkscVVph69UEOYneVm9zh3Ru7
DPXihS4+P6U2hHANTpX/FOxQIP+FC5ELG+xDG2caCXbb7oER9MFm+TkytzQqW4ur
lbngnOl5t3QPHfsMB645SCYKmjREOMSwgIx4zi2brBf5GKAu5hOpP84FPSYd06a5
LzIJBEybiFJVKH/j2Ig5ekgvw6F6pjDMIb035G1WMHl341rOyusfAAEiJeTW0c6b
6MF4GJL8WS8tpwUVAGnFvcub6O/uxoniiW6vn53Xs04+zFgecYtklcqFZeUHKLxe
EPFbTXTi0yWUcC4UC/E9iFGVgVzBZxWQf1Bj/R3o1b+irZiYSGnNeX5IQSsCAwEA
AaNQME4wHQYDVR0OBBYEFFL6Npq18TvCkwc8tazezOERo5M9MB8GA1UdIwQYMBaA
FFL6Npq18TvCkwc8tazezOERo5M9MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEL
BQADggEBAHtzLceffM1AWh/XXqidtb3fkLovpk9XAADoPetb2ARJBYG/BUJwmmiA
zEQ8IVxS5N3t+sdEC5RBKfqW05DDnW/0OY3eIHLUYqoyyvt6/WzJo08J6kKNLgIm
ukmOfNfs7i2R0YRbfsmq8Mze9Lk3G23Q44wOzx89vGX2mCYkeUznR9m28e+23wLX
aBYUix9XpWrj13R6pc1ljS2O9SqTWjsmi6zr/HhbdGd3QyVK+Q8g4DpJ2tWPzZR4
q7VsxEzJubKXGQb6d20k5DT4ehjQBAbxT4BSrqhyBABox4M/R2sQ4iDColXemXEI
YZl8zbJwpPZxV9mvstWY+NQDxCPe9yM=
-----END CERTIFICATE-----
subject=/C=US/ST=CA/L=San Francisco/O=PubNub/OU=Dev/CN=logical.server
issuer=/C=US/ST=CA/L=San Francisco/O=PubNub/OU=Dev/CN=logical.server
---
No client certificate CA names sent
---
SSL handshake has read 1299 bytes and written 447 bytes
---
New, TLSv1/SSLv3, Cipher is AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : AES256-SHA
Session-ID: DB0923D38B54871EE944C9A206A51B3C7C54BD5723EBB1DBF30D421AB742AD88
Session-ID-ctx:
Master-Key: D32CC66A48B71E577024A0947AC292CC32F374978F0156104D958A9AE24E9AA71B67AFCFD3D26F778139576E2CDF40EA
Key-Arg : None
TLS session ticket lifetime hint: 300 (seconds)
TLS session ticket:
0000 - c3 64 25 44 9c 28 85 bc-a3 80 1c 79 96 e3 aa 45 .d%D.(.....y...E
0010 - 2d dd 07 6d 8e 39 43 95-4c 36 dc 58 d6 ea 9e 2e -..m.9C.L6.X....
0020 - 60 10 f4 ba 83 84 e9 6a-29 25 d6 1e 5e 93 e7 15 `......j)%..^...
0030 - 95 74 03 e5 d1 37 99 8f-c6 2b 15 ab bc ee 99 e4 .t...7...+......
0040 - fd 89 a4 b4 57 d4 0a 0e-1e a6 86 22 ef 46 07 6a ....W......".F.j
0050 - 80 31 97 a7 6b 31 1f 45-f2 4e f7 63 65 e8 a0 d8 .1..k1.E.N.ce...
0060 - 26 3e 5d d6 fa 97 87 3d-f2 dd 25 82 ff f7 d0 95 &>]....=..%.....
0070 - d0 c9 f1 30 00 ba 71 e4-b4 1d 14 27 e9 ce 83 76 ...0..q....'...v
0080 - c2 1e 25 84 1c ad 5c 0d-9f 03 ac a4 6b b8 4b 84 ..%...\.....k.K.
0090 - 1d 38 f8 47 a4 01 c8 a9-79 55 1e 52 e2 0d 1d 42 .8.G....yU.R...B
00a0 - ce 19 e2 ed d3 98 05 87-ba 6a de 45 e3 c7 01 c4 .........j.E....
00b0 - 54 58 98 b0 40 c3 57 d2-96 08 30 41 ca b6 82 94 [email protected]....
00c0 - 00 3e 1e 36 da 7f f3 44-7d f7 24 08 36 52 eb 69 .>.6...D}.$.6R.i
Start Time: 1505515260
Timeout : 300 (sec)
Verify return code: 18 (self signed certificate)
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/382292?v=4",
"events_url": "https://api.github.com/users/jshaw86/events{/privacy}",
"followers_url": "https://api.github.com/users/jshaw86/followers",
"following_url": "https://api.github.com/users/jshaw86/following{/other_user}",
"gists_url": "https://api.github.com/users/jshaw86/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jshaw86",
"id": 382292,
"login": "jshaw86",
"node_id": "MDQ6VXNlcjM4MjI5Mg==",
"organizations_url": "https://api.github.com/users/jshaw86/orgs",
"received_events_url": "https://api.github.com/users/jshaw86/received_events",
"repos_url": "https://api.github.com/users/jshaw86/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jshaw86/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jshaw86/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jshaw86",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4293/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4293/timeline
| null |
completed
| null | null | false |
[
"The problem here is the IP address. When you set that IP address Requests is unable to correctly set the SNI header, which may well be confusing your server. \r\n\r\nUnfortunately at this time Requests does not support anything like curl's `--resolve`. You'd need to edit the hosts file on your machine to get this to work the way you want. ",
"@lukasa is it understood the changes necessary to get this to work or is it unknown and require discovery?",
"The changes to the hosts file, or to Requests/urllib3?",
"The changes to requests or urllib to support resolve-like functionality",
"There is a semi-abandoned PR: shazow/urllib3#1209. That needs to be pursued. ",
"Ok thanks! Will follow up if we have time."
] |
https://api.github.com/repos/psf/requests/issues/4292
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4292/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4292/comments
|
https://api.github.com/repos/psf/requests/issues/4292/events
|
https://github.com/psf/requests/issues/4292
| 258,090,755 |
MDU6SXNzdWUyNTgwOTA3NTU=
| 4,292 |
Failed to establish a new connection: [Errno 10060]
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/31993462?v=4",
"events_url": "https://api.github.com/users/sus099/events{/privacy}",
"followers_url": "https://api.github.com/users/sus099/followers",
"following_url": "https://api.github.com/users/sus099/following{/other_user}",
"gists_url": "https://api.github.com/users/sus099/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sus099",
"id": 31993462,
"login": "sus099",
"node_id": "MDQ6VXNlcjMxOTkzNDYy",
"organizations_url": "https://api.github.com/users/sus099/orgs",
"received_events_url": "https://api.github.com/users/sus099/received_events",
"repos_url": "https://api.github.com/users/sus099/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sus099/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sus099/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sus099",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 5 |
2017-09-15T16:08:36Z
|
2021-09-05T00:06:54Z
|
2018-01-23T16:14:50Z
|
NONE
|
resolved
|
Summary.
## Expected Result
What you expected.
## Actual Result
What happened instead.
## Reproduction Steps
```python
import requests
```
## System Information
$ python -m requests.help
```
Downloading to: e:\Learning\Powershell\C#vs.Net\udemy-dl-windows-2.1.3\udemy-dl-windows\csharp-tutorial-for-beginners
Trying to log in ...
Exception
Traceback (most recent call last):
File "udemy_dl.py", line 976, in <module>
File "udemy_dl.py", line 971, in main
File "udemy_dl.py", line 766, in udemy_dl
File "udemy_dl.py", line 156, in login
File "udemy_dl.py", line 143, in get_csrf_token
File "udemy_dl.py", line 113, in get
File "site-packages\requests\sessions.py", line 515, in get
File "site-packages\requests\sessions.py", line 502, in request
File "site-packages\requests\sessions.py", line 612, in send
File "site-packages\requests\adapters.py", line 502, in send
ProxyError: HTTPSConnectionPool(host='www.udemy.com', port=443): Max retries exceeded with url: /join/login-popup (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x03571850>: Failed to establish a new connection: [Errno 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',)))
Failed to execute script udemy_dl
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4292/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4292/timeline
| null |
completed
| null | null | false |
[
"Seems like you're having trouble connecting to your proxy. Without a better idea of what's going on, we can't really help you I'm afraid. ☹️ ",
"I'm going to close this out due to lack of information and this appearing to be a usability question. If you have more information and feel this is a defect with Requests rather than your environment, we can look at reopening. Thanks!",
"I have similar issue,\r\nF:\\udemy-dl\\udemy-dl-windows>udemy-dl.exe https://www.udemy.com/vue-2-crash-course/learn/v4/overview\r\nUsername / Email : [email protected]\r\nPassword :\r\n Downloading to: F:\\udemy-dl\\udemy-dl-windows\\vue-2-crash-course\r\n\r\n Trying to log in ...\r\n Exception\r\nTraceback (most recent call last):\r\n File \"udemy_dl.py\", line 976, in <module>\r\n File \"udemy_dl.py\", line 971, in main\r\n File \"udemy_dl.py\", line 766, in udemy_dl\r\n File \"udemy_dl.py\", line 156, in login\r\n File \"udemy_dl.py\", line 150, in get_csrf_token\r\nAttributeError: 'NoneType' object has no attribute 'group'\r\nFailed to execute script udemy_dl\r\n\r\nPlease help. Thanks.",
"Hi @nyoman, the stacktrace you provided is unrelated to Requests or this issue. I would suggest asking for assistance from the `udemy-dl` maintainers or posting a question on StackOverflow. Thanks!",
"I meet the same question, I don't know where the trouble is. Please help me!"
] |
https://api.github.com/repos/psf/requests/issues/4291
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4291/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4291/comments
|
https://api.github.com/repos/psf/requests/issues/4291/events
|
https://github.com/psf/requests/issues/4291
| 257,217,723 |
MDU6SXNzdWUyNTcyMTc3MjM=
| 4,291 |
json() crashes interpreter with a JSONDecodeError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11887492?v=4",
"events_url": "https://api.github.com/users/justlurking/events{/privacy}",
"followers_url": "https://api.github.com/users/justlurking/followers",
"following_url": "https://api.github.com/users/justlurking/following{/other_user}",
"gists_url": "https://api.github.com/users/justlurking/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/justlurking",
"id": 11887492,
"login": "justlurking",
"node_id": "MDQ6VXNlcjExODg3NDky",
"organizations_url": "https://api.github.com/users/justlurking/orgs",
"received_events_url": "https://api.github.com/users/justlurking/received_events",
"repos_url": "https://api.github.com/users/justlurking/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/justlurking/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/justlurking/subscriptions",
"type": "User",
"url": "https://api.github.com/users/justlurking",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-09-12T23:53:05Z
|
2021-09-08T06:00:46Z
|
2017-09-13T00:00:42Z
|
NONE
|
resolved
|
I have reproduced this with requests v. 2.18.4 and 2.14.2, along with Python 3.6.1 and 3.6.2. I have used my system-installed Python/requests (macOS Sierra with Python 3.6.1 downloaded from python.org), Python / requests installed as part of conda 4.3.25, and the latest Python and requests installed from conda-forge.
Same results everywhere.
## Expected Result
Expected to see a dictionary of JSON values, as indicated here: http://docs.python-requests.org/en/master/
## Actual Result
Python interpreter crashes.
## Reproduction Steps
```
Python 3.6.2 | packaged by conda-forge | (default, Jul 23 2017, 23:01:38)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> r = requests.get('https://pypi.python.org/pypi')
>>> r.status_code
200
>>> r.encoding
'utf-8'
>>> r.json()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/psimpson/miniconda3/envs/test/lib/python3.6/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/Users/psimpson/miniconda3/envs/test/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/Users/psimpson/miniconda3/envs/test/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/psimpson/miniconda3/envs/test/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": "2.0.3"
},
"idna": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.6.2"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "100020cf",
"version": "17.2.0"
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": true
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nateprewitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nateprewitt",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4291/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4291/timeline
| null |
completed
| null | null | false |
[
"Hey @justlurking, this is actually working as expected. The .json() method is only usable on Response content that is in the json format. The webpage you're requesting is returning an HTML document and therefore won't work.\r\n\r\nYou'll need to either modify your Accept headers and *attempt* to retrieve valid json data, or add code to handle the case of json data not being readily available. I'm closing this since things are working as expected.",
"Thanks for the super quick and informative reply, and apologies for wasting your time. I should have realized it might be something like that given the multiple versions I tested and lack of outcry on GitHub. 🤦\r\n\r\nI imagine the best thing to do would be to import json.JSONDecodeError and do something like this?\r\n```\r\ntry:\r\n r.json()\r\nexcept JSONDecodeError as e:\r\n <handle exception>\r\n```",
"So this should actually be a subclass of ValueError so I think you'll be able to catch that if you don't want to import. It's up to you on the level of specificity you'd like.\r\n\r\nThat general idea is the approach I'd suggest though. Hope that helps!"
] |
https://api.github.com/repos/psf/requests/issues/4290
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4290/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4290/comments
|
https://api.github.com/repos/psf/requests/issues/4290/events
|
https://github.com/psf/requests/pull/4290
| 257,204,510 |
MDExOlB1bGxSZXF1ZXN0MTQwNjk4MzE4
| 4,290 |
New HTTPHeaderDict class for response headers with multiple header value support
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4016213?v=4",
"events_url": "https://api.github.com/users/the-allanc/events{/privacy}",
"followers_url": "https://api.github.com/users/the-allanc/followers",
"following_url": "https://api.github.com/users/the-allanc/following{/other_user}",
"gists_url": "https://api.github.com/users/the-allanc/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/the-allanc",
"id": 4016213,
"login": "the-allanc",
"node_id": "MDQ6VXNlcjQwMTYyMTM=",
"organizations_url": "https://api.github.com/users/the-allanc/orgs",
"received_events_url": "https://api.github.com/users/the-allanc/received_events",
"repos_url": "https://api.github.com/users/the-allanc/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/the-allanc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/the-allanc/subscriptions",
"type": "User",
"url": "https://api.github.com/users/the-allanc",
"user_view_type": "public"
}
|
[
{
"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"
},
{
"color": "1cff91",
"default": false,
"description": "",
"id": 860696300,
"name": "3.0",
"node_id": "MDU6TGFiZWw4NjA2OTYzMDA=",
"url": "https://api.github.com/repos/psf/requests/labels/3.0"
}
] |
closed
| true | null |
[] | null | 6 |
2017-09-12T22:37:31Z
|
2021-09-03T00:11:07Z
|
2018-03-15T13:18:13Z
|
NONE
|
resolved
|
Same changes as my other pull request #4282, but this against the proposed/3.0.0 branch.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4290/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4290/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4290.diff",
"html_url": "https://github.com/psf/requests/pull/4290",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4290.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4290"
}
| true |
[
"The CI builds are failing on tests which were failing before my changes were pushed (honest!)",
"We know :)\r\n\r\n@Lukasa what do you think of this? I'm very :+1: personally.",
"I think this will be a major improvement to Requests.",
"Why reinventing the wheel? `urllib3` has a multiheader-ready headers implementation for ages. Stable, fast, reviewed and well tested. If I remember correctly, it was already suggested a while ago to reuse it also in requests, so that it could be avoided to copy and re-read all the headers, which would also be a considerable speed improvement on creating a Response object.",
"Merged into '3.0' branch. ✨🍰✨",
"Pending further modifications."
] |
https://api.github.com/repos/psf/requests/issues/4289
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4289/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4289/comments
|
https://api.github.com/repos/psf/requests/issues/4289/events
|
https://github.com/psf/requests/issues/4289
| 257,102,201 |
MDU6SXNzdWUyNTcxMDIyMDE=
| 4,289 |
Bad name in the request: not a legal PLSQL identifer
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/22199872?v=4",
"events_url": "https://api.github.com/users/wubba1337/events{/privacy}",
"followers_url": "https://api.github.com/users/wubba1337/followers",
"following_url": "https://api.github.com/users/wubba1337/following{/other_user}",
"gists_url": "https://api.github.com/users/wubba1337/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wubba1337",
"id": 22199872,
"login": "wubba1337",
"node_id": "MDQ6VXNlcjIyMTk5ODcy",
"organizations_url": "https://api.github.com/users/wubba1337/orgs",
"received_events_url": "https://api.github.com/users/wubba1337/received_events",
"repos_url": "https://api.github.com/users/wubba1337/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wubba1337/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wubba1337/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wubba1337",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-09-12T16:15:13Z
|
2021-09-08T07:00:22Z
|
2017-09-12T16:17:54Z
|
NONE
|
resolved
|
Hello guys, relatively new to python. Met with this error while trying to use request POST to extra information. Header and data are directly copied and paste from using google chrome when the POST is made. Couldn't identify any wrong with the formData. Am i missing out on something?
> import requests
> formData = {
> 'acadsem':'2017_1',
> 'r_course_yr':'ACC%3BGB%3B2%3BF',
> ' r_subj_code':'Enter+Keywords+or+Course+Code',
> 'boption':'CLoad',
> 'semester':'1',
> 'acadsem':'2017_1'
> }
> url = "'www.example.com/"
>
> response = requests.post(url, data = formData)
>
> print(response.content)
|
{
"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/4289/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4289/timeline
| null |
completed
| null | null | false |
[
"You're passing urlencoded form data to our `data` parameter which will in turn urlencode it. You will want to decode `r_course_yr`'s value.\r\n\r\nIn the future, please use StackOverflow for questions of this type."
] |
https://api.github.com/repos/psf/requests/issues/4288
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4288/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4288/comments
|
https://api.github.com/repos/psf/requests/issues/4288/events
|
https://github.com/psf/requests/issues/4288
| 256,980,568 |
MDU6SXNzdWUyNTY5ODA1Njg=
| 4,288 |
redirect(301) always need to wait for 120 seconds
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10825713?v=4",
"events_url": "https://api.github.com/users/etiaxie/events{/privacy}",
"followers_url": "https://api.github.com/users/etiaxie/followers",
"following_url": "https://api.github.com/users/etiaxie/following{/other_user}",
"gists_url": "https://api.github.com/users/etiaxie/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/etiaxie",
"id": 10825713,
"login": "etiaxie",
"node_id": "MDQ6VXNlcjEwODI1NzEz",
"organizations_url": "https://api.github.com/users/etiaxie/orgs",
"received_events_url": "https://api.github.com/users/etiaxie/received_events",
"repos_url": "https://api.github.com/users/etiaxie/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/etiaxie/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/etiaxie/subscriptions",
"type": "User",
"url": "https://api.github.com/users/etiaxie",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-09-12T09:40:24Z
|
2021-09-08T06:00:45Z
|
2017-09-13T07:01:15Z
|
NONE
|
resolved
|
code like this:
import requests
requests.request('get', 'http://10.192.74.230:6201/en?CSnaL/uZkQC9SLVbaMoQDA8Ph9/+Q7+stJc7S1qGSuvEss6zmYfB7SvYE4vAOWgfUrJuxOBk7giWoAKARD9o7oaZlmg84SgIEIvBgnqr3Jj9OH9RPt4MEbQmHmhsDfBfMzY2OA==')
expect return a response with status_code=301 and then will auto send to the new url in "Location" of 301 response.
actually requests.request() will not get a return value until after 120 seconds.and in wireshark log i can see the 301 response received immediatly.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4288/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4288/timeline
| null |
completed
| null | null | false |
[
"the received 301 message:\r\nHTTP/1.1 301 Moved Permanently\r\nLocation: http://10.192.74.193:6801/en?OquUyLHZ2FyZUDNp2IFFPnft8SvIpFbincdfI+28KZTEss6zmYfB7SvYE4vAOWgfUrJuxOBk7giWoAKARD9o7pP2snF7YaLGUe2u5T4m2HKqrfp1J6hXLT424Rl2iJWSNjkwMA==&&act=get&ztype=0&zvalue=100\r\nConnection: close\r\nDate: Tue, 12 Sep 2017 09:15:20 GMT\r\n\r\n",
"The 301 is setting `Connection: close`, so we're waiting for it to be closed before we continue. This is because 301s may have bodies, and we need to handle that possibility. There's not much we can do about this: the server should either remove `Connection: close` (because it doesn't seem to need it), or it should close the connection immediately."
] |
https://api.github.com/repos/psf/requests/issues/4287
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4287/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4287/comments
|
https://api.github.com/repos/psf/requests/issues/4287/events
|
https://github.com/psf/requests/issues/4287
| 256,911,428 |
MDU6SXNzdWUyNTY5MTE0Mjg=
| 4,287 |
Sending HTTPS requests to specific destination IP address
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/381556?v=4",
"events_url": "https://api.github.com/users/ksze/events{/privacy}",
"followers_url": "https://api.github.com/users/ksze/followers",
"following_url": "https://api.github.com/users/ksze/following{/other_user}",
"gists_url": "https://api.github.com/users/ksze/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ksze",
"id": 381556,
"login": "ksze",
"node_id": "MDQ6VXNlcjM4MTU1Ng==",
"organizations_url": "https://api.github.com/users/ksze/orgs",
"received_events_url": "https://api.github.com/users/ksze/received_events",
"repos_url": "https://api.github.com/users/ksze/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ksze/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ksze/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ksze",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 12 |
2017-09-12T04:03:28Z
|
2021-08-27T00:08:22Z
|
2017-09-12T05:37:10Z
|
NONE
|
resolved
|
Using requests, is there a way to send HTTPS requests while specifying the destination IP address?
E.g. github.com has multiple IP address. If I do a DNS lookup for github.com from Hong Kong, I get 192.30.255.113 and 192.30.255.112.
What if I want to send a HTTPS request to a specific github IP? This is useful for when you setup a service with multiple IPs and you want to test whether all IPs work correctly. Or when a service has regional DNS records and you want to send requests to a particular regional server.
I wish I could do something like:
```
import requests
response = requests.get('https://github.com/', server_ip='192.30.255.113')
```
SSL certificate verification needs to still work, of course.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 10,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 10,
"url": "https://api.github.com/repos/psf/requests/issues/4287/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4287/timeline
| null |
completed
| null | null | false |
[
"Right now this is not supported, but you can achieve a similar effect using the hosts file on your machine. There is work ongoing to add the functionality needed to achieve this, however. ",
"I know this issue is closed, but I'm wondering: is this not possible (or feasible) even if I implement a custom Transport Adapter (http://www.python-requests.org/en/master/user/advanced/#transport-adapters)?",
"Yes: if you do that you have access to an SSLContext and so can configure it appropriately. ",
"I am glad that there is functionality being added. Unfortunately I cannot wait. So I am working on a TransportAdapter and found this link with DNSResolverHTTPAdapter\r\nhttps://stackoverflow.com/questions/22609385/python-requests-library-define-specific-dns/22614367#22614367\r\n\r\nUnfortunately it is replacing the FQDN with the ip address - I need to maintain the FQDN and ensure that the connection is made to the right IP address.\r\n\r\nAlso unable to find the SSLContext object that @Lukasa referenced. Hoping to get a bit more assistance to override the connection being made to the desired IP Address please.",
"@ram-ibm this is a defect tracker, not a support forum",
"@Lukasa \r\n> There is work ongoing to add the functionality needed to achieve this, however.\r\n\r\nHi. I'm also interested in something similar as the issue creator. Could you elaborate what you meant by the above comment? What sort of work was being done and is it completed?",
"+1 for this feature\r\n\r\nAs this doesn't seem to be in, can this ticket be re-opened as feature request?",
"Currently I have created a docker environment with each container setting a different /etc/hosts.\r\n\r\nIf this could be done using requests that would be a huge step forward",
"There is a good thread to address this need:\r\nhttps://stackoverflow.com/questions/44374215/how-do-i-specify-url-resolution-in-pythons-requests-library-in-a-similar-fashio\r\n\r\nIn case someone else stumbles on this closed issue needing this feature.",
"Does this apply to when using http proxies? Will the DNS resolution happen client side (so that I can use the host file to override the DNS server) or will it happen in the proxy side? Thanks.",
"https://github.com/Roadmaster/forcediphttpsadapter ([notes](https://www.tomechangosubanana.com/2017/forcing-python-requests-to-connect-to-a-specific-ip-address/))\r\n",
"> Yes: if you do that you have access to an SSLContext and so can configure it appropriately.\r\n\r\nBut works only in python2, an ssl context with a custom hostname does not works on python3.\r\n\r\n\r\n> Right now this is not supported, but you can achieve a similar effect using the hosts file on your machine. There is work ongoing to add the functionality needed to achieve this, however.\r\n\r\nReally need modify the operating system and root permissions only for resolve an ip address?\r\n\r\nFor this case: Need check the integrity of all address associated for a domain address, for made this need make a https request for all ip address associated to domain and validate the all contents are equals. How to made this on python3?"
] |
https://api.github.com/repos/psf/requests/issues/4286
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4286/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4286/comments
|
https://api.github.com/repos/psf/requests/issues/4286/events
|
https://github.com/psf/requests/issues/4286
| 256,800,171 |
MDU6SXNzdWUyNTY4MDAxNzE=
| 4,286 |
Pass Multiple Auth Handlers
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5131271?v=4",
"events_url": "https://api.github.com/users/achapkowski/events{/privacy}",
"followers_url": "https://api.github.com/users/achapkowski/followers",
"following_url": "https://api.github.com/users/achapkowski/following{/other_user}",
"gists_url": "https://api.github.com/users/achapkowski/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/achapkowski",
"id": 5131271,
"login": "achapkowski",
"node_id": "MDQ6VXNlcjUxMzEyNzE=",
"organizations_url": "https://api.github.com/users/achapkowski/orgs",
"received_events_url": "https://api.github.com/users/achapkowski/received_events",
"repos_url": "https://api.github.com/users/achapkowski/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/achapkowski/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/achapkowski/subscriptions",
"type": "User",
"url": "https://api.github.com/users/achapkowski",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-09-11T18:32:01Z
|
2021-09-08T06:00:45Z
|
2017-09-11T19:27:35Z
|
NONE
|
resolved
|
Summary.
I would like to pass multiple authentication handlers to the auth variable on requests.
In the urllib.request package when you build an opener, you can chain hanlders.
Example:
```
password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
# Add the username and password.
# If we knew the realm, we could use it instead of None.
top_level_url = "http://example.com/foo/"
password_mgr.add_password(None, top_level_url, username, password)
handler1 = urllib.request.HTTPBasicAuthHandler(password_mgr)
handler2 = urllib.request.HTTPDigestAuthHandler(password_mgr)
# create "opener" (OpenerDirector instance)
opener = urllib.request.build_opener([handler1, handler2])
# use the opener to fetch a URL
opener.open(a_url)
# Install the opener.
# Now all calls to urllib.request.urlopen use our opener.
urllib.request.install_opener(opener)
```
It takes each handler in order and tried one from the list to see what will take. This will help for sites that use multiple forms of authentication or with site where you don't know the auth type.
Is there a way to do this with requests? If I pass in a list of authhandlers to the auth variable, I see the ```__str__``` representation of the class being given in the auth part of the request.
Thank you
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4286/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4286/timeline
| null |
completed
| null | null | false |
[
"There is no way with the core Requests package, but your use-case can be solved with [the Requests toolbelt](http://toolbelt.readthedocs.io/en/latest/authentication.html#guessauth) package's `GuessAuth` class. For more general use, [`AuthHandler`](http://toolbelt.readthedocs.io/en/latest/authentication.html#authhandler) might suit your needs.",
"@Lukasa Thanks. Do you think this could be an added feature for the next release?\r\n\r\nI think your solution will work. The ```GuessAuth``` class seems to extend the ```BaseAuth``` class and does the ```40x``` checks.\r\n\r\n",
"Nope. =) Generally speaking we only add features when they're needed by an enormous number of people and when it's more convenient for us to do it than for a third-party. In this case the third-party package works great, so there's no real reason to bring it into Requests."
] |
https://api.github.com/repos/psf/requests/issues/4285
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4285/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4285/comments
|
https://api.github.com/repos/psf/requests/issues/4285/events
|
https://github.com/psf/requests/issues/4285
| 256,780,181 |
MDU6SXNzdWUyNTY3ODAxODE=
| 4,285 |
Decoding issues on Linux cause Segmentation fault for given sites
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8107988?v=4",
"events_url": "https://api.github.com/users/gjthompson1/events{/privacy}",
"followers_url": "https://api.github.com/users/gjthompson1/followers",
"following_url": "https://api.github.com/users/gjthompson1/following{/other_user}",
"gists_url": "https://api.github.com/users/gjthompson1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gjthompson1",
"id": 8107988,
"login": "gjthompson1",
"node_id": "MDQ6VXNlcjgxMDc5ODg=",
"organizations_url": "https://api.github.com/users/gjthompson1/orgs",
"received_events_url": "https://api.github.com/users/gjthompson1/received_events",
"repos_url": "https://api.github.com/users/gjthompson1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gjthompson1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gjthompson1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gjthompson1",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 11 |
2017-09-11T17:20:38Z
|
2021-09-08T02:09:56Z
|
2018-05-20T19:32:34Z
|
NONE
|
resolved
|
Summary.
I have tested the following on my Mac and I get both unicode errors:
For the following:
`r = requests.get('http://xn--w8jujla2a2c4e0lg4403e52qmkrfye.biz', stream=True)`
I get:
`UnicodeError: decoding with 'idna' codec failed (UnicodeError: Invalid character '\x80')`
For:
`r = requests.get('http://xn--meiner-dta.hamburg', stream=True)`
I get:
`UnicodeError: ('IDNA does not round-trip', b'xn--meiner-dta', b'meissner')`
Which I am good with.
But on linux I get:
`Segmentation fault (core dumped)`
Crashing my program.
Note the versions of python are slightly different but I guess the following is true for ubuntu.
https://forums.aws.amazon.com/thread.jspa?threadID=255687
## Expected Result
Expect it to error out like on MacOS.
## System Information
$ python -m requests.help
On Mac
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.2"
},
"platform": {
"release": "16.3.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
On Linux
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.5.2"
},
"platform": {
"release": "4.4.0-1032-aws",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4285/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4285/timeline
| null |
completed
| null | null | false |
[
"Hrm. Requests cannot be the cause of this segfault because it's pure-Python code. Can you use GDB or something similar to examine the coredump and check the Python stack to see what code was executing when the segfault occurred?",
"Lukas, thanks for getting back to me. I tried to run using GDB. I get the following:\r\n\r\n`test.py`\r\n```\r\nimport requests\r\nprint('Hey')\r\nr = requests.get('http://xn--w8jujla2a2c4e0lg4403e52qmkrfye.biz', stream=True)\r\n```\r\n\r\nThen\r\n```\r\n(gdb) run test.py\r\nStarting program: /usr/bin/python3 test.py\r\nwarning: Error disabling address space randomization: Operation not permitted\r\nHey\r\nDuring startup program terminated with signal SIGSEGV, Segmentation fault.\r\n```\r\n\r\nI guess there is something wrong here because its not catching anything..",
"Sorry, we need a Python backtrace. See [this article](https://wiki.python.org/moin/DebuggingWithGdb)",
"Does this work?\r\n\r\n```\r\n(gdb) run test.py\r\nStarting program: /usr/bin/python3 test.py\r\n[Thread debugging using libthread_db enabled]\r\nUsing host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\r\nHey\r\n\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0x00007ffff673f767 in ?? () from /usr/lib/python3.5/lib-dynload/_ssl.cpython-35m-x86_64-linux-gnu.so\r\n```\r\n\r\n```\r\n(gdb) bt\r\n#0 0x00007ffff673f767 in ?? () from /usr/lib/python3.5/lib-dynload/_ssl.cpython-35m-x86_64-linux-gnu.so\r\n#1 0x00007ffff6739231 in ?? () from /usr/lib/python3.5/lib-dynload/_ssl.cpython-35m-x86_64-linux-gnu.so\r\n#2 0x00000000004e9bc7 in PyCFunction_Call ()\r\n#3 0x0000000000524414 in PyEval_EvalFrameEx ()\r\n#4 0x000000000052e12b in PyEval_EvalCodeEx ()\r\n#5 0x00000000004ebdd7 in ?? ()\r\n#6 0x00000000005b7167 in PyObject_Call ()\r\n#7 0x00000000004f413e in ?? ()\r\n#8 0x00000000005b7167 in PyObject_Call ()\r\n#9 0x000000000054d359 in ?? ()\r\n#10 0x000000000055d17c in ?? ()\r\n#11 0x00000000005b7167 in PyObject_Call ()\r\n#12 0x0000000000528d06 in PyEval_EvalFrameEx ()\r\n#13 0x000000000052d2e3 in ?? ()\r\n#14 0x0000000000528eee in PyEval_EvalFrameEx ()\r\n#15 0x000000000052d2e3 in ?? ()\r\n#16 0x0000000000528eee in PyEval_EvalFrameEx ()\r\n#17 0x0000000000528814 in PyEval_EvalFrameEx ()\r\n#18 0x000000000052d82f in ?? ()\r\n#19 0x0000000000529332 in PyEval_EvalFrameEx ()\r\n#20 0x000000000052d2e3 in ?? ()\r\n#21 0x0000000000528eee in PyEval_EvalFrameEx ()\r\n#22 0x000000000052d2e3 in ?? ()\r\n#23 0x0000000000528eee in PyEval_EvalFrameEx ()\r\n#24 0x000000000052e12b in PyEval_EvalCodeEx ()\r\n#25 0x00000000004ebdd7 in ?? ()\r\n#26 0x00000000005b7167 in PyObject_Call ()\r\n#27 0x00000000005262af in PyEval_EvalFrameEx ()\r\n#28 0x000000000052e12b in PyEval_EvalCodeEx ()\r\n#29 0x00000000004ebdd7 in ?? ()\r\n#30 0x00000000005b7167 in PyObject_Call ()\r\n#31 0x00000000005262af in PyEval_EvalFrameEx ()\r\n#32 0x00000000004ed325 in ?? ()\r\n```\r\n",
"Nope, we need the `py-bt`",
"hmm \r\n\r\n`Undefined command: \"py-bt\". Try \"help\".`",
"Got it.\r\n\r\nNeeded:\r\n\r\n`sudo apt-get install gdb python3.5-dbg`\r\n\r\n```\r\n(gdb) py-bt\r\nTraceback (most recent call first):\r\n <built-in method _wrap_socket of SSLContext object at remote 0x7ffff4c43f98>\r\n File \"/usr/lib/python3.5/ssl.py\", line 745, in __init__\r\n server_hostname)\r\n File \"/usr/lib/python3.5/ssl.py\", line 377, in wrap_socket\r\n _context=self)\r\n File \"/usr/lib/python3/dist-packages/urllib3/util/ssl_.py\", line 305, in ssl_wrap_socket\r\n return context.wrap_socket(sock, server_hostname=server_hostname)\r\n File \"/usr/lib/python3/dist-packages/urllib3/connection.py\", line 252, in connect\r\n ssl_version=resolved_ssl_version)\r\n File \"/usr/lib/python3/dist-packages/urllib3/connectionpool.py\", line 787, in _validate_conn\r\n conn.connect()\r\n File \"/usr/lib/python3/dist-packages/urllib3/connectionpool.py\", line 346, in _make_request\r\n self._validate_conn(conn)\r\n File \"/usr/lib/python3/dist-packages/urllib3/connectionpool.py\", line 560, in urlopen\r\n body=body, headers=headers)\r\n File \"/usr/lib/python3/dist-packages/requests/adapters.py\", line 376, in send\r\n timeout=timeout\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 576, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 195, in resolve_redirects\r\n **adapter_kwargs\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 597, in <listcomp>\r\n history = [resp for resp in gen] if allow_redirects else []\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 597, in send\r\n history = [resp for resp in gen] if allow_redirects else []\r\n File \"/usr/lib/python3/dist-packages/requests/sessions.py\", line 468, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/usr/lib/python3/dist-packages/requests/api.py\", line 53, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"/usr/lib/python3/dist-packages/requests/api.py\", line 67, in get\r\n return request('get', url, params=params, **kwargs)\r\n File \"test.py\", line 3, in <module>\r\n```",
"Ok, this segfault is coming from your interpreter. How did you install it?",
"You can reproduce this if you use the following Dockerfile\r\n\r\n```\r\nFROM ubuntu:latest\r\n\r\nRUN apt-get update -y\r\nRUN apt-get install -y python3-pip python3-dev libffi-dev\r\n\r\nRUN apt-get install -y vim\r\n\r\nCOPY requirements.txt /tmp/\r\nRUN pip3 install --requirement /tmp/requirements.txt\r\n```\r\n\r\n`requirements.txt`\r\n\r\n```\r\nrequests==2.18.4\r\n```\r\n\r\n",
"I have the same problems (the unicode ones, not the segmentation fault) in Ubuntu 16.10 with Python 3.6.0b2 and aiohttp==2.2.5\r\n\r\nThis reproduces the problem:\r\n```\r\nimport asyncio\r\nimport aiohttp\r\n\r\n\r\nasync def process():\r\n url = 'http://xn--x9dj.com/'\r\n session = aiohttp.ClientSession()\r\n async with session.get(url) as response:\r\n print(response)\r\n session.close()\r\n\r\nloop = asyncio.get_event_loop()\r\nloop.run_until_complete(\r\n process()\r\n)\r\nloop.close()\r\n```\r\n\r\nTraceback:\r\n```\r\nTraceback (most recent call last):\r\n File \"test.py\", line 14, in <module>\r\n process()\r\n File \"/usr/lib/python3.6/asyncio/base_events.py\", line 449, in run_until_complete\r\n return future.result()\r\n File \"/usr/lib/python3.6/asyncio/tasks.py\", line 239, in _step\r\n result = coro.send(None)\r\n File \"test.py\", line 8, in process\r\n async with session.get(url) as response:\r\n File \"/myenv/lib/python3.6/site-packages/aiohttp/client.py\", line 603, in __aenter__\r\n self._resp = yield from self._coro\r\n File \"/myenv/lib/python3.6/site-packages/aiohttp/client.py\", line 226, in _request\r\n session=self)\r\n File \"/myenv/lib/python3.6/site-packages/aiohttp/client_reqrep.py\", line 96, in __init__\r\n self.update_host(url)\r\n File \"/myenv/lib/python3.6/site-packages/aiohttp/client_reqrep.py\", line 123, in update_host\r\n if not url.host:\r\n File \"/myenv/lib/python3.6/site-packages/yarl/__init__.py\", line 59, in __get__\r\n val = self.wrapped(inst)\r\n File \"/myenv/lib/python3.6/site-packages/yarl/__init__.py\", line 433, in host\r\n return raw.encode('ascii').decode('idna')\r\n File \"/myenv/lib/python3.6/encodings/idna.py\", line 214, in decode\r\n result.append(ToUnicode(label))\r\n File \"/myenv/lib/python3.6/encodings/idna.py\", line 139, in ToUnicode\r\n raise UnicodeError(\"IDNA does not round-trip\", label, label2)\r\nUnicodeError: ('IDNA does not round-trip', b'xn--x9dj', b'xn--c09aja')\r\nUnclosed client session\r\nclient_session: <aiohttp.client.ClientSession object at 0x7fe5774205f8>\r\n```\r\nif I use this domain instead: \r\n\r\n> xn---1-9ld5cqq.com\r\n\r\nThen I get this:\r\n```\r\n\r\nTraceback (most recent call last):\r\n File \"/myenv/lib/python3.6/encodings/idna.py\", line 214, in decode\r\n result.append(ToUnicode(label))\r\n File \"/myenv/lib/python3.6/encodings/idna.py\", line 134, in ToUnicode\r\n label2 = ToASCII(result)\r\n File \"/myenv/lib/python3.6/encodings/idna.py\", line 76, in ToASCII\r\n label = nameprep(label)\r\n File \"/myenv/lib/python3.6/encodings/idna.py\", line 58, in nameprep\r\n raise UnicodeError(\"Violation of BIDI requirement 3\")\r\nUnicodeError: Violation of BIDI requirement 3\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 \"test.py\", line 44, in <module>\r\n process()\r\n File \"/usr/lib/python3.6/asyncio/base_events.py\", line 449, in run_until_complete\r\n return future.result()\r\n File \"/usr/lib/python3.6/asyncio/tasks.py\", line 239, in _step\r\n result = coro.send(None)\r\n File \"test.py\", line 12, in process\r\n async with session.get(url) as response:\r\n File \"/myenv/lib/python3.6/site-packages/aiohttp/client.py\", line 603, in __aenter__\r\n self._resp = yield from self._coro\r\n File \"/myenv/lib/python3.6/site-packages/aiohttp/client.py\", line 226, in _request\r\n session=self)\r\n File \"/myenv/lib/python3.6/site-packages/aiohttp/client_reqrep.py\", line 96, in __init__\r\n self.update_host(url)\r\n File \"/myenv/lib/python3.6/site-packages/aiohttp/client_reqrep.py\", line 123, in update_host\r\n if not url.host:\r\n File \"/myenv/lib/python3.6/site-packages/yarl/__init__.py\", line 59, in __get__\r\n val = self.wrapped(inst)\r\n File \"/myenv/lib/python3.6/site-packages/yarl/__init__.py\", line 433, in host\r\n return raw.encode('ascii').decode('idna')\r\nUnicodeError: decoding with 'idna' codec failed (UnicodeError: Violation of BIDI requirement 3)\r\nUnclosed client session\r\nclient_session: <aiohttp.client.ClientSession object at 0x7f31f464c5f8>\r\n```\r\n\r\nI hope this helps clarifying the problem.\r\nThank you.\r\n",
"Since this is an issue with the Python interpreter and not Requests' code base, I'm going to close this out.\r\n\r\n@steven2308 you appear to be using aiohttp and the stacktrace you've provided doesn't contain any Requests code. It appears you're supplying an invalid URI to IDNA which is causing issues. I suggest you follow up with aiohttp if you feel there's an issue."
] |
https://api.github.com/repos/psf/requests/issues/4284
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4284/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4284/comments
|
https://api.github.com/repos/psf/requests/issues/4284/events
|
https://github.com/psf/requests/issues/4284
| 256,747,992 |
MDU6SXNzdWUyNTY3NDc5OTI=
| 4,284 |
Stream content timeout not working for given site
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8107988?v=4",
"events_url": "https://api.github.com/users/gjthompson1/events{/privacy}",
"followers_url": "https://api.github.com/users/gjthompson1/followers",
"following_url": "https://api.github.com/users/gjthompson1/following{/other_user}",
"gists_url": "https://api.github.com/users/gjthompson1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gjthompson1",
"id": 8107988,
"login": "gjthompson1",
"node_id": "MDQ6VXNlcjgxMDc5ODg=",
"organizations_url": "https://api.github.com/users/gjthompson1/orgs",
"received_events_url": "https://api.github.com/users/gjthompson1/received_events",
"repos_url": "https://api.github.com/users/gjthompson1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gjthompson1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gjthompson1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gjthompson1",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2017-09-11T15:38:46Z
|
2021-09-08T07:00:23Z
|
2017-09-12T05:35:37Z
|
NONE
|
resolved
|
Summary.
I would expect this to timeout but it doesn't.
`r = requests.get('http://mywatchedmovies.com', stream=True, timeout=1)`
But the following does
`r = requests.head('http://mywatchedmovies.com', stream=True, timeout=1)`
Not sure why?
Stackoverflow question: https://stackoverflow.com/questions/46158883/requests-stream-timeout-not-working-for-given-website
## Reproduction Steps
```python
import requests
def fetch_url(url, timeout, max_content, headers):
r = requests.get(url, stream=True, timeout=timeout, headers=headers)
r.raise_for_status()
if int(r.headers.get('Content-Length',0)) > max_content:
raise ValueError('response too large')
content = r.raw.read(max_content+1, decode_content=True)
if len(content) > max_content:
print(url)
raise ValueError('Too large a response')
return {'url':url,'content':content,'status_code':r.status_code}
timeout = 10
max_content = 5000000
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'}
fetch_url('http://mywatchedmovies.com', timeout, max_content, headers)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.5.2"
},
"platform": {
"release": "4.4.0-1032-aws",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4284/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4284/timeline
| null |
completed
| null | null | false |
[
"Uh...this is a weird one.\r\n\r\nRequests timeouts operate on a per-socket-event basis: that is, a timeout of `1` will fire if it takes more than one second for a server to send us some data: any at all. In this case, the server is sending us *plenty* of data.\r\n\r\nThe server is returning a 302 redirect to `login.php`. We would like to re-use that TCP connection for the next request, so we attempt to drain the response body. However, the response body is chunk-transfer-encoded, and seems to be completely endless: after an initial 746-byte chunk that contains some actual content the server just repeatedly sends the exact same 307-byte chunk endlessly forever. Because the server is active the whole time we never time out: we just get stuck in a loop trying to drain this socket, and fail.\r\n\r\nWhat the hell is going on with this broken-ass server?",
"Lukas: Thanks for getting back to me, I don't really need the data coming back I basically just don't want it to break my script. If I use `requests.head()` I get the timeout, which is good. Basically I am trying to weed out junk sites. I could add in `requests.head()` but then am I not hitting the server twice? I have to do many millions of domains as efficiently as possible. Do you have any suggestions?",
"In this case it's hard to do: due to a patch added a while back you can't prevent Requests trying to follow a redirect. ☹️\r\n\r\nIn this case, you can try doing `head()`. You will hit the server twice, but only one TCP connection will be used. ",
"This is probably a noob question but is it a correct reading of http://docs.python-requests.org/en/master/user/advanced/?highlight=tcp#session-objects\r\n\r\nThat each method `get()` and `head()` is initializing a new session and a new TCP connections? So if I wanted to use the same connection I should use something like this:\r\n```\r\ns = requests.Session()\r\ns.head(url)\r\ns.get(url)\r\n```\r\n\r\nRather than:\r\n```\r\nrequests.head(url)\r\nrequests.get(url)\r\n```\r\n\r\nOr is that implicitly \"kept alive\" somehow?",
"To me this:\r\n\r\nhttps://stackoverflow.com/questions/24873927/python-requests-module-and-connection-reuse\r\n\r\nIs saying that the following is sufficient.\r\n\r\n```\r\nrequests.head(url)\r\nrequests.get(url)\r\n```\r\n\r\nAs:\r\n\r\n> The requests module is not stateless; it just lets you ignore the state and effectively use a global singleton state if you choose to do so.*\r\n> \r\n> And it (or, rather, one of the underlying libraries, urllib3) maintains a connection pool keyed by (hostname, port) pair, so it will usually just magically reuse a connection if it can.\r\n\r\nAlthough.\r\n\r\n> Note that connections are only released back to the pool for reuse once all body data has been read; be sure to either set stream to False or read the content property of the Response object.\r\n\r\nSo does that mean.\r\n\r\n```\r\ns = requests.Session()\r\ns.head(url,stream=True)\r\ns.get(url,stream=True)\r\n```\r\n\r\nIs needed if `stream=True`. \r\n\r\nI guess you probably don't need `stream=True` for `head()`",
"If you want to connection pool you must use a `Session`.",
"Thank you sir. If you want to close this issue feel free. I have pulled down hundreds of millions of domains with requests and there has only been a few edge cases. Not sure if this one is worth your time. Appreciate what you do."
] |
https://api.github.com/repos/psf/requests/issues/4283
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4283/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4283/comments
|
https://api.github.com/repos/psf/requests/issues/4283/events
|
https://github.com/psf/requests/pull/4283
| 256,530,171 |
MDExOlB1bGxSZXF1ZXN0MTQwMjE5ODI5
| 4,283 |
Pep8ify
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4304764?v=4",
"events_url": "https://api.github.com/users/cuonglm/events{/privacy}",
"followers_url": "https://api.github.com/users/cuonglm/followers",
"following_url": "https://api.github.com/users/cuonglm/following{/other_user}",
"gists_url": "https://api.github.com/users/cuonglm/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cuonglm",
"id": 4304764,
"login": "cuonglm",
"node_id": "MDQ6VXNlcjQzMDQ3NjQ=",
"organizations_url": "https://api.github.com/users/cuonglm/orgs",
"received_events_url": "https://api.github.com/users/cuonglm/received_events",
"repos_url": "https://api.github.com/users/cuonglm/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cuonglm/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cuonglm/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cuonglm",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-09-10T18:37:47Z
|
2021-09-04T00:06:50Z
|
2017-09-10T18:39:09Z
|
NONE
|
resolved
|
PEP8 forbids inventing __double_leading_and_trailing_underscore__
name, so don't do it.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4283/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4283/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4283.diff",
"html_url": "https://github.com/psf/requests/pull/4283",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4283.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4283"
}
| true |
[
"The first rule of PEP8 is that a foolish consistency is the hobgoblin of little minds. In this case, the double-underscore is safe and reasonable. :smile:",
"@Lukasa Why is it safe since when we don't know when Python core add such thing?\r\n\r\nIt also makes someone new to Python think that `__attrs__` is a magic method when it doesn't. `requests` code base is great and recommended to read in many sources, IMHO, it's a poor choice for chosing such name.",
"Because there's no need for us to be predictive. Requests is one of the most widely-used Python packages: we'll know when such a thing is added, if for no other reason than because most of the Python core team uses Requests and will spot the problem if and when it's introduced. So for now we're in a safe place.",
"e.g. people probably rely on this — we don't want to change anything, especially for pedantic reasons, unless we have a good reason to. "
] |
https://api.github.com/repos/psf/requests/issues/4282
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4282/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4282/comments
|
https://api.github.com/repos/psf/requests/issues/4282/events
|
https://github.com/psf/requests/pull/4282
| 256,518,326 |
MDExOlB1bGxSZXF1ZXN0MTQwMjEzMzAy
| 4,282 |
New HTTPHeaderDict class for response headers with multiple header value support
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4016213?v=4",
"events_url": "https://api.github.com/users/the-allanc/events{/privacy}",
"followers_url": "https://api.github.com/users/the-allanc/followers",
"following_url": "https://api.github.com/users/the-allanc/following{/other_user}",
"gists_url": "https://api.github.com/users/the-allanc/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/the-allanc",
"id": 4016213,
"login": "the-allanc",
"node_id": "MDQ6VXNlcjQwMTYyMTM=",
"organizations_url": "https://api.github.com/users/the-allanc/orgs",
"received_events_url": "https://api.github.com/users/the-allanc/received_events",
"repos_url": "https://api.github.com/users/the-allanc/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/the-allanc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/the-allanc/subscriptions",
"type": "User",
"url": "https://api.github.com/users/the-allanc",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 17 |
2017-09-10T15:36:22Z
|
2021-09-04T00:06:50Z
|
2017-09-12T22:41:31Z
|
NONE
|
resolved
|
I personally wanted something like this while writing [my own Requests-related library](https://github.com/the-allanc/pyriform), but I can see other people also have wanted something like this - #3957 and #4214 both mention it in terms of handling `Set-Cookie` headers.
I've written an subclass implementation of `CaseInsensitiveDict` which is compatible with all the current usage (according to the tests), but adds new methods for clients that want to deal directly with unjoined headers. I've also added quite a number of tests and made slight changes to the documentation in relation to it.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4016213?v=4",
"events_url": "https://api.github.com/users/the-allanc/events{/privacy}",
"followers_url": "https://api.github.com/users/the-allanc/followers",
"following_url": "https://api.github.com/users/the-allanc/following{/other_user}",
"gists_url": "https://api.github.com/users/the-allanc/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/the-allanc",
"id": 4016213,
"login": "the-allanc",
"node_id": "MDQ6VXNlcjQwMTYyMTM=",
"organizations_url": "https://api.github.com/users/the-allanc/orgs",
"received_events_url": "https://api.github.com/users/the-allanc/received_events",
"repos_url": "https://api.github.com/users/the-allanc/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/the-allanc/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/the-allanc/subscriptions",
"type": "User",
"url": "https://api.github.com/users/the-allanc",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4282/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4282/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4282.diff",
"html_url": "https://github.com/psf/requests/pull/4282",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4282.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4282"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4282?src=pr&el=h1) Report\n> Merging [#4282](https://codecov.io/gh/requests/requests/pull/4282?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/fdb9b753b47e7abead1ec75d860c9c9b929ca5f5?src=pr&el=desc) will **increase** coverage by `0.26%`.\n> The diff coverage is `98.36%`.\n\n[](https://codecov.io/gh/requests/requests/pull/4282?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4282 +/- ##\n==========================================\n+ Coverage 88.66% 88.93% +0.26% \n==========================================\n Files 18 18 \n Lines 2021 2079 +58 \n==========================================\n+ Hits 1792 1849 +57 \n- Misses 229 230 +1\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4282?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/adapters.py](https://codecov.io/gh/requests/requests/pull/4282?src=pr&el=tree#diff-cmVxdWVzdHMvYWRhcHRlcnMucHk=) | `92.99% <100%> (ø)` | :arrow_up: |\n| [requests/structures.py](https://codecov.io/gh/requests/requests/pull/4282?src=pr&el=tree#diff-cmVxdWVzdHMvc3RydWN0dXJlcy5weQ==) | `98.97% <98.3%> (-1.03%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4282?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4282?src=pr&el=footer). Last update [fdb9b75...5cbd6dd](https://codecov.io/gh/requests/requests/pull/4282?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"I generally like this. \r\n\r\nThis should be a PR against the `proposed/3.0.0` branch, though, not master. ",
"I also wouldn't be opposed to the name `CaseInsensitiveMultiDict`",
"I haven't checked, but I'd like this API to be compatible with Flask/Werkzeug's MultiDict, if possible. ",
"In general though, this looks real solid! ✨🍰✨",
"Good job with the tests too :cookie:",
"You get a cookie. ",
"I also really like that this is a subclass of `CaseInsensitiveDict`. ",
"With regards to MultiDict in werkzeug, it uses `getlist` and `setlist`. HTTPHeaderDict in urllib3 also uses `getlist` (it has no `setlist` equivalent). I was going to use the same naming convention, except that I'm storing and returning tuples.\r\n\r\nI did have concerns about the lists being modified outside of HTTPHeaderDict (which tries to enforce that only string types are present). So it's either a case of::\r\n- Leaving the names as they are.\r\n- Using \"list\" names even though we're returning tuples.\r\n- Rename the methods and return lists (either copies or the underlying sequence).",
"Renaming `HTTPHeaderDict` to `MultiCaseInsensitiveDict` is a bit more contentious - because it's not a generalised class (it's intended for string values only).\r\n\r\nThe main intent was to keep the exact same behaviour that we had in requests for response header processing, but to handle the concatenation of values ourselves (rather than letting urllib3 to do it for us). The concatenation of values is specific to HTTP headers (comma separation).\r\n\r\nI could refactor part of the code and extract the `Multi...` part of the class into a separate class, and then inherit from that. We would need to decide what happens for general item access (I note that `MultiDict` returns just the first item).",
"I think what you have is good, then, unless we cast to lists. ",
"Which seems silly to me. ",
"I just wanted to provide a very familiar API to those who have used similar APIs before. ",
"I've just always liked the name `CaseInsensitiveMultiDict`, and wish we had it. This is good though.",
"OK, I've renamed the methods to `getlist` and `setlist`, and they now return lists, so that's more consistent with other implementations. Both urllib3 and werkzeug provide copies of the sequences, so we also do the same (we still use tuples under the hood, which makes me happy).\r\n\r\nI was going to try and extract some of the code into a `CaseInsensitiveMultiDict` class, but there's too much nuance in trying to determine the best behaviour for such a generalised class (especially for the `extend` method, which tries to distinguish between items and sequences - how should it behave if you're using the dictionary to store sequences of sequences?)\r\n\r\nI've made sure that this class is entirely backwards compatible with what we were using before - I wrote some of the tests using `CaseInsensitiveDict` and they still worked when I switched to `HTTPHeaderDict` for responses. Are you sure that you still want it against the `proposed/3.0.0` branch? ",
"@the-allanc definitely :)\r\n\r\nP.S. good work!",
"In that case, I'm closing this pull request in favour of #4290."
] |
https://api.github.com/repos/psf/requests/issues/4281
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4281/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4281/comments
|
https://api.github.com/repos/psf/requests/issues/4281/events
|
https://github.com/psf/requests/issues/4281
| 256,439,549 |
MDU6SXNzdWUyNTY0Mzk1NDk=
| 4,281 |
When running lib under PyPy -X track-resources WARNING about unclosed socket object raised
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12595191?v=4",
"events_url": "https://api.github.com/users/davit555/events{/privacy}",
"followers_url": "https://api.github.com/users/davit555/followers",
"following_url": "https://api.github.com/users/davit555/following{/other_user}",
"gists_url": "https://api.github.com/users/davit555/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/davit555",
"id": 12595191,
"login": "davit555",
"node_id": "MDQ6VXNlcjEyNTk1MTkx",
"organizations_url": "https://api.github.com/users/davit555/orgs",
"received_events_url": "https://api.github.com/users/davit555/received_events",
"repos_url": "https://api.github.com/users/davit555/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/davit555/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/davit555/subscriptions",
"type": "User",
"url": "https://api.github.com/users/davit555",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-09-09T13:39:02Z
|
2021-09-08T07:00:23Z
|
2017-09-09T16:07:00Z
|
NONE
|
resolved
|
Closing this socket object further passed to pypy garbage collector.
What I found from PyPy documentation is
To the best of our knowledge this problem has no better solution than fixing the programs. If it occurs in 3rd-party code, this means going to the authors and explaining the problem to them: they need to close their open files in order to run on any non-CPython-based implementation of Python.
Here is the [link](http://doc.pypy.org/en/latest/cpython_differences.html)
tried with requests=2.18.4, pypy=5.6
Here is the trace
```
ERROR 2017-09-09 17:29:30,345 log:29 STDERR import requests
ERROR 2017-09-09 17:29:30,345 log:29 STDERR File "/home/davit/venvs/pypy-5.6/site-packages/requests/__init__.py", line 43, in <module>
ERROR 2017-09-09 17:29:30,345 log:29 STDERR import urllib3
ERROR 2017-09-09 17:29:30,345 log:29 STDERR File "/home/davit/venvs/pypy-5.6/site-packages/urllib3/__init__.py", line 8, in <module>
ERROR 2017-09-09 17:29:30,346 log:29 STDERR from .connectionpool import (
ERROR 2017-09-09 17:29:30,346 log:29 STDERR File "/home/davit/venvs/pypy-5.6/site-packages/urllib3/connectionpool.py", line 29, in <module>
ERROR 2017-09-09 17:29:30,346 log:29 STDERR from .connection import (
ERROR 2017-09-09 17:29:30,346 log:29 STDERR File "/home/davit/venvs/pypy-5.6/site-packages/urllib3/connection.py", line 39, in <module>
ERROR 2017-09-09 17:29:30,346 log:29 STDERR from .util.ssl_ import (
ERROR 2017-09-09 17:29:30,346 log:29 STDERR File "/home/davit/venvs/pypy-5.6/site-packages/urllib3/util/__init__.py", line 3, in <module>
ERROR 2017-09-09 17:29:30,346 log:29 STDERR from .connection import is_connection_dropped
ERROR 2017-09-09 17:29:30,346 log:29 STDERR File "/home/davit/venvs/pypy-5.6/site-packages/urllib3/util/connection.py", line 130, in <module>
ERROR 2017-09-09 17:29:30,346 log:29 STDERR HAS_IPV6 = _has_ipv6('::1')
ERROR 2017-09-09 17:29:30,346 log:29 STDERR File "/home/davit/venvs/pypy-5.6/site-packages/urllib3/util/connection.py", line 119, in _has_ipv6
ERROR 2017-09-09 17:29:30,346 log:29 STDERR sock = socket.socket(socket.AF_INET6)
ERROR 2017-09-09 17:29:30,347 log:29 STDERR File "/home/davit/venvs/pypy-5.6/site-packages/gevent/socket.py", line 227, in __init__
ERROR 2017-09-09 17:29:30,347 log:29 STDERR self._sock = _realsocket(family, type, proto)
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4281/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4281/timeline
| null |
completed
| null | null | false |
[
"The traceback you have there is from urllib3: please open the issue there. "
] |
https://api.github.com/repos/psf/requests/issues/4280
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4280/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4280/comments
|
https://api.github.com/repos/psf/requests/issues/4280/events
|
https://github.com/psf/requests/issues/4280
| 255,642,008 |
MDU6SXNzdWUyNTU2NDIwMDg=
| 4,280 |
Is log
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18706241?v=4",
"events_url": "https://api.github.com/users/oceanlazy/events{/privacy}",
"followers_url": "https://api.github.com/users/oceanlazy/followers",
"following_url": "https://api.github.com/users/oceanlazy/following{/other_user}",
"gists_url": "https://api.github.com/users/oceanlazy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/oceanlazy",
"id": 18706241,
"login": "oceanlazy",
"node_id": "MDQ6VXNlcjE4NzA2MjQx",
"organizations_url": "https://api.github.com/users/oceanlazy/orgs",
"received_events_url": "https://api.github.com/users/oceanlazy/received_events",
"repos_url": "https://api.github.com/users/oceanlazy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/oceanlazy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/oceanlazy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/oceanlazy",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2017-09-06T15:17:04Z
|
2021-09-08T07:00:25Z
|
2017-09-06T15:31:09Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4280/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4280/timeline
| null |
completed
| null | null | false |
[] |
|
https://api.github.com/repos/psf/requests/issues/4279
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4279/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4279/comments
|
https://api.github.com/repos/psf/requests/issues/4279/events
|
https://github.com/psf/requests/issues/4279
| 255,640,330 |
MDU6SXNzdWUyNTU2NDAzMzA=
| 4,279 |
FR: Allow SSL verification to be disabled with an env var
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/362148?v=4",
"events_url": "https://api.github.com/users/boosh/events{/privacy}",
"followers_url": "https://api.github.com/users/boosh/followers",
"following_url": "https://api.github.com/users/boosh/following{/other_user}",
"gists_url": "https://api.github.com/users/boosh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/boosh",
"id": 362148,
"login": "boosh",
"node_id": "MDQ6VXNlcjM2MjE0OA==",
"organizations_url": "https://api.github.com/users/boosh/orgs",
"received_events_url": "https://api.github.com/users/boosh/received_events",
"repos_url": "https://api.github.com/users/boosh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/boosh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/boosh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/boosh",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-09-06T15:12:28Z
|
2021-09-08T07:00:24Z
|
2017-09-06T17:39:45Z
|
NONE
|
resolved
|
Summary.
Lots of libraries use `requests`. If there's an error verifying SSL in a third-party library it'd be useful to be able to just set an env var to disable SSL verification while the issue is fixed in the failing library.
This issue is currently affecting me and [others](https://github.com/GoogleCloudPlatform/google-auth-library-python/issues/192) after upgrading `google-cloud`. Even modifying that library to pass `verify=False` would be no mean feat.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4279/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4279/timeline
| null |
completed
| null | null | false |
[
"I guess it'd make sense if it used the `PYTHONHTTPSVERIFY` env var that [urllib](https://www.python.org/dev/peps/pep-0493/) uses.",
"@boosh, I believe this has been discussed and soundly rejected before. Please search open **and** closed issues prior to opening new ones. \r\n\r\nFurther, the PEP you're referencing is not intended to be used like this. For one thing, it was added because the standard library was *insecure by default* and the transition to making it secure by default was deemed problematic by some. This was an escape hatch to avoid having to update a formerly insecure block of code to properly handle being secure. I don't fully understand what is happening with `google-cloud` but I suspect that the solution to their problem doesn't actually belong here.",
"This has been requested before and I think our position is the same: global switches to disable certificate validation are an attractive nuisance that tend to be used to mask actual problems. \r\n\r\nI don't think the brokenness of other libraries requires us to provide this functionality. "
] |
https://api.github.com/repos/psf/requests/issues/4278
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4278/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4278/comments
|
https://api.github.com/repos/psf/requests/issues/4278/events
|
https://github.com/psf/requests/issues/4278
| 255,582,156 |
MDU6SXNzdWUyNTU1ODIxNTY=
| 4,278 |
python -c "import requests" got a lot slower
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/477278?v=4",
"events_url": "https://api.github.com/users/gtrainavicius/events{/privacy}",
"followers_url": "https://api.github.com/users/gtrainavicius/followers",
"following_url": "https://api.github.com/users/gtrainavicius/following{/other_user}",
"gists_url": "https://api.github.com/users/gtrainavicius/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gtrainavicius",
"id": 477278,
"login": "gtrainavicius",
"node_id": "MDQ6VXNlcjQ3NzI3OA==",
"organizations_url": "https://api.github.com/users/gtrainavicius/orgs",
"received_events_url": "https://api.github.com/users/gtrainavicius/received_events",
"repos_url": "https://api.github.com/users/gtrainavicius/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gtrainavicius/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gtrainavicius/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gtrainavicius",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 19 |
2017-09-06T12:13:41Z
|
2021-09-08T05:00:53Z
|
2017-11-25T15:14:48Z
|
NONE
|
resolved
|
We have noticed that 'import requests' statement started taking roughly 3 times more time between versions 2.12.0 (bad) and 2.11.1 (last known good), the difference is especially visible running on Raspberry Pi 3.
## Expected Result
'import requests' execution time should not increase by 3-4 times between versions.
## Actual Result
3-4 times slower 'import requests' execution.
## Reproduction Steps
```
pi@raspberrypi:~ $ sudo pip install 'requests<2.12.1'
Collecting requests<2.12.1
Downloading requests-2.12.0-py2.py3-none-any.whl (574kB)
100% |████████████████████████████████| 583kB 363kB/s
Installing collected packages: requests
Found existing installation: requests 2.12.1
Uninstalling requests-2.12.1:
Successfully uninstalled requests-2.12.1
Successfully installed requests-2.12.0
pi@raspberrypi:~ $ time python -c "import requests"
real 0m1.761s
user 0m1.640s
sys 0m0.080s
pi@raspberrypi:~ $ sudo pip install 'requests<2.12.0'
Collecting requests<2.12.0
Using cached requests-2.11.1-py2.py3-none-any.whl
Installing collected packages: requests
Found existing installation: requests 2.12.0
Uninstalling requests-2.12.0:
Successfully uninstalled requests-2.12.0
Successfully installed requests-2.11.1
pi@raspberrypi:~ $ time python -c "import requests"
real 0m0.420s
user 0m0.370s
sys 0m0.040s
```
## System Information
```
pi@raspberrypi:~ $ python --version
Python 2.7.13
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
```
Raspbian Stretch.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/477278?v=4",
"events_url": "https://api.github.com/users/gtrainavicius/events{/privacy}",
"followers_url": "https://api.github.com/users/gtrainavicius/followers",
"following_url": "https://api.github.com/users/gtrainavicius/following{/other_user}",
"gists_url": "https://api.github.com/users/gtrainavicius/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gtrainavicius",
"id": 477278,
"login": "gtrainavicius",
"node_id": "MDQ6VXNlcjQ3NzI3OA==",
"organizations_url": "https://api.github.com/users/gtrainavicius/orgs",
"received_events_url": "https://api.github.com/users/gtrainavicius/received_events",
"repos_url": "https://api.github.com/users/gtrainavicius/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gtrainavicius/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gtrainavicius/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gtrainavicius",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4278/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4278/timeline
| null |
completed
| null | null | false |
[
"I found this similar issue: https://github.com/requests/requests/issues/3213 maybe it's relevant.",
"What other packages do you have installed? Specifically, it's likely that you have ancient versions of pyOpenSSL and Cryptography installed which are causing this.",
"After upgarding pyOpenSSL from 16.2 to 17.2 (which implicitly upgraded cryptography to 2.0.3, not sure from which previous version) and using latest requests version (2.18.4) the time improved to:\r\n\r\n```\r\nreal 0m0.854s\r\nuser 0m0.760s\r\nsys 0m0.070s\r\n```\r\n\r\nThat is still, however, considerably larger than what requests-2.11.1 used to be. Do you have any other ideas?",
"Now the python -m requests.help worked on the latest version, here is the output:\r\n\r\n```\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"2.0.3\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"2.7.13\"\r\n },\r\n \"platform\": {\r\n \"release\": \"4.9.41-v7+\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010006f\",\r\n \"version\": \"17.2.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1010006f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n },\r\n \"using_pyopenssl\": true\r\n}\r\n```",
"There are *a lot* of changes between 2.11.x and the latest version. For example, we now depend on idna as well which if I remember correctly used to also be rather slow to import. I wonder what kind of performance you see if you use a virtualenv without pyOpenSSL installed with 2.18.x",
"We should warn on old pyOpenSSLs for slowness.",
"I'd like to add warnings for older versions pyOpenSSL. Should I open a new issue?",
"yes",
"Still, warning won't solve twice as long time for importing than it used to be in older versions... Is there something more that could be done?",
"Related: https://github.com/requests/requests/issues/4315",
"One big change between 2.11 and 2.12 is `chardet` dependency.",
"But chardet takes only 10~20% of import time on amd64 machine.\r\n\r\n@gtrainavicius Could you try `time python -c 'import chardet'`?\r\n\r\nAnd could you try `python -v -c 'import requests' 2> request-import.txt` and post it to gist?",
"```\r\npi@raspberrypi:~ $ time python -c 'import chardet'\r\n\r\nreal 0m0.098s\r\nuser 0m0.080s\r\nsys 0m0.020s\r\npi@raspberrypi:~ $ time python -c 'import chardet'\r\n\r\nreal 0m0.052s\r\nuser 0m0.050s\r\nsys 0m0.000s\r\npi@raspberrypi:~ $ time python -c 'import chardet'\r\n\r\nreal 0m0.099s\r\nuser 0m0.090s\r\nsys 0m0.000s\r\n\r\npi@raspberrypi:~ $ time python -c 'import requests'\r\n\r\nreal 0m0.821s\r\nuser 0m0.730s\r\nsys 0m0.070s\r\npi@raspberrypi:~ $ time python -c 'import requests'\r\n\r\nreal 0m0.844s\r\nuser 0m0.720s\r\nsys 0m0.110s\r\npi@raspberrypi:~ $ python -v -c 'import requests' 2> requests-import.txt\r\n```\r\n\r\nThe output is available here: https://pastebin.com/qAvhRbVK",
"L325 imports `OpenSSL` which is the module for `pyOpenSSL`. This leads to an import of `cryptography` which also imports `asn1crypto`\r\n\r\nCan you try the following:\r\n\r\n```\r\ntime python -c 'import cryptography.x509'\r\ntime python -c 'import cryptography.hazmat.primitives.asymmetric'\r\ntime python -c 'import asn1crypto'\r\ntime python -c 'import asn1crypto.parser'\r\n```\r\n\r\nIf you're still using the versions of our dependencies that you mentioned, I'm frankly surprised you're seeing this behaviour.",
"Hey, the versions did change, pasting the updated information below. Also the above requests-import.txt was produced running requests-2.12.4. Just in case I will create another one using the latest version (requests-2.18.4): https://pastebin.com/3fdTuyR1 - it also contains 'import' time info at the top.\r\n\r\n```\r\n{\r\n \"chardet\": {\r\n \"version\": \"3.0.4\"\r\n },\r\n \"cryptography\": {\r\n \"version\": \"2.1.3\"\r\n },\r\n \"idna\": {\r\n \"version\": \"2.6\"\r\n },\r\n \"implementation\": {\r\n \"name\": \"CPython\",\r\n \"version\": \"2.7.13\"\r\n },\r\n \"platform\": {\r\n \"release\": \"4.9.61-v7+\",\r\n \"system\": \"Linux\"\r\n },\r\n \"pyOpenSSL\": {\r\n \"openssl_version\": \"1010006f\",\r\n \"version\": \"17.3.0\"\r\n },\r\n \"requests\": {\r\n \"version\": \"2.18.4\"\r\n },\r\n \"system_ssl\": {\r\n \"version\": \"1010006f\"\r\n },\r\n \"urllib3\": {\r\n \"version\": \"1.22\"\r\n },\r\n \"using_pyopenssl\": true\r\n}\r\n```\r\n\r\nHere are the cryptography import timings:\r\n\r\n```\r\npi@raspberrypi:~ $ time python -c 'import cryptography.x509'\r\n\r\nreal 0m0.528s\r\nuser 0m0.500s\r\nsys 0m0.020s\r\npi@raspberrypi:~ $ time python -c 'import cryptography.hazmat.primitives.asymmetric'\r\n\r\nreal 0m0.123s\r\nuser 0m0.080s\r\nsys 0m0.030s\r\npi@raspberrypi:~ $ time python -c 'import asn1crypto'\r\n\r\nreal 0m0.099s\r\nuser 0m0.080s\r\nsys 0m0.010s\r\npi@raspberrypi:~ $ time python -c 'import asn1crypto.parser'\r\n\r\nreal 0m0.244s\r\nuser 0m0.220s\r\nsys 0m0.020s\r\n```",
"Yep, so as I expected, there's a total of .995s just in Cryptography (and its imports). With chardet at .05 that puts us over 1s easily.\r\n\r\nIt's possible that the chardet import may get slower. We're investigating relying on CFFI or Cython to improve its performance.\r\n\r\n@gtrainavicius I wonder, you're using Python 2.7.13 and you have pyOpenSSL installed, is there a reason for that?",
"No reason, pyOpenSSL was installed by default on Raspbian, though not the latest version.\r\n\r\nWhat we really want is to have requests library as fast as in the older versions, in our scripts that depend on it we're not using almost any other libraries...",
"@gtrainavicius the problem, however, is that Requests expects users to manage their environment appropriately. This means that we expect users to know if we need `pyOpenSSL` for security and have it installed (or not) in their environment. What's taking up almost all of th etime you're experiencing is `pyOpenSSL` and its dependencies. I think there's nothing more we can do to help with this.",
"Ah, it didn't occur to me that pyOpenSSL was optional. With it uninstalled, the time to import requests seems close enough to what it used to be:\r\n\r\npi@raspberrypi:~ $ time python -c 'import requests'\r\n\r\nreal 0m0.488s\r\nuser 0m0.420s\r\nsys 0m0.050s"
] |
https://api.github.com/repos/psf/requests/issues/4277
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4277/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4277/comments
|
https://api.github.com/repos/psf/requests/issues/4277/events
|
https://github.com/psf/requests/pull/4277
| 255,379,980 |
MDExOlB1bGxSZXF1ZXN0MTM5Mzk5OTQ0
| 4,277 |
Update allow_redirects docstrings defaults
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8859114?v=4",
"events_url": "https://api.github.com/users/geokala/events{/privacy}",
"followers_url": "https://api.github.com/users/geokala/followers",
"following_url": "https://api.github.com/users/geokala/following{/other_user}",
"gists_url": "https://api.github.com/users/geokala/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/geokala",
"id": 8859114,
"login": "geokala",
"node_id": "MDQ6VXNlcjg4NTkxMTQ=",
"organizations_url": "https://api.github.com/users/geokala/orgs",
"received_events_url": "https://api.github.com/users/geokala/received_events",
"repos_url": "https://api.github.com/users/geokala/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/geokala/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/geokala/subscriptions",
"type": "User",
"url": "https://api.github.com/users/geokala",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 7 |
2017-09-05T19:16:55Z
|
2021-08-31T00:07:11Z
|
2018-03-08T18:05:14Z
|
NONE
|
resolved
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4277/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4277/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4277.diff",
"html_url": "https://github.com/psf/requests/pull/4277",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4277.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4277"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4277?src=pr&el=h1) Report\n> Merging [#4277](https://codecov.io/gh/requests/requests/pull/4277?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/fdb9b753b47e7abead1ec75d860c9c9b929ca5f5?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4277?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4277 +/- ##\n=======================================\n Coverage 88.66% 88.66% \n=======================================\n Files 18 18 \n Lines 2021 2021 \n=======================================\n Hits 1792 1792 \n Misses 229 229\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4277?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [requests/sessions.py](https://codecov.io/gh/requests/requests/pull/4277?src=pr&el=tree#diff-cmVxdWVzdHMvc2Vzc2lvbnMucHk=) | `95.55% <ø> (ø)` | :arrow_up: |\n| [requests/api.py](https://codecov.io/gh/requests/requests/pull/4277?src=pr&el=tree#diff-cmVxdWVzdHMvYXBpLnB5) | `81.81% <ø> (ø)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4277?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4277?src=pr&el=footer). Last update [fdb9b75...853a4c4](https://codecov.io/gh/requests/requests/pull/4277?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"This is still relevant imho, do you think we can reopen this PR, @kenneth-reitz @Lukasa ?",
"Well, that's a blast from the past. I'm happy to fix it- does it just require the removal of that second, incorrectly updated, docstring?",
"@geokala I suppose it is. :) If it's of no relevance for you at this point, I will be equally happy to take this over.",
"Just ran into this myself, would be great if this could be merged so as to not cause confusion.",
"@Unit03 Happy for you to take it over if you're happy to.",
"@geokala I will do just that, then, thank you for your input. :)\r\n\r\n@Lukasa I've addressed your remarks and opened a new PR (to not take more of @geokala's time): #5127 - but I'd be ok to contribute this change in some other way if you think it's appropriate."
] |
|
https://api.github.com/repos/psf/requests/issues/4276
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4276/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4276/comments
|
https://api.github.com/repos/psf/requests/issues/4276/events
|
https://github.com/psf/requests/issues/4276
| 255,377,456 |
MDU6SXNzdWUyNTUzNzc0NTY=
| 4,276 |
Something more robust to deal with the following
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8107988?v=4",
"events_url": "https://api.github.com/users/gjthompson1/events{/privacy}",
"followers_url": "https://api.github.com/users/gjthompson1/followers",
"following_url": "https://api.github.com/users/gjthompson1/following{/other_user}",
"gists_url": "https://api.github.com/users/gjthompson1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gjthompson1",
"id": 8107988,
"login": "gjthompson1",
"node_id": "MDQ6VXNlcjgxMDc5ODg=",
"organizations_url": "https://api.github.com/users/gjthompson1/orgs",
"received_events_url": "https://api.github.com/users/gjthompson1/received_events",
"repos_url": "https://api.github.com/users/gjthompson1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gjthompson1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gjthompson1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gjthompson1",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-09-05T19:06:44Z
|
2021-09-08T07:00:25Z
|
2017-09-05T19:54:21Z
|
NONE
|
resolved
|
Summary.
Seems a little overkill to have to do https://stackoverflow.com/questions/22346158/python-requests-how-to-limit-received-size-transfer-rate-and-or-total-time to deal with sites like the below. Would be nice to have that built in. But maybe thats asking to much.
Question on Stack: https://stackoverflow.com/questions/46061786/python-requests-timeout-not-working/46061958#46061958
## Expected Result
Error with running:
requests.get('http://arboleascity.com',timeout=(5,5),verify=False)
What you expected.
Would timeout in 5 seconds. But it does not. It works 99.9% of the time but for this site it does not.
Probably a bug. Any help?
## Reproduction Steps
```python
import requests
requests.get('http://arboleascity.com',timeout=(5,5),verify=False)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.5.2"
},
"platform": {
"release": "4.4.0-1032-aws",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000207f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/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/4276/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4276/timeline
| null |
completed
| null | null | false |
[
"The answer is in your StackOverflow question. Your connection is likely taking less than 5 seconds and you're probably receiving some data at least once every 5 seconds. What you seem to be expecting is some kind of total timeout on the time it takes to complete downloading the response and that's not something that we can provide at this point in time.\r\n\r\nYou can search closed issues for other discussions of this and look specifically for \"total timeout\" or \"wall clock timeout\". There are other 3rd party solutions that can help you achieve your goal."
] |
https://api.github.com/repos/psf/requests/issues/4275
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4275/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4275/comments
|
https://api.github.com/repos/psf/requests/issues/4275/events
|
https://github.com/psf/requests/issues/4275
| 255,227,171 |
MDU6SXNzdWUyNTUyMjcxNzE=
| 4,275 |
Requests tries to resolve `user:pass@host` on OS X
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/107611?v=4",
"events_url": "https://api.github.com/users/mattbennett/events{/privacy}",
"followers_url": "https://api.github.com/users/mattbennett/followers",
"following_url": "https://api.github.com/users/mattbennett/following{/other_user}",
"gists_url": "https://api.github.com/users/mattbennett/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mattbennett",
"id": 107611,
"login": "mattbennett",
"node_id": "MDQ6VXNlcjEwNzYxMQ==",
"organizations_url": "https://api.github.com/users/mattbennett/orgs",
"received_events_url": "https://api.github.com/users/mattbennett/received_events",
"repos_url": "https://api.github.com/users/mattbennett/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mattbennett/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mattbennett/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mattbennett",
"user_view_type": "public"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 117744,
"name": "Bug",
"node_id": "MDU6TGFiZWwxMTc3NDQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Bug"
},
{
"color": "69ccdb",
"default": false,
"description": null,
"id": 773540467,
"name": "PR(s) Wanted",
"node_id": "MDU6TGFiZWw3NzM1NDA0Njc=",
"url": "https://api.github.com/repos/psf/requests/labels/PR(s)%20Wanted"
}
] |
closed
| true | null |
[] | null | 1 |
2017-09-05T10:13:27Z
|
2021-09-08T04:00:51Z
|
2018-01-16T14:07:27Z
|
NONE
|
resolved
|
If you have proxy bypass settings, requests tries to resolve the hostname before stripping credentials from the URL.
It looks like this happens because the [proxy bypass](https://github.com/requests/requests/blob/4bda7b66e7ece5be51b459edd046a70915b4792c/requests/utils.py#L78) logic is called before [urldefragauth](https://github.com/requests/requests/blob/b9638ec7be9134786e28684ca17f3d161297ac5e/requests/utils.py#L879) strips the credentials from the URL.
## Expected Result
Should not try to resolve an invalid hostname.
## Actual Result
DNS resolution for `user:pass@host` is made:

## Reproduction Steps
On OS X with proxy bypass hosts configured:

```python
import requests
requests.get('http://user:pass@localhost')
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.10"
},
"platform": {
"release": "15.6.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4275/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4275/timeline
| null |
completed
| null | null | false |
[
"So this seems to be an issue with macOS specifically, and in particular how it handles proxy bypass. We should probably strip the auth from the host before we bypass. "
] |
https://api.github.com/repos/psf/requests/issues/4274
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4274/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4274/comments
|
https://api.github.com/repos/psf/requests/issues/4274/events
|
https://github.com/psf/requests/issues/4274
| 255,226,456 |
MDU6SXNzdWUyNTUyMjY0NTY=
| 4,274 |
allow_redirects default for 'head' not shown in help text
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8859114?v=4",
"events_url": "https://api.github.com/users/geokala/events{/privacy}",
"followers_url": "https://api.github.com/users/geokala/followers",
"following_url": "https://api.github.com/users/geokala/following{/other_user}",
"gists_url": "https://api.github.com/users/geokala/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/geokala",
"id": 8859114,
"login": "geokala",
"node_id": "MDQ6VXNlcjg4NTkxMTQ=",
"organizations_url": "https://api.github.com/users/geokala/orgs",
"received_events_url": "https://api.github.com/users/geokala/received_events",
"repos_url": "https://api.github.com/users/geokala/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/geokala/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/geokala/subscriptions",
"type": "User",
"url": "https://api.github.com/users/geokala",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 3 |
2017-09-05T10:10:53Z
|
2021-08-27T00:08:27Z
|
2021-04-08T22:19:03Z
|
NONE
|
resolved
|
When checking help(requests.request) to get the default parameters, the text is misleading if a head request is going to be used.
## Expected Result
The help text should indicate where the default differs OR the help text for .head should indicate that it overrides the default.
e.g.
:param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``False`` for head requests, ``True`` for all others.
## Actual Result
The 'head' help text displays only that it takes the args of a 'request' object, and request displays:
:param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``True``.
## Reproduction Steps
```python
import requests
help(requests.head)
help(requests.request)
```
## System Information
$ python -m requests.help
```
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "2.7.6"
},
"platform": {
"release": "3.16.0-30-generic",
"system": "Linux"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "1000106f"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4274/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4274/timeline
| null |
completed
| null | null | false |
[
"HEAD overrides the default and should be updated. ",
"I've created a PR for this here: https://github.com/requests/requests/pull/4277\r\n\r\nI tried updating just in requests.head, but then the requests.request still has an incorrect docstring if it is only updated there so for a first pass I've updated in just the one place. I'm not sure if this is 'right' for requests, or if there are any similar examples (I had a quick skim through api.py but am possibly being oblivious this evening).\r\n\r\nI also applied the same (almost) change to session.py since the same different default is present there.",
"It would be nice to document somewhere the motivation for setting `allow_redirects` to False for `HEAD` requests."
] |
https://api.github.com/repos/psf/requests/issues/4273
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4273/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4273/comments
|
https://api.github.com/repos/psf/requests/issues/4273/events
|
https://github.com/psf/requests/pull/4273
| 254,833,541 |
MDExOlB1bGxSZXF1ZXN0MTM5MDI1MDA3
| 4,273 |
REQUESTS_DONT_USE_PYOPENSSL
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 25 |
2017-09-02T20:15:39Z
|
2021-09-09T05:35:22Z
|
2017-10-19T12:45:47Z
|
CONTRIBUTOR
|
resolved
|
Basically, a lot of people are installing pipenv in envs which also have `requests[security]` installed, which slows down the CLI tool quite a bit (at import time).
This patch would allow pipenv to disable the upgrade within itself, speeding up the experience for those users.
/cc @Lukasa @alex
|
{
"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/4273/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4273/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4273.diff",
"html_url": "https://github.com/psf/requests/pull/4273",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4273.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4273"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4273?src=pr&el=h1) Report\n> Merging [#4273](https://codecov.io/gh/requests/requests/pull/4273?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/b9638ec7be9134786e28684ca17f3d161297ac5e?src=pr&el=desc) will **increase** coverage by `0.01%`.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4273?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4273 +/- ##\n==========================================\n+ Coverage 88.66% 88.68% +0.01% \n==========================================\n Files 18 18 \n Lines 2021 2023 +2 \n==========================================\n+ Hits 1792 1794 +2 \n Misses 229 229\n```\n\n\n| [Impacted Files](https://codecov.io/gh/requests/requests/pull/4273?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [tests/testserver/\\_\\_init\\_\\_.py](https://codecov.io/gh/requests/requests/pull/4273?src=pr&el=tree#diff-dGVzdHMvdGVzdHNlcnZlci9fX2luaXRfXy5weQ==) | `86.53% <0%> (+0.53%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4273?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4273?src=pr&el=footer). Last update [b9638ec...f53f5c2](https://codecov.io/gh/requests/requests/pull/4273?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n",
"Ok, so the core problem as I understand it is that the import time of pyopenssl is slow. So I have the following concerns:\r\n\r\n1. Can we speed up the import time? This would be ideal if we can.\r\n2. If not, can we be smarter about whether we try to inject into urllib3? If so, that would be good: if we can avoid needing to do this work (e.g. Because the system ssl module is good enough) then we should maybe avoid doing it.\r\n3. If not, then should this hook be a bit more general (e.g. `REQUESTS_SSL_BACKEND` with options including `ssl`, `pyopenssl`, `securetransport`)?\r\n\r\nI think feedback on those would be good.",
"Speeding up import time would be dandy, and make this a non–issue.",
"I like the backend idea, but I also prefer the currently proposed method, because it's a little more explicit and would be... used less, i think. ",
"This seems to keep the default behavior, so I'm not super concerned about it. Like @Lukasa , I'd love to understand the root cause of the slowness and see if we can fix it.\r\n\r\nKeep in mind that disabling this on Python2.6 and whatever else means they'll see warnings.",
"Welcome @alex to the team, btw! He's collab on the repo now, as our official security advisor™.",
"I'm onboard for trying to speed pyopenssl up. I don't particularly like the \"set it and forget it\" nature of an environment variable for security related features though. I feel like this could be an added source of opened issues for people who forgot they set something.",
"This would be set by pipenv in the pipenv codebase, before importing requests, and not by a user. It would not effect their environment. ",
"too bad `__import__` doesn't let you pass arguments to modules. That'd be dope. ",
"in the meantime, pipenv can monkeypatch requests!",
"@kennethreitz It would be possible for users to set it though, and we have learned with Requests that users will find and use *every* part of the codebase, documented or not. ",
"Anyway, I'm ok with adding this too. Let's add it and release early next week, but let's never document it.",
"Okay so news — did this import get a lot faster recently? I'm trying with latest, and it's super fast on my machine. Users are reporting very slow response though. I think they have older versions. ",
"It got faster with cryptography 1.0, anything older than that is slow, IIRC.",
"> It got faster with cryptography 1.0, anything older than that is slow, IIRC.\r\n\r\nRight. This is why whenever someone complains that importing requests/pyopenssl is slow I ask for their version of cryptography and suggest they upgrade. I think 1.0 is when a new feature in CFFI was released and Cryptography started taking advantage of it (iirc)",
"Yeah, that's right.\n\nAlso we've fixed several security issues since then, and added support for\nnewer versions of OpenSSL. I'd suggest `requests[security]` should express\na higher minimum version of pyOpenSSL (though I see it already expresses a\nnewer minimum version of cryptography, so I don't see how this could happen\non a modern requests).\n\nOn Sat, Sep 2, 2017 at 7:49 PM, Ian Stapleton Cordasco <\[email protected]> wrote:\n\n> It got faster with cryptography 1.0, anything older than that is slow,\n> IIRC.\n>\n> Right. This is why whenever someone complains that importing\n> requests/pyopenssl is slow I ask for their version of cryptography and\n> suggest they upgrade. I think 1.0 is when a new feature in CFFI was\n> released and Cryptography started taking advantage of it (iirc)\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/requests/requests/pull/4273#issuecomment-326775457>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAADBNu84mdz7ktNY5Cx06wDGmjfpgGbks5seemngaJpZM4PK__->\n> .\n>\n\n\n\n-- \n\"I disapprove of what you say, but I will defend to the death your right to\nsay it.\" -- Evelyn Beatrice Hall (summarizing Voltaire)\n\"The people's good is the highest law.\" -- Cicero\nGPG Key fingerprint: D1B3 ADC0 E023 8CA6\n",
"I still think it would be a nice-to-have — and agreed on never documenting it. ",
"Hm, so I remembered [this](https://github.com/jakubroztocil/httpie/issues/603) but that's on FreeBSD and should probably be moved over to the cryptography issue tracker.",
"@sigmavirus24 @nateprewitt The two of you will need to do a review now, because I have added a commit to this branch. :wink:",
"I'm really not fond of this idea but looks like there's no one else who feels that way.",
"Well to be clear, as I said earlier in the thread I'm not stoked on the idea either. If we're going to merge this though, I don't see anything technically incorrect here.",
"@kennethreitz Out of curiosity, would you mind explaining how pipenv would use this? Would you just instruct users to set this? If so, perhaps this may not be worth it. It seems users of pipenv may have better success doing the alternative install that fixed the user's issue https://github.com/kennethreitz/pipenv/issues/465#issuecomment-326769070",
"@ojek no, pipenv would set this environment variable itself before importing requests. ",
"it sounds like adding a warning for old versions might be a better idea though",
"Now that #4332 is merged, are we ok closing this PR, @kennethreitz?"
] |
https://api.github.com/repos/psf/requests/issues/4272
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4272/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4272/comments
|
https://api.github.com/repos/psf/requests/issues/4272/events
|
https://github.com/psf/requests/issues/4272
| 254,567,434 |
MDU6SXNzdWUyNTQ1Njc0MzQ=
| 4,272 |
requests 2.18.4 with proxies throw SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4942944?v=4",
"events_url": "https://api.github.com/users/iacky/events{/privacy}",
"followers_url": "https://api.github.com/users/iacky/followers",
"following_url": "https://api.github.com/users/iacky/following{/other_user}",
"gists_url": "https://api.github.com/users/iacky/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/iacky",
"id": 4942944,
"login": "iacky",
"node_id": "MDQ6VXNlcjQ5NDI5NDQ=",
"organizations_url": "https://api.github.com/users/iacky/orgs",
"received_events_url": "https://api.github.com/users/iacky/received_events",
"repos_url": "https://api.github.com/users/iacky/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/iacky/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/iacky/subscriptions",
"type": "User",
"url": "https://api.github.com/users/iacky",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 20 |
2017-09-01T08:11:53Z
|
2018-12-24T14:20:53Z
|
2018-01-17T11:56:17Z
|
NONE
|
resolved
|
Hi,
When I use requests 2.18.4 with proxies, it throw SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
MacOS Sierra
Python 3.6.2
OpenSSL 1.0.2l
pip3 list:
asn1crypto (0.22.0)
certifi (2017.7.27.1)
cffi (1.10.0)
chardet (3.0.4)
cryptography (2.0.3)
idna (2.6)
pycparser (2.18)
pyOpenSSL (17.2.0)
PySocks (1.6.7)
requests (2.18.4)
setuptools (28.8.0)
six (1.10.0)
tqdm (4.15.0)
urllib3 (1.22)
My code:
import requests
proxies={'http':'socks5://127.0.0.1:1080', 'https': 'socks5://127.0.0.1:1080'}
r=requests.get('https://www.instagram.com/',proxies=proxies)
Error message:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/contrib/pyopenssl.py", line 441, in wrap_socket
cnx.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1716, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1449, in _raise_ssl_error
raise SysCallError(-1, "Unexpected EOF")
OpenSSL.SSL.SysCallError: (-1, 'Unexpected EOF')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connectionpool.py", line 850, in _validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connection.py", line 326, in connect
ssl_context=context)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/contrib/pyopenssl.py", line 448, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/adapters.py", line 440, in send
timeout=timeout
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3-1.22-py3.6.egg/urllib3/util/retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: SOCKSHTTPSConnectionPool(host='www.instagram.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/instagram-scraper", line 11, in <module>
load_entry_point('instagram-scraper', 'console_scripts', 'instagram-scraper')()
File "/Users/wangwei/xingxing/scrape_instagram/instagram-scraper/instagram_scraper/app.py", line 763, in main
scraper.scrape()
File "/Users/wangwei/xingxing/scrape_instagram/instagram-scraper/instagram_scraper/app.py", line 346, in scrape
self.login()
File "/Users/wangwei/xingxing/scrape_instagram/instagram-scraper/instagram_scraper/app.py", line 97, in login
req = self.session.get('https://www.instagram.com/',proxies =proxies)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests-2.18.4-py3.6.egg/requests/adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: SOCKSHTTPSConnectionPool(host='www.instagram.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
I check all issues about 'SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)' including [issue#4193](https://github.com/requests/requests/issues/4193),but i do not find the solution. I want to know what the reason is, help me~~ thanks
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4",
"events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}",
"followers_url": "https://api.github.com/users/sigmavirus24/followers",
"following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}",
"gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sigmavirus24",
"id": 240830,
"login": "sigmavirus24",
"node_id": "MDQ6VXNlcjI0MDgzMA==",
"organizations_url": "https://api.github.com/users/sigmavirus24/orgs",
"received_events_url": "https://api.github.com/users/sigmavirus24/received_events",
"repos_url": "https://api.github.com/users/sigmavirus24/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sigmavirus24",
"user_view_type": "public"
}
|
{
"+1": 2,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/psf/requests/issues/4272/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4272/timeline
| null |
completed
| null | null | false |
[
"Did you *try* the solution from #4193?",
"Ah, wait, you're using SOCKS. This may change some stuff around. Is your SOCKS proxy messing with the connection in any way?",
"Ah, yes i tried #4193 ,what is the meaning of ‘messing with the connection in any way’,mybe i make a mistake .. I use Shadowsocks proxy.\r\n\r\ncan you suggest me something about it. do you need some more infomations ? eg:wireshark data..\r\nthanks~~",
"I think seeing the wireshark data between the client and the proxy would be helpful.",
" No. Time Source Destination Protocol Length Info\r\n 5 0.024293 192.168.199.154 47.90.120.149 TCP 78 49689 → 30612 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=32 TSval=174674336 TSecr=0 SACK_PERM=1\r\n\r\n Frame 5: 78 bytes on wire (624 bits), 78 bytes captured (624 bits) on interface 0\r\n Interface id: 0 (en0)\r\n Interface name: en0\r\n Encapsulation type: Ethernet (1)\r\n Arrival Time: Sep 2, 2017 00:22:43.459267000 CST\r\n [Time shift for this packet: 0.000000000 seconds]\r\n Epoch Time: 1504282963.459267000 seconds\r\n [Time delta from previous captured frame: 0.000420000 seconds]\r\n [Time delta from previous displayed frame: 0.000000000 seconds]\r\n [Time since reference or first frame: 0.024293000 seconds]\r\n Frame Number: 5\r\n Frame Length: 78 bytes (624 bits)\r\n Capture Length: 78 bytes (624 bits)\r\n [Frame is marked: False]\r\n [Frame is ignored: False]\r\n [Protocols in frame: eth:ethertype:ip:tcp]\r\n [Coloring Rule Name: TCP SYN/FIN]\r\n [Coloring Rule String: tcp.flags & 0x02 || tcp.flags.fin == 1]\r\n Ethernet II, Src: Apple_cd:f9:12 (34:36:3b:cd:f9:12), Dst: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Destination: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Address: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Source: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Address: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Type: IPv4 (0x0800)\r\n Internet Protocol Version 4, Src: 192.168.199.154, Dst: 47.90.120.149\r\n 0100 .... = Version: 4\r\n .... 0101 = Header Length: 20 bytes (5)\r\n Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)\r\n 0000 00.. = Differentiated Services Codepoint: Default (0)\r\n .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)\r\n Total Length: 64\r\n Identification: 0x3fc6 (16326)\r\n Flags: 0x02 (Don't Fragment)\r\n 0... .... = Reserved bit: Not set\r\n .1.. .... = Don't fragment: Set\r\n ..0. .... = More fragments: Not set\r\n Fragment offset: 0\r\n Time to live: 64\r\n Protocol: TCP (6)\r\n Header checksum: 0xcabf [validation disabled]\r\n [Header checksum status: Unverified]\r\n Source: 192.168.199.154\r\n Destination: 47.90.120.149\r\n [Source GeoIP: Unknown]\r\n [Destination GeoIP: Unknown]\r\n Transmission Control Protocol, Src Port: 49689, Dst Port: 30612, Seq: 0, Len: 0\r\n Source Port: 49689\r\n Destination Port: 30612\r\n [Stream index: 0]\r\n [TCP Segment Len: 0]\r\n Sequence number: 0 (relative sequence number)\r\n Acknowledgment number: 0\r\n 1011 .... = Header Length: 44 bytes (11)\r\n Flags: 0x002 (SYN)\r\n 000. .... .... = Reserved: Not set\r\n ...0 .... .... = Nonce: Not set\r\n .... 0... .... = Congestion Window Reduced (CWR): Not set\r\n .... .0.. .... = ECN-Echo: Not set\r\n .... ..0. .... = Urgent: Not set\r\n .... ...0 .... = Acknowledgment: Not set\r\n .... .... 0... = Push: Not set\r\n .... .... .0.. = Reset: Not set\r\n .... .... ..1. = Syn: Set\r\n [Expert Info (Chat/Sequence): Connection establish request (SYN): server port 30612]\r\n [Connection establish request (SYN): server port 30612]\r\n [Severity level: Chat]\r\n [Group: Sequence]\r\n .... .... ...0 = Fin: Not set\r\n [TCP Flags: ··········S·]\r\n Window size value: 65535\r\n [Calculated window size: 65535]\r\n Checksum: 0x0c60 [unverified]\r\n [Checksum Status: Unverified]\r\n Urgent pointer: 0\r\n Options: (24 bytes), Maximum segment size, No-Operation (NOP), Window scale, No-Operation (NOP), No-Operation (NOP), Timestamps, SACK permitted, End of Option List (EOL)\r\n TCP Option - Maximum segment size: 1460 bytes\r\n Kind: Maximum Segment Size (2)\r\n Length: 4\r\n MSS Value: 1460\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - Window scale: 5 (multiply by 32)\r\n Kind: Window Scale (3)\r\n Length: 3\r\n Shift count: 5\r\n [Multiplier: 32]\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - Timestamps: TSval 174674336, TSecr 0\r\n Kind: Time Stamp Option (8)\r\n Length: 10\r\n Timestamp value: 174674336\r\n Timestamp echo reply: 0\r\n TCP Option - SACK permitted\r\n Kind: SACK Permitted (4)\r\n Length: 2\r\n TCP Option - End of Option List (EOL)\r\n Kind: End of Option List (0)\r\n\r\n No. Time Source Destination Protocol Length Info\r\n 6 0.073556 47.90.120.149 192.168.199.154 TCP 74 30612 → 49689 [SYN, ACK] Seq=0 Ack=1 Win=14480 Len=0 MSS=1412 SACK_PERM=1 TSval=1813150359 TSecr=174674336 WS=64\r\n\r\n Frame 6: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0\r\n Interface id: 0 (en0)\r\n Interface name: en0\r\n Encapsulation type: Ethernet (1)\r\n Arrival Time: Sep 2, 2017 00:22:43.508530000 CST\r\n [Time shift for this packet: 0.000000000 seconds]\r\n Epoch Time: 1504282963.508530000 seconds\r\n [Time delta from previous captured frame: 0.049263000 seconds]\r\n [Time delta from previous displayed frame: 0.049263000 seconds]\r\n [Time since reference or first frame: 0.073556000 seconds]\r\n Frame Number: 6\r\n Frame Length: 74 bytes (592 bits)\r\n Capture Length: 74 bytes (592 bits)\r\n [Frame is marked: False]\r\n [Frame is ignored: False]\r\n [Protocols in frame: eth:ethertype:ip:tcp]\r\n [Coloring Rule Name: TCP SYN/FIN]\r\n [Coloring Rule String: tcp.flags & 0x02 || tcp.flags.fin == 1]\r\n Ethernet II, Src: Hiwifi_34:31:98 (d4:ee:07:34:31:98), Dst: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Destination: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Address: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Source: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Address: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Type: IPv4 (0x0800)\r\n Internet Protocol Version 4, Src: 47.90.120.149, Dst: 192.168.199.154\r\n 0100 .... = Version: 4\r\n .... 0101 = Header Length: 20 bytes (5)\r\n Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)\r\n 0000 00.. = Differentiated Services Codepoint: Default (0)\r\n .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)\r\n Total Length: 60\r\n Identification: 0x0000 (0)\r\n Flags: 0x02 (Don't Fragment)\r\n 0... .... = Reserved bit: Not set\r\n .1.. .... = Don't fragment: Set\r\n ..0. .... = More fragments: Not set\r\n Fragment offset: 0\r\n Time to live: 47\r\n Protocol: TCP (6)\r\n Header checksum: 0x1b8a [validation disabled]\r\n [Header checksum status: Unverified]\r\n Source: 47.90.120.149\r\n Destination: 192.168.199.154\r\n [Source GeoIP: Unknown]\r\n [Destination GeoIP: Unknown]\r\n Transmission Control Protocol, Src Port: 30612, Dst Port: 49689, Seq: 0, Ack: 1, Len: 0\r\n Source Port: 30612\r\n Destination Port: 49689\r\n [Stream index: 0]\r\n [TCP Segment Len: 0]\r\n Sequence number: 0 (relative sequence number)\r\n Acknowledgment number: 1 (relative ack number)\r\n 1010 .... = Header Length: 40 bytes (10)\r\n Flags: 0x012 (SYN, ACK)\r\n 000. .... .... = Reserved: Not set\r\n ...0 .... .... = Nonce: Not set\r\n .... 0... .... = Congestion Window Reduced (CWR): Not set\r\n .... .0.. .... = ECN-Echo: Not set\r\n .... ..0. .... = Urgent: Not set\r\n .... ...1 .... = Acknowledgment: Set\r\n .... .... 0... = Push: Not set\r\n .... .... .0.. = Reset: Not set\r\n .... .... ..1. = Syn: Set\r\n [Expert Info (Chat/Sequence): Connection establish acknowledge (SYN+ACK): server port 30612]\r\n [Connection establish acknowledge (SYN+ACK): server port 30612]\r\n [Severity level: Chat]\r\n [Group: Sequence]\r\n .... .... ...0 = Fin: Not set\r\n [TCP Flags: ·······A··S·]\r\n Window size value: 14480\r\n [Calculated window size: 14480]\r\n Checksum: 0x51f5 [unverified]\r\n [Checksum Status: Unverified]\r\n Urgent pointer: 0\r\n Options: (20 bytes), Maximum segment size, SACK permitted, Timestamps, No-Operation (NOP), Window scale\r\n TCP Option - Maximum segment size: 1412 bytes\r\n Kind: Maximum Segment Size (2)\r\n Length: 4\r\n MSS Value: 1412\r\n TCP Option - SACK permitted\r\n Kind: SACK Permitted (4)\r\n Length: 2\r\n TCP Option - Timestamps: TSval 1813150359, TSecr 174674336\r\n Kind: Time Stamp Option (8)\r\n Length: 10\r\n Timestamp value: 1813150359\r\n Timestamp echo reply: 174674336\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - Window scale: 6 (multiply by 64)\r\n Kind: Window Scale (3)\r\n Length: 3\r\n Shift count: 6\r\n [Multiplier: 64]\r\n [SEQ/ACK analysis]\r\n [This is an ACK to the segment in frame: 5]\r\n [The RTT to ACK the segment was: 0.049263000 seconds]\r\n [iRTT: 0.049355000 seconds]\r\n\r\n No. Time Source Destination Protocol Length Info\r\n 7 0.073648 192.168.199.154 47.90.120.149 TCP 66 49689 → 30612 [ACK] Seq=1 Ack=1 Win=131584 Len=0 TSval=174674385 TSecr=1813150359\r\n\r\n Frame 7: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0\r\n Interface id: 0 (en0)\r\n Interface name: en0\r\n Encapsulation type: Ethernet (1)\r\n Arrival Time: Sep 2, 2017 00:22:43.508622000 CST\r\n [Time shift for this packet: 0.000000000 seconds]\r\n Epoch Time: 1504282963.508622000 seconds\r\n [Time delta from previous captured frame: 0.000092000 seconds]\r\n [Time delta from previous displayed frame: 0.000092000 seconds]\r\n [Time since reference or first frame: 0.073648000 seconds]\r\n Frame Number: 7\r\n Frame Length: 66 bytes (528 bits)\r\n Capture Length: 66 bytes (528 bits)\r\n [Frame is marked: False]\r\n [Frame is ignored: False]\r\n [Protocols in frame: eth:ethertype:ip:tcp]\r\n [Coloring Rule Name: TCP]\r\n [Coloring Rule String: tcp]\r\n Ethernet II, Src: Apple_cd:f9:12 (34:36:3b:cd:f9:12), Dst: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Destination: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Address: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Source: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Address: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Type: IPv4 (0x0800)\r\n Internet Protocol Version 4, Src: 192.168.199.154, Dst: 47.90.120.149\r\n 0100 .... = Version: 4\r\n .... 0101 = Header Length: 20 bytes (5)\r\n Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)\r\n 0000 00.. = Differentiated Services Codepoint: Default (0)\r\n .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)\r\n Total Length: 52\r\n Identification: 0x7715 (30485)\r\n Flags: 0x02 (Don't Fragment)\r\n 0... .... = Reserved bit: Not set\r\n .1.. .... = Don't fragment: Set\r\n ..0. .... = More fragments: Not set\r\n Fragment offset: 0\r\n Time to live: 64\r\n Protocol: TCP (6)\r\n Header checksum: 0x937c [validation disabled]\r\n [Header checksum status: Unverified]\r\n Source: 192.168.199.154\r\n Destination: 47.90.120.149\r\n [Source GeoIP: Unknown]\r\n [Destination GeoIP: Unknown]\r\n Transmission Control Protocol, Src Port: 49689, Dst Port: 30612, Seq: 1, Ack: 1, Len: 0\r\n Source Port: 49689\r\n Destination Port: 30612\r\n [Stream index: 0]\r\n [TCP Segment Len: 0]\r\n Sequence number: 1 (relative sequence number)\r\n Acknowledgment number: 1 (relative ack number)\r\n 1000 .... = Header Length: 32 bytes (8)\r\n Flags: 0x010 (ACK)\r\n 000. .... .... = Reserved: Not set\r\n ...0 .... .... = Nonce: Not set\r\n .... 0... .... = Congestion Window Reduced (CWR): Not set\r\n .... .0.. .... = ECN-Echo: Not set\r\n .... ..0. .... = Urgent: Not set\r\n .... ...1 .... = Acknowledgment: Set\r\n .... .... 0... = Push: Not set\r\n .... .... .0.. = Reset: Not set\r\n .... .... ..0. = Syn: Not set\r\n .... .... ...0 = Fin: Not set\r\n [TCP Flags: ·······A····]\r\n Window size value: 4112\r\n [Calculated window size: 131584]\r\n [Window size scaling factor: 32]\r\n Checksum: 0xa8df [unverified]\r\n [Checksum Status: Unverified]\r\n Urgent pointer: 0\r\n Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - Timestamps: TSval 174674385, TSecr 1813150359\r\n Kind: Time Stamp Option (8)\r\n Length: 10\r\n Timestamp value: 174674385\r\n Timestamp echo reply: 1813150359\r\n [SEQ/ACK analysis]\r\n [This is an ACK to the segment in frame: 6]\r\n [The RTT to ACK the segment was: 0.000092000 seconds]\r\n [iRTT: 0.049355000 seconds]\r\n\r\n No. Time Source Destination Protocol Length Info\r\n 8 0.075483 192.168.199.154 47.90.120.149 TCP 89 49689 → 30612 [PSH, ACK] Seq=1 Ack=1 Win=131584 Len=23 TSval=174674386 TSecr=1813150359\r\n\r\n Frame 8: 89 bytes on wire (712 bits), 89 bytes captured (712 bits) on interface 0\r\n Interface id: 0 (en0)\r\n Interface name: en0\r\n Encapsulation type: Ethernet (1)\r\n Arrival Time: Sep 2, 2017 00:22:43.510457000 CST\r\n [Time shift for this packet: 0.000000000 seconds]\r\n Epoch Time: 1504282963.510457000 seconds\r\n [Time delta from previous captured frame: 0.001835000 seconds]\r\n [Time delta from previous displayed frame: 0.001835000 seconds]\r\n [Time since reference or first frame: 0.075483000 seconds]\r\n Frame Number: 8\r\n Frame Length: 89 bytes (712 bits)\r\n Capture Length: 89 bytes (712 bits)\r\n [Frame is marked: False]\r\n [Frame is ignored: False]\r\n [Protocols in frame: eth:ethertype:ip:tcp:data]\r\n [Coloring Rule Name: TCP]\r\n [Coloring Rule String: tcp]\r\n Ethernet II, Src: Apple_cd:f9:12 (34:36:3b:cd:f9:12), Dst: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Destination: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Address: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Source: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Address: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Type: IPv4 (0x0800)\r\n Internet Protocol Version 4, Src: 192.168.199.154, Dst: 47.90.120.149\r\n 0100 .... = Version: 4\r\n .... 0101 = Header Length: 20 bytes (5)\r\n Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)\r\n 0000 00.. = Differentiated Services Codepoint: Default (0)\r\n .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)\r\n Total Length: 75\r\n Identification: 0x7385 (29573)\r\n Flags: 0x02 (Don't Fragment)\r\n 0... .... = Reserved bit: Not set\r\n .1.. .... = Don't fragment: Set\r\n ..0. .... = More fragments: Not set\r\n Fragment offset: 0\r\n Time to live: 64\r\n Protocol: TCP (6)\r\n Header checksum: 0x96f5 [validation disabled]\r\n [Header checksum status: Unverified]\r\n Source: 192.168.199.154\r\n Destination: 47.90.120.149\r\n [Source GeoIP: Unknown]\r\n [Destination GeoIP: Unknown]\r\n Transmission Control Protocol, Src Port: 49689, Dst Port: 30612, Seq: 1, Ack: 1, Len: 23\r\n Source Port: 49689\r\n Destination Port: 30612\r\n [Stream index: 0]\r\n [TCP Segment Len: 23]\r\n Sequence number: 1 (relative sequence number)\r\n [Next sequence number: 24 (relative sequence number)]\r\n Acknowledgment number: 1 (relative ack number)\r\n 1000 .... = Header Length: 32 bytes (8)\r\n Flags: 0x018 (PSH, ACK)\r\n 000. .... .... = Reserved: Not set\r\n ...0 .... .... = Nonce: Not set\r\n .... 0... .... = Congestion Window Reduced (CWR): Not set\r\n .... .0.. .... = ECN-Echo: Not set\r\n .... ..0. .... = Urgent: Not set\r\n .... ...1 .... = Acknowledgment: Set\r\n .... .... 1... = Push: Set\r\n .... .... .0.. = Reset: Not set\r\n .... .... ..0. = Syn: Not set\r\n .... .... ...0 = Fin: Not set\r\n [TCP Flags: ·······AP···]\r\n Window size value: 4112\r\n [Calculated window size: 131584]\r\n [Window size scaling factor: 32]\r\n Checksum: 0xee13 [unverified]\r\n [Checksum Status: Unverified]\r\n Urgent pointer: 0\r\n Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - Timestamps: TSval 174674386, TSecr 1813150359\r\n Kind: Time Stamp Option (8)\r\n Length: 10\r\n Timestamp value: 174674386\r\n Timestamp echo reply: 1813150359\r\n [SEQ/ACK analysis]\r\n [iRTT: 0.049355000 seconds]\r\n [Bytes in flight: 23]\r\n [Bytes sent since last PSH flag: 23]\r\n TCP payload (23 bytes)\r\n Data (23 bytes)\r\n\r\n 0000 db 79 30 10 9f b3 96 30 84 da 2b 4e 66 e6 18 ab .y0....0..+Nf...\r\n 0010 64 81 42 e9 fc 17 a6 d.B....\r\n Data: db7930109fb3963084da2b4e66e618ab648142e9fc17a6\r\n [Length: 23]\r\n\r\n No. Time Source Destination Protocol Length Info\r\n 9 0.086616 192.168.199.154 47.90.120.149 TCP 336 49689 → 30612 [PSH, ACK] Seq=24 Ack=1 Win=131584 Len=270 TSval=174674397 TSecr=1813150359\r\n\r\n Frame 9: 336 bytes on wire (2688 bits), 336 bytes captured (2688 bits) on interface 0\r\n Interface id: 0 (en0)\r\n Interface name: en0\r\n Encapsulation type: Ethernet (1)\r\n Arrival Time: Sep 2, 2017 00:22:43.521590000 CST\r\n [Time shift for this packet: 0.000000000 seconds]\r\n Epoch Time: 1504282963.521590000 seconds\r\n [Time delta from previous captured frame: 0.011133000 seconds]\r\n [Time delta from previous displayed frame: 0.011133000 seconds]\r\n [Time since reference or first frame: 0.086616000 seconds]\r\n Frame Number: 9\r\n Frame Length: 336 bytes (2688 bits)\r\n Capture Length: 336 bytes (2688 bits)\r\n [Frame is marked: False]\r\n [Frame is ignored: False]\r\n [Protocols in frame: eth:ethertype:ip:tcp:data]\r\n [Coloring Rule Name: TCP]\r\n [Coloring Rule String: tcp]\r\n Ethernet II, Src: Apple_cd:f9:12 (34:36:3b:cd:f9:12), Dst: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Destination: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Address: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Source: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Address: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Type: IPv4 (0x0800)\r\n Internet Protocol Version 4, Src: 192.168.199.154, Dst: 47.90.120.149\r\n 0100 .... = Version: 4\r\n .... 0101 = Header Length: 20 bytes (5)\r\n Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)\r\n 0000 00.. = Differentiated Services Codepoint: Default (0)\r\n .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)\r\n Total Length: 322\r\n Identification: 0x4987 (18823)\r\n Flags: 0x02 (Don't Fragment)\r\n 0... .... = Reserved bit: Not set\r\n .1.. .... = Don't fragment: Set\r\n ..0. .... = More fragments: Not set\r\n Fragment offset: 0\r\n Time to live: 64\r\n Protocol: TCP (6)\r\n Header checksum: 0xbffc [validation disabled]\r\n [Header checksum status: Unverified]\r\n Source: 192.168.199.154\r\n Destination: 47.90.120.149\r\n [Source GeoIP: Unknown]\r\n [Destination GeoIP: Unknown]\r\n Transmission Control Protocol, Src Port: 49689, Dst Port: 30612, Seq: 24, Ack: 1, Len: 270\r\n Source Port: 49689\r\n Destination Port: 30612\r\n [Stream index: 0]\r\n [TCP Segment Len: 270]\r\n Sequence number: 24 (relative sequence number)\r\n [Next sequence number: 294 (relative sequence number)]\r\n Acknowledgment number: 1 (relative ack number)\r\n 1000 .... = Header Length: 32 bytes (8)\r\n Flags: 0x018 (PSH, ACK)\r\n 000. .... .... = Reserved: Not set\r\n ...0 .... .... = Nonce: Not set\r\n .... 0... .... = Congestion Window Reduced (CWR): Not set\r\n .... .0.. .... = ECN-Echo: Not set\r\n .... ..0. .... = Urgent: Not set\r\n .... ...1 .... = Acknowledgment: Set\r\n .... .... 1... = Push: Set\r\n .... .... .0.. = Reset: Not set\r\n .... .... ..0. = Syn: Not set\r\n .... .... ...0 = Fin: Not set\r\n [TCP Flags: ·······AP···]\r\n Window size value: 4112\r\n [Calculated window size: 131584]\r\n [Window size scaling factor: 32]\r\n Checksum: 0x1520 [unverified]\r\n [Checksum Status: Unverified]\r\n Urgent pointer: 0\r\n Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - Timestamps: TSval 174674397, TSecr 1813150359\r\n Kind: Time Stamp Option (8)\r\n Length: 10\r\n Timestamp value: 174674397\r\n Timestamp echo reply: 1813150359\r\n [SEQ/ACK analysis]\r\n [iRTT: 0.049355000 seconds]\r\n [Bytes in flight: 293]\r\n [Bytes sent since last PSH flag: 270]\r\n TCP payload (270 bytes)\r\n Data (270 bytes)\r\n\r\n 0000 b3 40 06 a8 36 64 ef 8a d5 9d 45 0f 64 02 21 5b [email protected].![\r\n 0010 e5 e2 de a3 10 b1 4c bc 9e 53 16 dd 4b 01 d9 44 ......L..S..K..D\r\n 0020 c3 3f 4f d2 35 2d c1 b2 60 f2 14 95 36 6b 2c a6 .?O.5-..`...6k,.\r\n 0030 d5 7e 0b fd fa 55 2e a0 6a 5f c4 02 4d 19 47 4c .~...U..j_..M.GL\r\n 0040 77 fb 18 a8 73 32 2f 95 1f d4 6e a2 37 85 50 a4 w...s2/...n.7.P.\r\n 0050 2f 68 78 b7 e5 98 1f ae 2d 27 af 6f 5d 2f 2b f9 /hx.....-'.o]/+.\r\n 0060 e4 b4 ee 66 86 18 e9 a5 e5 21 fd 18 0b 4d 46 97 ...f.....!...MF.\r\n 0070 16 bb a3 39 df b3 93 14 a7 26 28 8c 71 f3 fa 47 ...9.....&(.q..G\r\n 0080 70 ac 7e fc 16 ba 56 70 d1 5a cd 38 ae 3c 33 66 p.~...Vp.Z.8.<3f\r\n 0090 33 75 8b 81 c6 ae a7 e5 bf 73 9b 41 9b 4a 78 78 3u.......s.A.Jxx\r\n 00a0 8e b6 71 fb b8 e4 98 39 8a 4a 73 8e 38 37 58 f4 ..q....9.Js.87X.\r\n 00b0 f1 68 c8 ab e3 a5 bf fa 22 4e 09 04 1b e5 89 2f .h......\"N...../\r\n 00c0 e4 d2 67 ce 1e cd 05 d3 c5 61 e2 0c bd 5b 14 c5 ..g......a...[..\r\n 00d0 e0 aa 87 94 b1 4f bf d5 99 90 2d 30 2d 9d e7 0a .....O....-0-...\r\n 00e0 74 59 4a a4 7c 8b 0c 5a 98 3f ca af aa ed 9f ac tYJ.|..Z.?......\r\n 00f0 6a eb 8d 45 eb f3 d3 1c 2e 3c bb 51 97 6a ff cf j..E.....<.Q.j..\r\n 0100 3c 1f 29 05 08 f3 a7 d9 c0 b5 90 57 6e 8b <.)........Wn.\r\n Data: b34006a83664ef8ad59d450f6402215be5e2dea310b14cbc...\r\n [Length: 270]\r\n\r\n No. Time Source Destination Protocol Length Info\r\n 10 0.127217 47.90.120.149 192.168.199.154 TCP 66 30612 → 49689 [ACK] Seq=1 Ack=24 Win=14528 Len=0 TSval=1813150411 TSecr=174674386\r\n\r\n Frame 10: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0\r\n Interface id: 0 (en0)\r\n Interface name: en0\r\n Encapsulation type: Ethernet (1)\r\n Arrival Time: Sep 2, 2017 00:22:43.562191000 CST\r\n [Time shift for this packet: 0.000000000 seconds]\r\n Epoch Time: 1504282963.562191000 seconds\r\n [Time delta from previous captured frame: 0.040601000 seconds]\r\n [Time delta from previous displayed frame: 0.040601000 seconds]\r\n [Time since reference or first frame: 0.127217000 seconds]\r\n Frame Number: 10\r\n Frame Length: 66 bytes (528 bits)\r\n Capture Length: 66 bytes (528 bits)\r\n [Frame is marked: False]\r\n [Frame is ignored: False]\r\n [Protocols in frame: eth:ethertype:ip:tcp]\r\n [Coloring Rule Name: TCP]\r\n [Coloring Rule String: tcp]\r\n Ethernet II, Src: Hiwifi_34:31:98 (d4:ee:07:34:31:98), Dst: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Destination: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Address: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Source: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Address: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Type: IPv4 (0x0800)\r\n Internet Protocol Version 4, Src: 47.90.120.149, Dst: 192.168.199.154\r\n 0100 .... = Version: 4\r\n .... 0101 = Header Length: 20 bytes (5)\r\n Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)\r\n 0000 00.. = Differentiated Services Codepoint: Default (0)\r\n .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)\r\n Total Length: 52\r\n Identification: 0x7160 (29024)\r\n Flags: 0x02 (Don't Fragment)\r\n 0... .... = Reserved bit: Not set\r\n .1.. .... = Don't fragment: Set\r\n ..0. .... = More fragments: Not set\r\n Fragment offset: 0\r\n Time to live: 47\r\n Protocol: TCP (6)\r\n Header checksum: 0xaa31 [validation disabled]\r\n [Header checksum status: Unverified]\r\n Source: 47.90.120.149\r\n Destination: 192.168.199.154\r\n [Source GeoIP: Unknown]\r\n [Destination GeoIP: Unknown]\r\n Transmission Control Protocol, Src Port: 30612, Dst Port: 49689, Seq: 1, Ack: 24, Len: 0\r\n Source Port: 30612\r\n Destination Port: 49689\r\n [Stream index: 0]\r\n [TCP Segment Len: 0]\r\n Sequence number: 1 (relative sequence number)\r\n Acknowledgment number: 24 (relative ack number)\r\n 1000 .... = Header Length: 32 bytes (8)\r\n Flags: 0x010 (ACK)\r\n 000. .... .... = Reserved: Not set\r\n ...0 .... .... = Nonce: Not set\r\n .... 0... .... = Congestion Window Reduced (CWR): Not set\r\n .... .0.. .... = ECN-Echo: Not set\r\n .... ..0. .... = Urgent: Not set\r\n .... ...1 .... = Acknowledgment: Set\r\n .... .... 0... = Push: Not set\r\n .... .... .0.. = Reset: Not set\r\n .... .... ..0. = Syn: Not set\r\n .... .... ...0 = Fin: Not set\r\n [TCP Flags: ·······A····]\r\n Window size value: 227\r\n [Calculated window size: 14528]\r\n [Window size scaling factor: 64]\r\n Checksum: 0xb7c0 [unverified]\r\n [Checksum Status: Unverified]\r\n Urgent pointer: 0\r\n Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - Timestamps: TSval 1813150411, TSecr 174674386\r\n Kind: Time Stamp Option (8)\r\n Length: 10\r\n Timestamp value: 1813150411\r\n Timestamp echo reply: 174674386\r\n [SEQ/ACK analysis]\r\n [This is an ACK to the segment in frame: 8]\r\n [The RTT to ACK the segment was: 0.051734000 seconds]\r\n [iRTT: 0.049355000 seconds]\r\n\r\n No. Time Source Destination Protocol Length Info\r\n 11 0.136884 47.90.120.149 192.168.199.154 TCP 66 30612 → 49689 [ACK] Seq=1 Ack=294 Win=15552 Len=0 TSval=1813150423 TSecr=174674397\r\n\r\n Frame 11: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0\r\n Interface id: 0 (en0)\r\n Interface name: en0\r\n Encapsulation type: Ethernet (1)\r\n Arrival Time: Sep 2, 2017 00:22:43.571858000 CST\r\n [Time shift for this packet: 0.000000000 seconds]\r\n Epoch Time: 1504282963.571858000 seconds\r\n [Time delta from previous captured frame: 0.009667000 seconds]\r\n [Time delta from previous displayed frame: 0.009667000 seconds]\r\n [Time since reference or first frame: 0.136884000 seconds]\r\n Frame Number: 11\r\n Frame Length: 66 bytes (528 bits)\r\n Capture Length: 66 bytes (528 bits)\r\n [Frame is marked: False]\r\n [Frame is ignored: False]\r\n [Protocols in frame: eth:ethertype:ip:tcp]\r\n [Coloring Rule Name: TCP]\r\n [Coloring Rule String: tcp]\r\n Ethernet II, Src: Hiwifi_34:31:98 (d4:ee:07:34:31:98), Dst: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Destination: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n Address: Apple_cd:f9:12 (34:36:3b:cd:f9:12)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Source: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n Address: Hiwifi_34:31:98 (d4:ee:07:34:31:98)\r\n .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)\r\n .... ...0 .... .... .... .... = IG bit: Individual address (unicast)\r\n Type: IPv4 (0x0800)\r\n Internet Protocol Version 4, Src: 47.90.120.149, Dst: 192.168.199.154\r\n 0100 .... = Version: 4\r\n .... 0101 = Header Length: 20 bytes (5)\r\n Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)\r\n 0000 00.. = Differentiated Services Codepoint: Default (0)\r\n .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)\r\n Total Length: 52\r\n Identification: 0x7161 (29025)\r\n Flags: 0x02 (Don't Fragment)\r\n 0... .... = Reserved bit: Not set\r\n .1.. .... = Don't fragment: Set\r\n ..0. .... = More fragments: Not set\r\n Fragment offset: 0\r\n Time to live: 47\r\n Protocol: TCP (6)\r\n Header checksum: 0xaa30 [validation disabled]\r\n [Header checksum status: Unverified]\r\n Source: 47.90.120.149\r\n Destination: 192.168.199.154\r\n [Source GeoIP: Unknown]\r\n [Destination GeoIP: Unknown]\r\n Transmission Control Protocol, Src Port: 30612, Dst Port: 49689, Seq: 1, Ack: 294, Len: 0\r\n Source Port: 30612\r\n Destination Port: 49689\r\n [Stream index: 0]\r\n [TCP Segment Len: 0]\r\n Sequence number: 1 (relative sequence number)\r\n Acknowledgment number: 294 (relative ack number)\r\n 1000 .... = Header Length: 32 bytes (8)\r\n Flags: 0x010 (ACK)\r\n 000. .... .... = Reserved: Not set\r\n ...0 .... .... = Nonce: Not set\r\n .... 0... .... = Congestion Window Reduced (CWR): Not set\r\n .... .0.. .... = ECN-Echo: Not set\r\n .... ..0. .... = Urgent: Not set\r\n .... ...1 .... = Acknowledgment: Set\r\n .... .... 0... = Push: Not set\r\n .... .... .0.. = Reset: Not set\r\n .... .... ..0. = Syn: Not set\r\n .... .... ...0 = Fin: Not set\r\n [TCP Flags: ·······A····]\r\n Window size value: 243\r\n [Calculated window size: 15552]\r\n [Window size scaling factor: 64]\r\n Checksum: 0xb68b [unverified]\r\n [Checksum Status: Unverified]\r\n Urgent pointer: 0\r\n Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - No-Operation (NOP)\r\n Kind: No-Operation (1)\r\n TCP Option - Timestamps: TSval 1813150423, TSecr 174674397\r\n Kind: Time Stamp Option (8)\r\n Length: 10\r\n Timestamp value: 1813150423\r\n Timestamp echo reply: 174674397\r\n [SEQ/ACK analysis]\r\n [This is an ACK to the segment in frame: 9]\r\n [The RTT to ACK the segment was: 0.050268000 seconds]\r\n [iRTT: 0.049355000 seconds]\r\n",
"@Lukasa I do not know which step is most important,so i copy all..it is so long... hope it is useful,Thanks~ ",
"Sadly I think I need the TLS handshake broken out, which means I need the raw PCAP file. Can you provide that for me?",
"That is all right~~ I will try my best to collect useful data ~aha @Lukasa ",
"I have the same problem",
"me too",
"can somebody fix it asap? and submit pull request.",
"If anyone that is experiencing this issue could provide a raw PCAP file as @Lukasa has mentioned it would help immensely with debugging this issue.",
"I also meet this problem. when i use proxy by http that ok. then I try use socks5,\"SSLError: SOCKSHTTPSConnectionPool\", I am happy to continue to provide information to help. ",
"Hey, Everybody. I modified code as below and it worked! but I dont know why!\r\nproxies = {'https': \"socks5h://127.0.0.1:1080\"}\r\n@Lukasa @iacky @imkean @Lovelcp @boostsup ",
"Yeah!\r\nThanks to @ArthurRyan \r\nproxies = {'https': \"socks5h://127.0.0.1:1080\"} is really worked! and I also dont know why!",
"Same issue here but merely on some sites, others worked well without adding h \r\nPerhaps there were some DNS poison from my ISP.",
"Interesting. It seems like we have a solution of sorts and no one has provided a PCAP. I'm closing this as stale. If anyone wants to provide the necessary information, we can reopen this.",
"Thanks,it's really worked. @ArthurRyan ",
"@ArthurRyan Thanks,it's worked for me too.\r\n@ArthurRyan the difference between socks5h and socks5 based on [https://github.com/urllib3/urllib3/pull/1036](url) is:\r\n\r\n> the proxy string, socks5h:// and socks4a:// mean that the hostname is\r\nto be resolved by the socks server. socks5:// and socks4:// mean the\r\nhostname is to be resolved locally.\r\n\r\n ",
"> Hey, Everybody. I modified code as below and it worked! but I dont know why!\r\n> proxies = {'https': \"socks5h://127.0.0.1:1080\"}\r\n> @Lukasa @iacky @imkean @Lovelcp @boostsup\r\n\r\nThanks you very much, this problem has plagued me for several days."
] |
https://api.github.com/repos/psf/requests/issues/4271
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4271/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4271/comments
|
https://api.github.com/repos/psf/requests/issues/4271/events
|
https://github.com/psf/requests/issues/4271
| 254,053,432 |
MDU6SXNzdWUyNTQwNTM0MzI=
| 4,271 |
Unexpected result in iter_lines with '\r\n' delimiter
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/374719?v=4",
"events_url": "https://api.github.com/users/pcpa/events{/privacy}",
"followers_url": "https://api.github.com/users/pcpa/followers",
"following_url": "https://api.github.com/users/pcpa/following{/other_user}",
"gists_url": "https://api.github.com/users/pcpa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pcpa",
"id": 374719,
"login": "pcpa",
"node_id": "MDQ6VXNlcjM3NDcxOQ==",
"organizations_url": "https://api.github.com/users/pcpa/orgs",
"received_events_url": "https://api.github.com/users/pcpa/received_events",
"repos_url": "https://api.github.com/users/pcpa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pcpa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pcpa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pcpa",
"user_view_type": "public"
}
|
[
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
}
] |
closed
| true | null |
[] | null | 7 |
2017-08-30T16:03:56Z
|
2021-09-08T07:00:26Z
|
2017-09-02T06:04:51Z
|
NONE
|
resolved
|
With this test case (named `request_iter_lines_test.py`):
```
import unittest
import requests
from io import StringIO
class TestIterLines(unittest.TestCase):
def iter_lines_response(self, chunk_size, delimiter=None):
response = requests.Response()
response.raw = StringIO('01\r\n45')
gen = response.iter_lines(chunk_size=chunk_size, delimiter=delimiter)
result = list(gen)
self.assertEqual(result, ['01', '45'])
def test_splitlines_before_delimiter(self): self.iter_lines_response(2)
def test_splitlines_in_delimiter(self): self.iter_lines_response(3)
def test_splitlines_after_delimiter(self): self.iter_lines_response(4)
def test_splitlines_in_line(self): self.iter_lines_response(5)
def test_split_before_delimiter(self): self.iter_lines_response(2, '\r\n')
def test_split_in_delimiter(self): self.iter_lines_response(3, '\r\n')
def test_split_after_delimiter(self): self.iter_lines_response(4, '\r\n')
def test_split_in_line(self): self.iter_lines_response(5, '\r\n')
```
when running:
`python3 -m unittest request_iter_lines_test.py`
It should finish without any errors. Instead if fails with 3 errors.
When there is a delimiter, this patch (for Fedora) corrects the problems,
```
--- /usr/lib/python3.5/site-packages/requests/models.py.orig 2017-02-01 16:04:02.117318286 -0200
+++ /usr/lib/python3.5/site-packages/requests/models.py 2017-02-01 16:53:15.219410425 -0200
@@ -707,16 +707,29 @@
if pending is not None:
chunk = pending + chunk
+ pending = None
if delimiter:
+ wrap = False
+ for i in range(1, len(delimiter) + 1):
+ if chunk.endswith(delimiter[:i]):
+ wrap = True
+ break
+ if wrap:
+ if pending is not None:
+ pending = pending + chunk
+ else:
+ pending = chunk
+ continue
lines = chunk.split(delimiter)
else:
lines = chunk.splitlines()
if lines and lines[-1] and chunk and lines[-1][-1] == chunk[-1]:
- pending = lines.pop()
- else:
- pending = None
+ if pending is not None:
+ pending = pending + lines.pop()
+ else:
+ pending = lines.pop()
for line in lines:
yield line
```
but it is incomplete, as the test case fails when a delimiter is not specified, lines are separated by `'\r\n'` and the text chunk ends in the middle of the sequence, that is, ends in `'\r'` and next chunk starts with `'\n'`. So, `chunk.splitlines()` possibly needs to override `TextIOWrapper` logic in this condition.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4271/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4271/timeline
| null |
completed
| null | null | false |
[
"Yeah, this function definitely needs more work. I agree that the Fedora patch is incomplete: I also worry that it doesn't correctly handle the possibility of repeated sequences of delimiters, which *should* emit empty lines.\r\n\r\nAnyone interested in contributing should feel free to pick this up. I recommend using the test cases above as examples to guide your work, and I also recommend writing substantially more to help verify all these edge cases.",
"As a (potential) contributor looking into this, could it be clarified what Fedora has to do with this bug? I'm not understanding what is meant by the above patch being a \"Fedora patch\".",
"Hey @e-beach, thanks for your interest in contributing. This isn't an issue specific to Fedora, I believe that @pcpa is either referring to a patch already implemented by the Fedora team, or one they've written against Fedoras distribution of Requests.\r\n\r\nThat said, I'm not sure we actually need a patch here @Lukasa. I believe this was already addressed on the 3.0.0 branch with #3984.",
"The tests @pcpa wrote on the fail on the 3.0.0 branch with TypeErrors, which is different than the previous error, and indicates that the 3.0.0 API is not compatible with the proposed test. Hence this looks to me like this a non-issue, or at least not contributor-friendly :confused: ",
"Hmm, so this is because we're passing a non-BytesIO object as raw and the 3.0.0 patch assumes we're dealing in bytes. I believe that's a reasonable assumption since it's what we'll get from urllib3 but I may be missing something.",
"I switched the code to the new form using bytes instead of strings at this [gist]( https://gist.github.com/e-beach/d17e2af653b71c97174c53f86e67214b), and all tests passed.\r\nI'd say this issue could be closed.",
"Cool, works for me. Thanks for digging @e-beach and @nateprewitt!"
] |
https://api.github.com/repos/psf/requests/issues/4270
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4270/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4270/comments
|
https://api.github.com/repos/psf/requests/issues/4270/events
|
https://github.com/psf/requests/issues/4270
| 253,743,562 |
MDU6SXNzdWUyNTM3NDM1NjI=
| 4,270 |
Missing header information in Response object
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11476522?v=4",
"events_url": "https://api.github.com/users/jma1991/events{/privacy}",
"followers_url": "https://api.github.com/users/jma1991/followers",
"following_url": "https://api.github.com/users/jma1991/following{/other_user}",
"gists_url": "https://api.github.com/users/jma1991/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jma1991",
"id": 11476522,
"login": "jma1991",
"node_id": "MDQ6VXNlcjExNDc2NTIy",
"organizations_url": "https://api.github.com/users/jma1991/orgs",
"received_events_url": "https://api.github.com/users/jma1991/received_events",
"repos_url": "https://api.github.com/users/jma1991/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jma1991/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jma1991/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jma1991",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 30 |
2017-08-29T17:28:10Z
|
2021-09-08T07:00:27Z
|
2017-08-29T18:50:46Z
|
NONE
|
resolved
|
## Summary
The response object generated from a POST request is missing header information. I am using Python (3.6.2) and the requests (2.18.4) library to post a query to the [Primer-BLAST](https://www.ncbi.nlm.nih.gov/tools/primer-blast/) website. I need to retrieve the NCBI-RCGI-RetryURL field from the response's header information. However, I can only see this field when I use the HTTP trace extension in Google Chrome. [I have asked this question on StackOverflow as well.](https://stackoverflow.com/questions/45942219/missing-header-information-using-pythons-requests-library)
## Expected Result
Below is the full trace of the POST and response using Google Chrome:
```
POST https://www.ncbi.nlm.nih.gov/tools/primer-blast/primertool.cgi
Origin: https://www.ncbi.nlm.nih.gov
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBflp51Ny9ReeA5A9
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://www.ncbi.nlm.nih.gov/tools/primer-blast/index.cgi?LINK_LOC=reset
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.8
Cookie: sv-userdata-key-www.ncbi.nlm.nih.gov=G5KxXzyQ81U_vs1aHK_7XDWciF1B8AjjDUmDunVbhIZhZ4p4t_SVK4ASpbTT8iDSJVcxBH9oUAB3K2xNWjp3G0koYCloBlYuSxdoIGIkYzl2; ncbi_sid=0751457F9A561D01_0000SID; _ga=GA1.2.567134514.1503994317; _gid=GA1.2.654339584.1503994317; _gat=1; starnext=MYGwlsDWB2CmAeAXAXAbgK7RAewIYBM4lkAmAXgAcAnMAW1ioCMRcBnRAMgBYzm3FWsXFWAALDgEZymHAUkBOMgAYA7AFYpXFQDF5AQTUA2ACIBRFRKVXrN2xI4klygMJcSltQA59R0wGY/S1tg63t3Shp6JhZ2AFI/PQA5AHlE03i9PnZBYTEMlLSHcgB3UoA6aGBGMAqQWgqwUTKAc2wANwceajoGLMR81NMHQwie6P4BtIy+nJFxEhVRqL7J9ISZoTnVh08l3pj+lWcC9KON3NFYo5OHRQkuLiUOPyd5K2eJMnvH5/JPDWefjIADNcCBBM8eIgqOhYM81F83GpniMJH4SPJnosSFxnrtAoZ5Li/IoXp5DCpuE50RIpNxPlIAtxyNBcIgwG04Q8yDI8IQEJwuAiSBw1EDvk81DxPEo/KKEfIRUYyCRDIZRYtJbtaT81HcOIYnE9DAycUA=
HTTP/1.1 200 OK
Date: Tue, 29 Aug 2017 13:38:27 GMT
Server: Apache
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Referrer-Policy: origin-when-cross-origin
Content-Security-Policy: upgrade-insecure-requests
Cache-Control: no-cache, no-store, max-age=0, private, must-revalidate
Expires: 0
NCBI-PHID: 0C421A7A9A56E5310000000000000001.m_2
NCBI-RCGI-RetryURL: https://www.ncbi.nlm.nih.gov/tools/primer-blast/primertool.cgi?ctg_time=1504013907&job_key=aWO2H68Wor6FhLSBueGQs8P6gYHu6Zqc7w
NCBI-SID: 0751457F9A561D01_0000SID
Pragma: no-cache
Access-Control-Allow-Methods: POST, GET, PUT, OPTIONS, PATCH, DELETE
Access-Control-Allow-Origin: https://www.ncbi.nlm.nih.gov
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin,X-Accept-Charset,X-Accept,Content-Type,X-Requested-With,NCBI-SID,NCBI-PHID
Content-Type: text/html
Set-Cookie: ncbi_sid=0751457F9A561D01_0000SID; domain=.nih.gov; path=/; expires=Wed, 29 Aug 2018 13:38:27 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
X-UA-Compatible: IE=Edge
X-XSS-Protection: 1; mode=block
Keep-Alive: timeout=1, max=9
Connection: Keep-Alive
Transfer-Encoding: chunked
```
## Actual Result
And here is all the header information I get from my script:
```
Date : Tue, 29 Aug 2017 14:41:08 GMT
Server : Apache
Strict-Transport-Security : max-age=31536000; includeSubDomains; preload
Referrer-Policy : origin-when-cross-origin
Content-Security-Policy : upgrade-insecure-requests
Accept-Ranges : bytes
Vary : Accept-Encoding
Content-Encoding : gzip
X-UA-Compatible : IE=Edge
X-XSS-Protection : 1; mode=block
Content-Length : 2516
Keep-Alive : timeout=1, max=10
Connection : Keep-Alive
Content-Type : text/html
```
## Reproduction Steps
```python
#!/usr/bin/env python
import requests
# BaseURL being accessed
url = 'https://www.ncbi.nlm.nih.gov/tools/primer-blast/primertool.cgi'
# Dictionary of query parameters
data = {
'INPUT_SEQUENCE' : 'TCTTCTGAGAAAGTCTGAGGCTCCTTAGTACCTTCTCTAGTATGAACTGTTCAGCCTGCCCGCAAGTTGTAACTACGCAGGCGCCAAGACAGCCAACCAAGGAGGCTGCAGA'
}
# Make a POST request and read the response
with requests.session() as session:
poster = session.post(url, data=data)
for key, value in poster.headers.items():
print(key, ':', value)
```
## System Information
$ python -m requests.help
```
$ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.6"
},
"implementation": {
"name": "CPython",
"version": "3.6.2"
},
"platform": {
"release": "16.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.18.4"
},
"system_ssl": {
"version": "100020cf"
},
"urllib3": {
"version": "1.22"
},
"using_pyopenssl": false
}
```
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4270/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4270/timeline
| null |
completed
| null | null | false |
[
"What's the status code and content when you use Requests? Are you getting the response data you expect?",
"The status code is 200 and the content is just:\r\n\r\n`b'<html><head><title>Empty Result</title></head><body>Empty Result</body></html>'`\r\n\r\nWhich I believe is correct because the results take a few minutes to be processed.",
"So there are two possibilities: either the server did not send that data, or it did but the header parsing failed. Do you see any warnings emitted from your code?",
"I don't see any warnings when I run my code.",
"Hrm, we may need to try to see the raw bytes of the headers received. Can you try to use mitmproxy to show us what the actual data was?",
"Sure, let me install on my computer. Is there anything in particular you want me to run / show?",
"In the first instance, I just want you to see if mitmproxy is showing you headers that Requests is not.",
"Apologies, I have installed mitmproxy but not sure how to run it? When I run mitmproxy at the terminal it just presents with a black screen?",
"`mitmproxy` should present a curses interface, with information about the port it's running in at the bottom-right. When it does so you should make the request again, telling Requests to use it as a proxy (e.g. `proxies={'https': 'http://localhost:8080'}`).",
"I have mitmproxy running in one window, and in another I have re-run the script with the proxies parameter inlcuded in the POST function call. It now encounters an error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/connectionpool.py\", line 595, in urlopen\r\n self._prepare_proxy(conn)\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/connectionpool.py\", line 816, in _prepare_proxy\r\n conn.connect()\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/connection.py\", line 326, in connect\r\n ssl_context=context)\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/util/ssl_.py\", line 329, in ssl_wrap_socket\r\n return context.wrap_socket(sock, server_hostname=server_hostname)\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/ssl.py\", line 401, in wrap_socket\r\n _context=self, _session=session)\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/ssl.py\", line 808, in __init__\r\n self.do_handshake()\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/ssl.py\", line 1061, in do_handshake\r\n self._sslobj.do_handshake()\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/ssl.py\", line 683, in do_handshake\r\n self._sslobj.do_handshake()\r\nssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/requests/adapters.py\", line 440, in send\r\n timeout=timeout\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/connectionpool.py\", line 639, in urlopen\r\n _stacktrace=sys.exc_info()[2])\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/util/retry.py\", line 388, in increment\r\n raise MaxRetryError(_pool, url, error or ResponseError(cause))\r\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.ncbi.nlm.nih.gov', port=443): Max retries exceeded with url: /tools/primer-blast/primertool.cgi (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)'),))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"primer.py\", line 35, in <module>\r\n poster = session.post(url, data=data, proxies={'https': 'http://localhost:8080'})\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/requests/sessions.py\", line 555, in post\r\n return self.request('POST', url, data=data, json=json, **kwargs)\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/requests/sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/requests/sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/requests/adapters.py\", line 506, in send\r\n raise SSLError(e, request=request)\r\nrequests.exceptions.SSLError: HTTPSConnectionPool(host='www.ncbi.nlm.nih.gov', port=443): Max retries exceeded with url: /tools/primer-blast/primertool.cgi (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)'),))\r\n```",
"Sorry, please also set `verify=False`",
"Okay, this time I get the following message from the script:\r\n\r\n```\r\n/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n InsecureRequestWarning)\r\n```\r\nThis request in the mtmproxy window:\r\n\r\nhttps://ibb.co/i2X2K5\r\n\r\nand this response in the mtmproxy window:\r\n\r\nhttps://ibb.co/jfjSmk\r\n\r\nSo it looks as though the retryURL field is not being sent from the server?\r\n",
"That's true. Is Requests seeing all the header fields mitmproxy is? Because there are a number there that were not in your initial report.",
"It looks like Requests and mitmproxy are seeing the same fields. But HTTP trace (which is where I got the initial response using Google Chrome and the HTTP trace extension) is seeing a few more?",
"If that's coming from Chrome I assume it's because the requests are different. Can you try adding header fields and body data as needed to get them two requests to be the same?",
"Okay, I changed my script to contain the same headers:\r\n\r\n```\r\n#!/usr/bin/env python\r\n\r\nimport requests\r\nimport time\r\n\r\n# Base URL being accessed\r\nurl = 'https://www.ncbi.nlm.nih.gov/tools/primer-blast/primertool.cgi'\r\n\r\n# Dictionary of query parameters\r\ndata = {\r\n 'INPUT_SEQUENCE' : 'TCTTCTGAGAAAGTCTGAGGCTCCTTAGTACCTTCTCTAGTATGAACTGTTCAGCCTGCCCGCAAGTTGTAACTACGCAGGCGCCAAGACAGCCAACCAAGGAGGCTGCAGA',\r\n# 'ORGANISM' : 'Mus musculus',\r\n# 'PRIMER_SPECIFICITY_DATABASE' : 'PRIMERDB/genome_selected_species'\r\n}\r\n\r\n# Extra headers\r\nheaders = {\r\n 'Origin' : 'https://www.ncbi.nlm.nih.gov',\r\n 'Upgrade-Insecure-Requests' : '1',\r\n 'User-Agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',\r\n 'Content-Type' : 'multipart/form-data; boundary=----WebKitFormBoundaryBflp51Ny9ReeA5A9',\r\n 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',\r\n 'Referer' : 'https://www.ncbi.nlm.nih.gov/tools/primer-blast/index.cgi?LINK_LOC=reset',\r\n 'Accept-Encoding' : 'gzip, deflate, br',\r\n 'Accept-Language' : 'en-US,en;q=0.8',\r\n 'Cookie' : 'sv-userdata-key-www.ncbi.nlm.nih.gov=G5KxXzyQ81U_vs1aHK_7XDWciF1B8AjjDUmDunVbhIZhZ4p4t_SVK4ASpbTT8iDSJVcxBH9oUAB3K2xNWjp3G0koYCloBlYuSxdoIGIkYzl2; ncbi_sid=0751457F9A561D01_0000SID; _ga=GA1.2.567134514.1503994317; _gid=GA1.2.654339584.1503994317; _gat=1; starnext=MYGwlsDWB2CmAeAXAXAbgK7RAewIYBM4lkAmAXgAcAnMAW1ioCMRcBnRAMgBYzm3FWsXFWAALDgEZymHAUkBOMgAYA7AFYpXFQDF5AQTUA2ACIBRFRKVXrN2xI4klygMJcSltQA59R0wGY/S1tg63t3Shp6JhZ2AFI/PQA5AHlE03i9PnZBYTEMlLSHcgB3UoA6aGBGMAqQWgqwUTKAc2wANwceajoGLMR81NMHQwie6P4BtIy+nJFxEhVRqL7J9ISZoTnVh08l3pj+lWcC9KON3NFYo5OHRQkuLiUOPyd5K2eJMnvH5/JPDWefjIADNcCBBM8eIgqOhYM81F83GpniMJH4SPJnosSFxnrtAoZ5Li/IoXp5DCpuE50RIpNxPlIAtxyNBcIgwG04Q8yDI8IQEJwuAiSBw1EDvk81DxPEo/KKEfIRUYyCRDIZRYtJbtaT81HcOIYnE9DAycUA='\r\n}\r\n\r\nauth = ('[email protected]', 'password')\r\n\r\n# Setup a session\r\nwith requests.session() as session:\r\n\r\n # Make a POST request and read the response\r\n poster = session.post(url, data=data, headers=headers, proxies={'https': 'http://localhost:8080'}, verify=False)\r\n\r\n # Requests header\r\n print('-' * 50, 'Requests header', '-' * 50)\r\n for key, value in poster.request.headers.items():\r\n print(key, ':', value)\r\n\r\n # Response header\r\n print('-' * 50, 'Response header', '-' * 50)\r\n for key, value in poster.headers.items():\r\n print(key, ':', value)\r\n\r\n # Print status code\r\n print('-' * 50, 'Status code', '-' * 50)\r\n print(poster.status_code)\r\n\r\n # Print content\r\n print('-' * 50, 'Response content', '-' * 50)\r\n print(poster.content)\r\n```\r\nHere is the output from the script:\r\n\r\n```\r\n/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n InsecureRequestWarning)\r\n-------------------------------------------------- Requests header --------------------------------------------------\r\nUser-Agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36\r\nAccept-Encoding : gzip, deflate, br\r\nAccept : text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\r\nConnection : keep-alive\r\nOrigin : https://www.ncbi.nlm.nih.gov\r\nUpgrade-Insecure-Requests : 1\r\nContent-Type : multipart/form-data; boundary=----WebKitFormBoundaryBflp51Ny9ReeA5A9\r\nReferer : https://www.ncbi.nlm.nih.gov/tools/primer-blast/index.cgi?LINK_LOC=reset\r\nAccept-Language : en-US,en;q=0.8\r\nCookie : sv-userdata-key-www.ncbi.nlm.nih.gov=G5KxXzyQ81U_vs1aHK_7XDWciF1B8AjjDUmDunVbhIZhZ4p4t_SVK4ASpbTT8iDSJVcxBH9oUAB3K2xNWjp3G0koYCloBlYuSxdoIGIkYzl2; ncbi_sid=0751457F9A561D01_0000SID; _ga=GA1.2.567134514.1503994317; _gid=GA1.2.654339584.1503994317; _gat=1; starnext=MYGwlsDWB2CmAeAXAXAbgK7RAewIYBM4lkAmAXgAcAnMAW1ioCMRcBnRAMgBYzm3FWsXFWAALDgEZymHAUkBOMgAYA7AFYpXFQDF5AQTUA2ACIBRFRKVXrN2xI4klygMJcSltQA59R0wGY/S1tg63t3Shp6JhZ2AFI/PQA5AHlE03i9PnZBYTEMlLSHcgB3UoA6aGBGMAqQWgqwUTKAc2wANwceajoGLMR81NMHQwie6P4BtIy+nJFxEhVRqL7J9ISZoTnVh08l3pj+lWcC9KON3NFYo5OHRQkuLiUOPyd5K2eJMnvH5/JPDWefjIADNcCBBM8eIgqOhYM81F83GpniMJH4SPJnosSFxnrtAoZ5Li/IoXp5DCpuE50RIpNxPlIAtxyNBcIgwG04Q8yDI8IQEJwuAiSBw1EDvk81DxPEo/KKEfIRUYyCRDIZRYtJbtaT81HcOIYnE9DAycUA=\r\nContent-Length : 127\r\n-------------------------------------------------- Response header --------------------------------------------------\r\nDate : Tue, 29 Aug 2017 18:17:53 GMT\r\nServer : Apache\r\nStrict-Transport-Security : max-age=31536000; includeSubDomains; preload\r\nReferrer-Policy : origin-when-cross-origin\r\nContent-Security-Policy : upgrade-insecure-requests\r\nAccept-Ranges : bytes\r\nVary : Accept-Encoding\r\nContent-Encoding : gzip\r\nX-UA-Compatible : IE=Edge\r\nX-XSS-Protection : 1; mode=block\r\nContent-Length : 2517\r\nKeep-Alive : timeout=1, max=10\r\nConnection : Keep-Alive\r\nContent-Type : text/html\r\n-------------------------------------------------- Status code --------------------------------------------------\r\n403\r\n-------------------------------------------------- Response content --------------------------------------------------\r\nb'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"> \\n\\n<html>\\n\\n<head>\\n<title>NCBI - WWW Error 403 Diagnostic</title>\\n<meta http-equiv=\"Content-Type\" content=\"application/xhtml+xml; charset=utf-8\" />\\n<meta http-equiv=\"pragma\" content=\"no-cache\" />\\n<meta http-equiv=\"cache-control\" content=\"no-cache\" />\\n<meta name=\"robots\" content=\"noarchive,none\" />\\n\\n<style type=\"text/css\">\\nbody {\\nmin-width: 950px;\\n_width: 950px;\\n}\\nh1.error {color: red; font-size: 40pt}\\n\\n#mainContent {\\npadding: 1em 2em;\\n}\\n\\ndl#diags {\\npadding: 0.5em 0.5em 1.5em 0.5em;\\npadding-left: 2em;\\nborder: solid 1px #888;\\nborder-left: none;\\nborder-right: none;\\nmargin-bottom:0;\\nbackground-color:#eeeeee;\\ncolor:#666;\\nfont-size: 80%;\\n_font-size: 70%;\\nfont-family: Verdana, sans-serif;\\n}\\n\\ndl#diags dt {\\nfloat: left;\\nfont-weight: bold;\\nwidth: auto;\\n}\\n\\ndl#diags dd {\\nmargin-left:1em;\\nfloat: left;\\nmargin-right: 2em;\\n}\\n\\n#footer span {\\nfloat: left;\\ncolor: #888;\\nfont-size: 80%;\\n}\\n\\n#footer {\\ntext-align: right;\\npadding: 0 0.5em;\\nclear: left;\\n}\\n\\n#footer img {\\nborder: none;\\n}\\n\\n.ncbi {\\nmargin: 0;\\npadding:0;\\nfont-size:240%;\\nfont-weight: bold;\\nfont-family: Times, serif;\\ncolor: #336699;\\nfloat: left;\\ndisplay: inline;\\n}\\n\\n.ncbi a {\\ntext-decoration: none;\\ncolor: #336699;\\n}\\n\\n.ncbi a:visited {\\ntext-decoration: none;\\ncolor: #336699;\\n}\\n\\n.ncbi a:hover {\\ntext-decoration: underline;\\n}\\n\\n.message {\\nfont-family: Verdana, sans-serif;\\nbackground-color: #336699;\\ncolor: white;\\npadding: .35em;\\nmargin-left: 7em;\\nmargin-top: .67em;\\n_margin-top: 0.5em;\\nfont-weight: bold;\\nfont-size: 100%;\\nmargin-bottom: 0;\\n}\\n\\nh1 {\\nclear: left;\\nfont-size: 110%;\\nfont-family: Verdana, sans-serif;\\n}\\n\\n\\nbody.denied {\\nbackground-color: black;\\ncolor: white;\\n}\\n\\nbody.denied h1 {\\ncolor: red;\\n}\\n\\nbody.denied a {\\ncolor: green;\\n}\\n\\nbody.denied #footer, body.denied #diags {\\ncolor: black;\\n}\\n\\n#searchme:focus {\\nbackground-color: #ffa;\\n}\\n\\n.errurl {\\nletter-spacing: 0;\\nmargin: 0 1em;\\npadding: 0.25em;\\nbackground-color: #fff0f0;\\ncolor: #c00;\\nfont-family: \"Courier New\", Courier, monospace;\\nfont-size: 90%;\\n_font-size: 80%;\\n}\\n\\nbody.denied .errurl {\\nbackground-color: black;\\ncolor: yellow;\\n}\\n\\nspan.x {\\ndisplay: none;\\n}\\n\\n</style>\\n\\n<!--[if IE]>\\n<script type=\"text/javascript\">\\n/* <![CDATA[ */\\n_isIE=1;\\n/* ]]> */\\n</script>\\n<![endif]-->\\n\\n<script type=\"text/javascript\">\\n/* <![CDATA[ */\\naddEvent = function(obj, type, fn, b) {\\n if (obj.attachEvent) {\\n var name = \"\" + type + fn; \\n name = name.substring(0, name.indexOf(\"\\\\n\"));\\n obj[\"e\" + name] = fn;\\n obj[name] = function(){ obj[\"e\" + name](window.event);}\\n obj.attachEvent(\"on\" + type, obj[name]);\\n } else {\\n obj.addEventListener(type, fn, b);\\n return true;\\n }\\n}\\n\\nfixlink = function() {\\n var ie = typeof(_isIE) != \\'undefined\\';\\n var v = document.getElementById(\"mlink\");\\n\\n if (v) {\\n var ieHACK = v.innerHTML;\\n var newText;\\n\\n newText = \"%3E%20REQUEST_URI%3D\" + document.REQUEST_URI + \"%0D\" +\\n \"%3E%20HTTP_HOST%3D\" + document.HTTP_HOST + \"%0D\" +\\n \"%3E%20REMOTE_ADDR%3D\" + document.REMOTE_ADDR + \"%0D\" +\\n \"%3E%20REQUEST_METHOD%3D\" + document.REQUEST_METHOD + \"%0D\";\\n\\n var href = v.getAttribute(\"href\");\\n newText = newText.replace(/\\'/g, \"%27\");\\n newText = newText.replace(/\\\\?/g, \"%3F\");\\n\\n // IE bugfixes\\n if (ie) {\\n var m = /(.*)\\\\?(.*)/.exec(href);\\n if (m) {\\n href = m[1] + \"?\" + escape(m[2]);\\n }\\n href = href.replace(/(.*)(%0D-----%0D.*)/m, \"$1\" + newText + \"$2\");\\n href = href.replace(/subject%3D/, \"subject=\");\\n href = href.replace(/%26body%3D/, \"&body=\");\\n href=href.replace(/%0D/mg, \"%0A\");\\n } else {\\n href = href.replace(/(.*)(%0D-----%0D.*)/m, \"$1\" + newText + \"$2\");\\n }\\n v.setAttribute(\"href\", href);\\n v.innerHTML = ieHACK; // I can\\'t believe this...\\n } \\n v = document.getElementById(\"searchme\");\\n if (v) { v.focus(); }\\n}\\n\\n\\naddEvent(window, \"load\", fixlink, false);\\n/* ]]> */\\n</script>\\n\\n\\n</head>\\n\\n<body>\\n\\n<div id=\\'header\\'>\\n<a href=\"#mainContent\" title=\"Skip to main content\" />\\n<p class=\"ncbi\"><a href=\"http://www.ncbi.nlm.nih.gov\">NCBI</a></p>\\n<p class=\"message\">Error</p>\\n</div>\\n\\n<div id=\\'mainContent\\'>\\n<h1>The requested page has restricted access</h1>\\n\\n<p class=\\'errurl\\'>\\n<script type=\"text/javascript\">\\n/* <![CDATA[ */\\n document.REQUEST_URI = \"/tools/primer-blast/primertool.cgi\";\\n document.HTTP_HOST = \"www.ncbi.nlm.nih.gov\";\\n document.REMOTE_ADDR = \"192.41.130.86\";\\n document.REQUEST_METHOD = \"GET\";\\n\\n var p = \"http://\" + document.HTTP_HOST + document.REQUEST_URI;\\n p = p.replace(/(.)/g, \"<span class=\\\\\"x\\\\\"> </span>$1\");\\n p = p.replace(/\\'/g, \"'\");\\n document.write(p);\\n// document.write(p.replace(/[^A-Za-z0-9\\\\#\\\\;\\\\:\\\\.\\\\/\\\\?&\\\\=\\\\_\\\\- ]*/g, \"<span class=\\'x\\'> </span>\"));\\n/* ]]> */\\n</script>\\n</p>\\n\\n<p>\\nYou have requested a page which is not open to the public. Your\\nrequest did not meet the criteria required to grant access to this\\npage.\\n</p>\\n\\n<p>\\nIf you believe that you are being denied access to the page in\\nerror, send an e-mail problem report to <a id=\\'mlink\\'\\nhref=\"mailto:[email protected]?subject=NCBI%20Web%20site%20error%20403&body=%3E%20Error%3D403%0D%3E%20Server%3D130.14.29.110%0D%3E%20Client%3D192.41.130.86%0D%3E%20Time%3DTuesday, 29-Aug-2017 14:17:53 EDT%0D%0D-----%0DPlease%20enter%20comments%20below:%0D%0D\">[email protected]</a>. \\n</p>\\n\\n\\n<form method=\"post\" action=\"http://www.ncbi.nlm.nih.gov/gquery/gquery.fcgi\"\\n enctype=\"application/x-www-form-urlencoded\">\\n<p>\\n<strong>Search NCBI</strong>\\n<input name=\"term\" size=\"40\" style=\"margin-left: 1em; border: solid 1px #336699;\" id=\"searchme\"/>\\n<input type=\"submit\" value=\"Go\" />\\n</p>\\n</form>\\n\\n\\n</div>\\n\\n<dl id=\"diags\">\\n <dt>Error</dt><dd>403</dd>\\n <dt>Server</dt><dd>130.14.29.110</dd>\\n <dt>Client</dt><dd>192.41.130.86</dd>\\n <dt>Time</dt><dd>Tuesday, 29-Aug-2017 14:17:53 EDT</dd>\\n</dl>\\n\\n<p id=\\'footer\\'>\\n\\n<span id=\\'rev\\'>Rev. 18 Jul 2017 16:09:24 EDT</span>\\n<!-- <a href=\"http://validator.w3.org/check?uri=referer\"><img src=\"http://www.w3.org/Icons/valid-xhtml11\" alt=\"Valid XHTML 1.1!\" /></a> -->\\n</p>\\n\\n</body>\\n</html>\\n\\n'\r\n```\r\nHere is the request and response from mitmproxy:\r\n\r\nhttps://ibb.co/ngTjz5\r\nhttps://ibb.co/cfmtsQ\r\n\r\nSo this time I'm getting a 403 error. Maybe the server maintainers have blocked script requests somehow?",
"That cookie may be a problem. Does this service require logging in?",
"Nope, it's free to use for anyone and doesn't require you to login with any user ID or password.",
"Hrm, well we need to fix the 403 error. Try removing the Cookie header and see what happens.",
"Without the Cookie header I get the following content from the script:\r\n\r\n```\r\n/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n InsecureRequestWarning)\r\n-------------------------------------------------- Requests header --------------------------------------------------\r\nUser-Agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36\r\nAccept-Encoding : gzip, deflate, br\r\nAccept : text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\r\nConnection : keep-alive\r\nOrigin : https://www.ncbi.nlm.nih.gov\r\nUpgrade-Insecure-Requests : 1\r\nContent-Type : multipart/form-data; boundary=----WebKitFormBoundaryBflp51Ny9ReeA5A9\r\nReferer : https://www.ncbi.nlm.nih.gov/tools/primer-blast/index.cgi?LINK_LOC=reset\r\nAccept-Language : en-US,en;q=0.8\r\nContent-Length : 127\r\n-------------------------------------------------- Response header --------------------------------------------------\r\nDate : Tue, 29 Aug 2017 18:25:39 GMT\r\nServer : Apache\r\nStrict-Transport-Security : max-age=31536000; includeSubDomains; preload\r\nReferrer-Policy : origin-when-cross-origin\r\nContent-Security-Policy : upgrade-insecure-requests\r\nAccept-Ranges : bytes\r\nVary : Accept-Encoding\r\nContent-Encoding : gzip\r\nX-UA-Compatible : IE=Edge\r\nX-XSS-Protection : 1; mode=block\r\nContent-Length : 2517\r\nKeep-Alive : timeout=1, max=10\r\nConnection : Keep-Alive\r\nContent-Type : text/html\r\n-------------------------------------------------- Status code --------------------------------------------------\r\n403\r\n-------------------------------------------------- Response content --------------------------------------------------\r\nb'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"> \\n\\n<html>\\n\\n<head>\\n<title>NCBI - WWW Error 403 Diagnostic</title>\\n<meta http-equiv=\"Content-Type\" content=\"application/xhtml+xml; charset=utf-8\" />\\n<meta http-equiv=\"pragma\" content=\"no-cache\" />\\n<meta http-equiv=\"cache-control\" content=\"no-cache\" />\\n<meta name=\"robots\" content=\"noarchive,none\" />\\n\\n<style type=\"text/css\">\\nbody {\\nmin-width: 950px;\\n_width: 950px;\\n}\\nh1.error {color: red; font-size: 40pt}\\n\\n#mainContent {\\npadding: 1em 2em;\\n}\\n\\ndl#diags {\\npadding: 0.5em 0.5em 1.5em 0.5em;\\npadding-left: 2em;\\nborder: solid 1px #888;\\nborder-left: none;\\nborder-right: none;\\nmargin-bottom:0;\\nbackground-color:#eeeeee;\\ncolor:#666;\\nfont-size: 80%;\\n_font-size: 70%;\\nfont-family: Verdana, sans-serif;\\n}\\n\\ndl#diags dt {\\nfloat: left;\\nfont-weight: bold;\\nwidth: auto;\\n}\\n\\ndl#diags dd {\\nmargin-left:1em;\\nfloat: left;\\nmargin-right: 2em;\\n}\\n\\n#footer span {\\nfloat: left;\\ncolor: #888;\\nfont-size: 80%;\\n}\\n\\n#footer {\\ntext-align: right;\\npadding: 0 0.5em;\\nclear: left;\\n}\\n\\n#footer img {\\nborder: none;\\n}\\n\\n.ncbi {\\nmargin: 0;\\npadding:0;\\nfont-size:240%;\\nfont-weight: bold;\\nfont-family: Times, serif;\\ncolor: #336699;\\nfloat: left;\\ndisplay: inline;\\n}\\n\\n.ncbi a {\\ntext-decoration: none;\\ncolor: #336699;\\n}\\n\\n.ncbi a:visited {\\ntext-decoration: none;\\ncolor: #336699;\\n}\\n\\n.ncbi a:hover {\\ntext-decoration: underline;\\n}\\n\\n.message {\\nfont-family: Verdana, sans-serif;\\nbackground-color: #336699;\\ncolor: white;\\npadding: .35em;\\nmargin-left: 7em;\\nmargin-top: .67em;\\n_margin-top: 0.5em;\\nfont-weight: bold;\\nfont-size: 100%;\\nmargin-bottom: 0;\\n}\\n\\nh1 {\\nclear: left;\\nfont-size: 110%;\\nfont-family: Verdana, sans-serif;\\n}\\n\\n\\nbody.denied {\\nbackground-color: black;\\ncolor: white;\\n}\\n\\nbody.denied h1 {\\ncolor: red;\\n}\\n\\nbody.denied a {\\ncolor: green;\\n}\\n\\nbody.denied #footer, body.denied #diags {\\ncolor: black;\\n}\\n\\n#searchme:focus {\\nbackground-color: #ffa;\\n}\\n\\n.errurl {\\nletter-spacing: 0;\\nmargin: 0 1em;\\npadding: 0.25em;\\nbackground-color: #fff0f0;\\ncolor: #c00;\\nfont-family: \"Courier New\", Courier, monospace;\\nfont-size: 90%;\\n_font-size: 80%;\\n}\\n\\nbody.denied .errurl {\\nbackground-color: black;\\ncolor: yellow;\\n}\\n\\nspan.x {\\ndisplay: none;\\n}\\n\\n</style>\\n\\n<!--[if IE]>\\n<script type=\"text/javascript\">\\n/* <![CDATA[ */\\n_isIE=1;\\n/* ]]> */\\n</script>\\n<![endif]-->\\n\\n<script type=\"text/javascript\">\\n/* <![CDATA[ */\\naddEvent = function(obj, type, fn, b) {\\n if (obj.attachEvent) {\\n var name = \"\" + type + fn; \\n name = name.substring(0, name.indexOf(\"\\\\n\"));\\n obj[\"e\" + name] = fn;\\n obj[name] = function(){ obj[\"e\" + name](window.event);}\\n obj.attachEvent(\"on\" + type, obj[name]);\\n } else {\\n obj.addEventListener(type, fn, b);\\n return true;\\n }\\n}\\n\\nfixlink = function() {\\n var ie = typeof(_isIE) != \\'undefined\\';\\n var v = document.getElementById(\"mlink\");\\n\\n if (v) {\\n var ieHACK = v.innerHTML;\\n var newText;\\n\\n newText = \"%3E%20REQUEST_URI%3D\" + document.REQUEST_URI + \"%0D\" +\\n \"%3E%20HTTP_HOST%3D\" + document.HTTP_HOST + \"%0D\" +\\n \"%3E%20REMOTE_ADDR%3D\" + document.REMOTE_ADDR + \"%0D\" +\\n \"%3E%20REQUEST_METHOD%3D\" + document.REQUEST_METHOD + \"%0D\";\\n\\n var href = v.getAttribute(\"href\");\\n newText = newText.replace(/\\'/g, \"%27\");\\n newText = newText.replace(/\\\\?/g, \"%3F\");\\n\\n // IE bugfixes\\n if (ie) {\\n var m = /(.*)\\\\?(.*)/.exec(href);\\n if (m) {\\n href = m[1] + \"?\" + escape(m[2]);\\n }\\n href = href.replace(/(.*)(%0D-----%0D.*)/m, \"$1\" + newText + \"$2\");\\n href = href.replace(/subject%3D/, \"subject=\");\\n href = href.replace(/%26body%3D/, \"&body=\");\\n href=href.replace(/%0D/mg, \"%0A\");\\n } else {\\n href = href.replace(/(.*)(%0D-----%0D.*)/m, \"$1\" + newText + \"$2\");\\n }\\n v.setAttribute(\"href\", href);\\n v.innerHTML = ieHACK; // I can\\'t believe this...\\n } \\n v = document.getElementById(\"searchme\");\\n if (v) { v.focus(); }\\n}\\n\\n\\naddEvent(window, \"load\", fixlink, false);\\n/* ]]> */\\n</script>\\n\\n\\n</head>\\n\\n<body>\\n\\n<div id=\\'header\\'>\\n<a href=\"#mainContent\" title=\"Skip to main content\" />\\n<p class=\"ncbi\"><a href=\"http://www.ncbi.nlm.nih.gov\">NCBI</a></p>\\n<p class=\"message\">Error</p>\\n</div>\\n\\n<div id=\\'mainContent\\'>\\n<h1>The requested page has restricted access</h1>\\n\\n<p class=\\'errurl\\'>\\n<script type=\"text/javascript\">\\n/* <![CDATA[ */\\n document.REQUEST_URI = \"/tools/primer-blast/primertool.cgi\";\\n document.HTTP_HOST = \"www.ncbi.nlm.nih.gov\";\\n document.REMOTE_ADDR = \"192.41.130.86\";\\n document.REQUEST_METHOD = \"GET\";\\n\\n var p = \"http://\" + document.HTTP_HOST + document.REQUEST_URI;\\n p = p.replace(/(.)/g, \"<span class=\\\\\"x\\\\\"> </span>$1\");\\n p = p.replace(/\\'/g, \"'\");\\n document.write(p);\\n// document.write(p.replace(/[^A-Za-z0-9\\\\#\\\\;\\\\:\\\\.\\\\/\\\\?&\\\\=\\\\_\\\\- ]*/g, \"<span class=\\'x\\'> </span>\"));\\n/* ]]> */\\n</script>\\n</p>\\n\\n<p>\\nYou have requested a page which is not open to the public. Your\\nrequest did not meet the criteria required to grant access to this\\npage.\\n</p>\\n\\n<p>\\nIf you believe that you are being denied access to the page in\\nerror, send an e-mail problem report to <a id=\\'mlink\\'\\nhref=\"mailto:[email protected]?subject=NCBI%20Web%20site%20error%20403&body=%3E%20Error%3D403%0D%3E%20Server%3D130.14.29.110%0D%3E%20Client%3D192.41.130.86%0D%3E%20Time%3DTuesday, 29-Aug-2017 14:25:39 EDT%0D%0D-----%0DPlease%20enter%20comments%20below:%0D%0D\">[email protected]</a>. \\n</p>\\n\\n\\n<form method=\"post\" action=\"http://www.ncbi.nlm.nih.gov/gquery/gquery.fcgi\"\\n enctype=\"application/x-www-form-urlencoded\">\\n<p>\\n<strong>Search NCBI</strong>\\n<input name=\"term\" size=\"40\" style=\"margin-left: 1em; border: solid 1px #336699;\" id=\"searchme\"/>\\n<input type=\"submit\" value=\"Go\" />\\n</p>\\n</form>\\n\\n\\n</div>\\n\\n<dl id=\"diags\">\\n <dt>Error</dt><dd>403</dd>\\n <dt>Server</dt><dd>130.14.29.110</dd>\\n <dt>Client</dt><dd>192.41.130.86</dd>\\n <dt>Time</dt><dd>Tuesday, 29-Aug-2017 14:25:39 EDT</dd>\\n</dl>\\n\\n<p id=\\'footer\\'>\\n\\n<span id=\\'rev\\'>Rev. 18 Jul 2017 16:09:24 EDT</span>\\n<!-- <a href=\"http://validator.w3.org/check?uri=referer\"><img src=\"http://www.w3.org/Icons/valid-xhtml11\" alt=\"Valid XHTML 1.1!\" /></a> -->\\n</p>\\n\\n</body>\\n</html>\\n\\n'\r\n```\r\nand the following from mitmproxy:\r\n\r\nhttps://ibb.co/iUGF6k\r\nhttps://ibb.co/nFamCQ\r\n\r\nThis time it's another 403 error",
"Try removing `Referer` as well.",
"Sadly it looks to be the same error with Referer header removed...\r\n\r\nScript output:\r\n```\r\n/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n InsecureRequestWarning)\r\n-------------------------------------------------- Requests header --------------------------------------------------\r\nUser-Agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36\r\nAccept-Encoding : gzip, deflate, br\r\nAccept : text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\r\nConnection : keep-alive\r\nOrigin : https://www.ncbi.nlm.nih.gov\r\nUpgrade-Insecure-Requests : 1\r\nContent-Type : multipart/form-data; boundary=----WebKitFormBoundaryBflp51Ny9ReeA5A9\r\nAccept-Language : en-US,en;q=0.8\r\nContent-Length : 127\r\n-------------------------------------------------- Response header --------------------------------------------------\r\nDate : Tue, 29 Aug 2017 18:30:42 GMT\r\nServer : Apache\r\nStrict-Transport-Security : max-age=31536000; includeSubDomains; preload\r\nReferrer-Policy : origin-when-cross-origin\r\nContent-Security-Policy : upgrade-insecure-requests\r\nAccept-Ranges : bytes\r\nVary : Accept-Encoding\r\nContent-Encoding : gzip\r\nX-UA-Compatible : IE=Edge\r\nX-XSS-Protection : 1; mode=block\r\nContent-Length : 2516\r\nKeep-Alive : timeout=1, max=10\r\nConnection : Keep-Alive\r\nContent-Type : text/html\r\n-------------------------------------------------- Status code --------------------------------------------------\r\n403\r\n-------------------------------------------------- Response content --------------------------------------------------\r\nb'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"> \\n\\n<html>\\n\\n<head>\\n<title>NCBI - WWW Error 403 Diagnostic</title>\\n<meta http-equiv=\"Content-Type\" content=\"application/xhtml+xml; charset=utf-8\" />\\n<meta http-equiv=\"pragma\" content=\"no-cache\" />\\n<meta http-equiv=\"cache-control\" content=\"no-cache\" />\\n<meta name=\"robots\" content=\"noarchive,none\" />\\n\\n<style type=\"text/css\">\\nbody {\\nmin-width: 950px;\\n_width: 950px;\\n}\\nh1.error {color: red; font-size: 40pt}\\n\\n#mainContent {\\npadding: 1em 2em;\\n}\\n\\ndl#diags {\\npadding: 0.5em 0.5em 1.5em 0.5em;\\npadding-left: 2em;\\nborder: solid 1px #888;\\nborder-left: none;\\nborder-right: none;\\nmargin-bottom:0;\\nbackground-color:#eeeeee;\\ncolor:#666;\\nfont-size: 80%;\\n_font-size: 70%;\\nfont-family: Verdana, sans-serif;\\n}\\n\\ndl#diags dt {\\nfloat: left;\\nfont-weight: bold;\\nwidth: auto;\\n}\\n\\ndl#diags dd {\\nmargin-left:1em;\\nfloat: left;\\nmargin-right: 2em;\\n}\\n\\n#footer span {\\nfloat: left;\\ncolor: #888;\\nfont-size: 80%;\\n}\\n\\n#footer {\\ntext-align: right;\\npadding: 0 0.5em;\\nclear: left;\\n}\\n\\n#footer img {\\nborder: none;\\n}\\n\\n.ncbi {\\nmargin: 0;\\npadding:0;\\nfont-size:240%;\\nfont-weight: bold;\\nfont-family: Times, serif;\\ncolor: #336699;\\nfloat: left;\\ndisplay: inline;\\n}\\n\\n.ncbi a {\\ntext-decoration: none;\\ncolor: #336699;\\n}\\n\\n.ncbi a:visited {\\ntext-decoration: none;\\ncolor: #336699;\\n}\\n\\n.ncbi a:hover {\\ntext-decoration: underline;\\n}\\n\\n.message {\\nfont-family: Verdana, sans-serif;\\nbackground-color: #336699;\\ncolor: white;\\npadding: .35em;\\nmargin-left: 7em;\\nmargin-top: .67em;\\n_margin-top: 0.5em;\\nfont-weight: bold;\\nfont-size: 100%;\\nmargin-bottom: 0;\\n}\\n\\nh1 {\\nclear: left;\\nfont-size: 110%;\\nfont-family: Verdana, sans-serif;\\n}\\n\\n\\nbody.denied {\\nbackground-color: black;\\ncolor: white;\\n}\\n\\nbody.denied h1 {\\ncolor: red;\\n}\\n\\nbody.denied a {\\ncolor: green;\\n}\\n\\nbody.denied #footer, body.denied #diags {\\ncolor: black;\\n}\\n\\n#searchme:focus {\\nbackground-color: #ffa;\\n}\\n\\n.errurl {\\nletter-spacing: 0;\\nmargin: 0 1em;\\npadding: 0.25em;\\nbackground-color: #fff0f0;\\ncolor: #c00;\\nfont-family: \"Courier New\", Courier, monospace;\\nfont-size: 90%;\\n_font-size: 80%;\\n}\\n\\nbody.denied .errurl {\\nbackground-color: black;\\ncolor: yellow;\\n}\\n\\nspan.x {\\ndisplay: none;\\n}\\n\\n</style>\\n\\n<!--[if IE]>\\n<script type=\"text/javascript\">\\n/* <![CDATA[ */\\n_isIE=1;\\n/* ]]> */\\n</script>\\n<![endif]-->\\n\\n<script type=\"text/javascript\">\\n/* <![CDATA[ */\\naddEvent = function(obj, type, fn, b) {\\n if (obj.attachEvent) {\\n var name = \"\" + type + fn; \\n name = name.substring(0, name.indexOf(\"\\\\n\"));\\n obj[\"e\" + name] = fn;\\n obj[name] = function(){ obj[\"e\" + name](window.event);}\\n obj.attachEvent(\"on\" + type, obj[name]);\\n } else {\\n obj.addEventListener(type, fn, b);\\n return true;\\n }\\n}\\n\\nfixlink = function() {\\n var ie = typeof(_isIE) != \\'undefined\\';\\n var v = document.getElementById(\"mlink\");\\n\\n if (v) {\\n var ieHACK = v.innerHTML;\\n var newText;\\n\\n newText = \"%3E%20REQUEST_URI%3D\" + document.REQUEST_URI + \"%0D\" +\\n \"%3E%20HTTP_HOST%3D\" + document.HTTP_HOST + \"%0D\" +\\n \"%3E%20REMOTE_ADDR%3D\" + document.REMOTE_ADDR + \"%0D\" +\\n \"%3E%20REQUEST_METHOD%3D\" + document.REQUEST_METHOD + \"%0D\";\\n\\n var href = v.getAttribute(\"href\");\\n newText = newText.replace(/\\'/g, \"%27\");\\n newText = newText.replace(/\\\\?/g, \"%3F\");\\n\\n // IE bugfixes\\n if (ie) {\\n var m = /(.*)\\\\?(.*)/.exec(href);\\n if (m) {\\n href = m[1] + \"?\" + escape(m[2]);\\n }\\n href = href.replace(/(.*)(%0D-----%0D.*)/m, \"$1\" + newText + \"$2\");\\n href = href.replace(/subject%3D/, \"subject=\");\\n href = href.replace(/%26body%3D/, \"&body=\");\\n href=href.replace(/%0D/mg, \"%0A\");\\n } else {\\n href = href.replace(/(.*)(%0D-----%0D.*)/m, \"$1\" + newText + \"$2\");\\n }\\n v.setAttribute(\"href\", href);\\n v.innerHTML = ieHACK; // I can\\'t believe this...\\n } \\n v = document.getElementById(\"searchme\");\\n if (v) { v.focus(); }\\n}\\n\\n\\naddEvent(window, \"load\", fixlink, false);\\n/* ]]> */\\n</script>\\n\\n\\n</head>\\n\\n<body>\\n\\n<div id=\\'header\\'>\\n<a href=\"#mainContent\" title=\"Skip to main content\" />\\n<p class=\"ncbi\"><a href=\"http://www.ncbi.nlm.nih.gov\">NCBI</a></p>\\n<p class=\"message\">Error</p>\\n</div>\\n\\n<div id=\\'mainContent\\'>\\n<h1>The requested page has restricted access</h1>\\n\\n<p class=\\'errurl\\'>\\n<script type=\"text/javascript\">\\n/* <![CDATA[ */\\n document.REQUEST_URI = \"/tools/primer-blast/primertool.cgi\";\\n document.HTTP_HOST = \"www.ncbi.nlm.nih.gov\";\\n document.REMOTE_ADDR = \"192.41.130.86\";\\n document.REQUEST_METHOD = \"GET\";\\n\\n var p = \"http://\" + document.HTTP_HOST + document.REQUEST_URI;\\n p = p.replace(/(.)/g, \"<span class=\\\\\"x\\\\\"> </span>$1\");\\n p = p.replace(/\\'/g, \"'\");\\n document.write(p);\\n// document.write(p.replace(/[^A-Za-z0-9\\\\#\\\\;\\\\:\\\\.\\\\/\\\\?&\\\\=\\\\_\\\\- ]*/g, \"<span class=\\'x\\'> </span>\"));\\n/* ]]> */\\n</script>\\n</p>\\n\\n<p>\\nYou have requested a page which is not open to the public. Your\\nrequest did not meet the criteria required to grant access to this\\npage.\\n</p>\\n\\n<p>\\nIf you believe that you are being denied access to the page in\\nerror, send an e-mail problem report to <a id=\\'mlink\\'\\nhref=\"mailto:[email protected]?subject=NCBI%20Web%20site%20error%20403&body=%3E%20Error%3D403%0D%3E%20Server%3D130.14.29.110%0D%3E%20Client%3D192.41.130.86%0D%3E%20Time%3DTuesday, 29-Aug-2017 14:30:42 EDT%0D%0D-----%0DPlease%20enter%20comments%20below:%0D%0D\">[email protected]</a>. \\n</p>\\n\\n\\n<form method=\"post\" action=\"http://www.ncbi.nlm.nih.gov/gquery/gquery.fcgi\"\\n enctype=\"application/x-www-form-urlencoded\">\\n<p>\\n<strong>Search NCBI</strong>\\n<input name=\"term\" size=\"40\" style=\"margin-left: 1em; border: solid 1px #336699;\" id=\"searchme\"/>\\n<input type=\"submit\" value=\"Go\" />\\n</p>\\n</form>\\n\\n\\n</div>\\n\\n<dl id=\"diags\">\\n <dt>Error</dt><dd>403</dd>\\n <dt>Server</dt><dd>130.14.29.110</dd>\\n <dt>Client</dt><dd>192.41.130.86</dd>\\n <dt>Time</dt><dd>Tuesday, 29-Aug-2017 14:30:42 EDT</dd>\\n</dl>\\n\\n<p id=\\'footer\\'>\\n\\n<span id=\\'rev\\'>Rev. 18 Jul 2017 16:09:24 EDT</span>\\n<!-- <a href=\"http://validator.w3.org/check?uri=referer\"><img src=\"http://www.w3.org/Icons/valid-xhtml11\" alt=\"Valid XHTML 1.1!\" /></a> -->\\n</p>\\n\\n</body>\\n</html>\\n\\n'\r\n```\r\nmitmproxy output:\r\n\r\nhttps://ibb.co/gfhisQ\r\nhttps://ibb.co/g59UXQ\r\n\r\nIs it weird that when setting the header variable in my POST request, I end up with less fields in my response header (than not sending a header variable)?",
"Ok, new plan. Make one change at a time until the 200 changes to a 403: that'll identify the bad header.",
"Okay, the bad header seems to be:\r\n\r\n'Content-Type' : 'multipart/form-data; boundary=----WebKitFormBoundaryBflp51Ny9ReeA5A9'\r\n\r\nWhen I use all other combinations of headers apart from that I get 200, as soon as I introduce that header I get a 403.\r\n\r\nScript output (without Content-Type header):\r\n\r\n```\r\n/Users/james/anaconda/envs/requests/lib/python3.6/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n InsecureRequestWarning)\r\n-------------------------------------------------- Requests header --------------------------------------------------\r\nUser-Agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36\r\nAccept-Encoding : gzip, deflate, br\r\nAccept : text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\r\nConnection : keep-alive\r\nOrigin : https://www.ncbi.nlm.nih.gov\r\nUpgrade-Insecure-Requests : 1\r\nReferer : https://www.ncbi.nlm.nih.gov/tools/primer-blast/index.cgi?LINK_LOC=reset\r\nAccept-Language : en-US,en;q=0.8\r\nCookie : sv-userdata-key-www.ncbi.nlm.nih.gov=G5KxXzyQ81U_vs1aHK_7XDWciF1B8AjjDUmDunVbhIZhZ4p4t_SVK4ASpbTT8iDSJVcxBH9oUAB3K2xNWjp3G0koYCloBlYuSxdoIGIkYzl2; ncbi_sid=0751457F9A561D01_0000SID; _ga=GA1.2.567134514.1503994317; _gid=GA1.2.654339584.1503994317; _gat=1; starnext=MYGwlsDWB2CmAeAXAXAbgK7RAewIYBM4lkAmAXgAcAnMAW1ioCMRcBnRAMgBYzm3FWsXFWAALDgEZymHAUkBOMgAYA7AFYpXFQDF5AQTUA2ACIBRFRKVXrN2xI4klygMJcSltQA59R0wGY/S1tg63t3Shp6JhZ2AFI/PQA5AHlE03i9PnZBYTEMlLSHcgB3UoA6aGBGMAqQWgqwUTKAc2wANwceajoGLMR81NMHQwie6P4BtIy+nJFxEhVRqL7J9ISZoTnVh08l3pj+lWcC9KON3NFYo5OHRQkuLiUOPyd5K2eJMnvH5/JPDWefjIADNcCBBM8eIgqOhYM81F83GpniMJH4SPJnosSFxnrtAoZ5Li/IoXp5DCpuE50RIpNxPlIAtxyNBcIgwG04Q8yDI8IQEJwuAiSBw1EDvk81DxPEo/KKEfIRUYyCRDIZRYtJbtaT81HcOIYnE9DAycUA=\r\nContent-Length : 127\r\nContent-Type : application/x-www-form-urlencoded\r\n-------------------------------------------------- Response header --------------------------------------------------\r\nDate : Tue, 29 Aug 2017 18:43:10 GMT\r\nServer : Apache\r\nStrict-Transport-Security : max-age=31536000; includeSubDomains; preload\r\nReferrer-Policy : origin-when-cross-origin\r\nContent-Security-Policy : upgrade-insecure-requests\r\nCache-Control : private\r\nNCBI-PHID : 0C422DEB9A5B5BE10000000000000001.m_3\r\nNCBI-RCGI-JobStatus : Done\r\nNCBI-SID : 0751457F9A561D01_0000SID\r\nAccess-Control-Allow-Methods : POST, GET, PUT, OPTIONS, PATCH, DELETE\r\nAccess-Control-Allow-Origin : https://www.ncbi.nlm.nih.gov\r\nAccess-Control-Allow-Credentials : true\r\nAccess-Control-Allow-Headers : Origin,X-Accept-Charset,X-Accept,Content-Type,X-Requested-With,NCBI-SID,NCBI-PHID\r\nContent-Type : text/html\r\nSet-Cookie : ncbi_sid=0751457F9A561D01_0000SID; domain=.nih.gov; path=/; expires=Wed, 29 Aug 2018 18:43:10 GMT\r\nVary : Accept-Encoding\r\nContent-Encoding : gzip\r\nX-UA-Compatible : IE=Edge\r\nX-XSS-Protection : 1; mode=block\r\nKeep-Alive : timeout=1, max=10\r\nConnection : Keep-Alive\r\nTransfer-Encoding : chunked\r\n-------------------------------------------------- Status code --------------------------------------------------\r\n200\r\n-------------------------------------------------- Response content --------------------------------------------------\r\nb'<html><head><title>Empty Result</title></head><body>Empty Result</body></html>'\r\n```\r\nmitmproxy output (without Content-Type header):\r\n\r\nhttps://ibb.co/ekPMCQ\r\nhttps://ibb.co/keZMCQ\r\n",
"Oh, yeah, ok, let's skip that header. :grin: Want to add in all the others?",
"That output is from a run where all the others have been added, except the Content-Type header",
"Oh, I see you did. So, the URL isn't being sent. This seems like a problem with the interaction with the service, but it does not appear to be a Requests problem, and it's a bit beyond my ability to fix. 😞 ",
"If I were interacting with the service I could probably do it, but I think that's going above-and-beyond for OSS maintenance. :wink:",
"Yes you're right, thank you for helping and being patient with my issue. I'll contact the maintainers of the service and see if they can offer up some more help. Many thanks!",
"No problem at all! Good luck! :sparkles:"
] |
https://api.github.com/repos/psf/requests/issues/4269
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4269/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4269/comments
|
https://api.github.com/repos/psf/requests/issues/4269/events
|
https://github.com/psf/requests/issues/4269
| 253,743,004 |
MDU6SXNzdWUyNTM3NDMwMDQ=
| 4,269 |
Handling Multiple Sessions with requests.Session()
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2643046?v=4",
"events_url": "https://api.github.com/users/Seykotron/events{/privacy}",
"followers_url": "https://api.github.com/users/Seykotron/followers",
"following_url": "https://api.github.com/users/Seykotron/following{/other_user}",
"gists_url": "https://api.github.com/users/Seykotron/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Seykotron",
"id": 2643046,
"login": "Seykotron",
"node_id": "MDQ6VXNlcjI2NDMwNDY=",
"organizations_url": "https://api.github.com/users/Seykotron/orgs",
"received_events_url": "https://api.github.com/users/Seykotron/received_events",
"repos_url": "https://api.github.com/users/Seykotron/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Seykotron/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Seykotron/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Seykotron",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 4 |
2017-08-29T17:26:08Z
|
2021-09-08T07:00:27Z
|
2017-08-29T18:20:29Z
|
NONE
|
resolved
|
Hello, Im trying to make multiple Sessions at once, I need to login multiple users into my webpage, but when instantiating requests.Session() it seems like the session is shared, and if I call requests.Session() again there I have the same cookies and the same headers that I stored in the previus object.
Sorry for my english, Im Spanish
Thank you!
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4269/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4269/timeline
| null |
completed
| null | null | false |
[
"The `Session` object is not shared: it's a class object, it cannot be shared. Can you provide some sample code that reproduces the issue?",
"Wow so fast Lukasa! Thank you for answering, I solved my problen not using Session, instead getting the cookiejar and store it into my class variable.\r\n\r\nAnyway My code was like the next one:\r\n\r\n```python\r\nclass User:\r\n def __init__(self,username, password,session=None):\r\n self.username = username\r\n self.password = password\r\n self.session= session or requests.Session()\r\n def login(self):\r\n result = self.session.post( \"url\", data={\"username\":self.username, \"password\": self.password} )\r\n print( \"%s: %s\" % (self.username,result.text) )\r\n\r\nif __name__ == \"__main__\":\r\n u = User( \"pepe\", \"asdf\" )\r\n u.login()\r\n u2 = User(\"juan\", \"asdf\" )\r\n u2.login()\r\n```\r\n\r\nAnd it the first time return the data concerning the user \"pepe\", but the second time, it returns two times the data concerning \"juan\".\r\n\r\nI dont know if I explain myself :/ my english are very bad :P \r\n\r\nAnyway I solve my problem using cookiejar :) \r\n\r\nVery Very thank you anyway :D\r\n",
"Happy to be of some service! I'm glad you solved your problem. :smile:",
"I found the error, I was instantiatting the logger twice xD :P haha! :)"
] |
https://api.github.com/repos/psf/requests/issues/4268
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4268/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4268/comments
|
https://api.github.com/repos/psf/requests/issues/4268/events
|
https://github.com/psf/requests/issues/4268
| 253,706,267 |
MDU6SXNzdWUyNTM3MDYyNjc=
| 4,268 |
Recieving 400 Bad Request on PUT against Ranger API
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/27829577?v=4",
"events_url": "https://api.github.com/users/mtdeguzis/events{/privacy}",
"followers_url": "https://api.github.com/users/mtdeguzis/followers",
"following_url": "https://api.github.com/users/mtdeguzis/following{/other_user}",
"gists_url": "https://api.github.com/users/mtdeguzis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mtdeguzis",
"id": 27829577,
"login": "mtdeguzis",
"node_id": "MDQ6VXNlcjI3ODI5NTc3",
"organizations_url": "https://api.github.com/users/mtdeguzis/orgs",
"received_events_url": "https://api.github.com/users/mtdeguzis/received_events",
"repos_url": "https://api.github.com/users/mtdeguzis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mtdeguzis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mtdeguzis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mtdeguzis",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-29T15:27:38Z
|
2021-09-08T07:00:28Z
|
2017-08-29T15:46:43Z
|
NONE
|
resolved
|
Summary.
Submitting a PUT request against the Ranger API: https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management#RESTAPIsforPolicyManagement-UpdatePolicy. I can create the policy fine, but seems with PUT, I get bad request and cannot determine why.
Headers on GET
```
Retrieving and exporting policy 16: <POLICY_NAME>
{'transfer-encoding': 'chunked', 'set-cookie': 'RANGERADMINSESSIONID=<ID>; Path=/; HttpOnly, hadoop.auth=; Path=/; Domain=HOST.DOMAIN.COM; Expires=Thu, 01-Jan-1970 00:00:00 GMT; HttpOnly', 'server': 'Apache-Coyote/1.1', 'date': 'Tue, 29 Aug 2017 14:57:25 GMT', 'x-frame-options': 'DENY', 'content-type': 'application/json', 'www-authenticate': 'Negotiate'}
```
Headers on successful POST
```
{'transfer-encoding': 'chunked', 'set-cookie': 'RANGERADMINSESSIONID=<ID>; Path=/; HttpOnly, hadoop.auth=; Path=/; Domain=HOST.DOMAIN.COM; Expires=Thu, 01-Jan-1970 00:00:00 GMT; HttpOnly', 'server': 'Apache-Coyote/1.1', 'date': 'Tue, 29 Aug 2017 15:34:04 GMT', 'x-frame-options': 'DENY', 'content-type': 'application/json', 'www-authenticate': 'Negotiate'}
Policy applied <POLICY_NUM>
```
Headers on PUT (400 respose)
```
Submitting PUT API request: http://HOST:PORT/service/public/api/policy/<POLICY_NUM>
{'transfer-encoding': 'chunked', 'set-cookie': 'RANGERADMINSESSIONID=<ID>; Path=/; HttpOnly, hadoop.auth=; Path=/; Domain=HOST.DIOMAIN.COM; Expires=Thu, 01-Jan-1970 00:00:00 GMT; HttpOnly', 'server': 'Apache-Coyote/1.1', 'connection': 'close', 'date': 'Tue, 29 Aug 2017 15:19:58 GMT', 'x-frame-options': 'DENY', 'content-type': 'application/json', 'www-authenticate': 'Negotiate'}
```
The object exists at the endpoint, so a PUT needs made.
## Expected Result
Response code 200
What you expected.
## Actual Result
```
Traceback (most recent call last):
File "ranger-policy-manager.py", line 183, in <module>
result.raise_for_status()
File "/usr/lib/python2.7/site-packages/requests/models.py", line 834, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request
```
## Reproduction Steps
Hard to reproduce without a Hadoop Ranger environement.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4268/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4268/timeline
| null |
completed
| null | null | false |
[
"400 bad request generally suggests that this is a problem with your data not matching what Hadoop wants. Without knowing what that looks like, I'm afraid we simply cannot help you."
] |
https://api.github.com/repos/psf/requests/issues/4267
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4267/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4267/comments
|
https://api.github.com/repos/psf/requests/issues/4267/events
|
https://github.com/psf/requests/issues/4267
| 253,538,255 |
MDU6SXNzdWUyNTM1MzgyNTU=
| 4,267 |
Document Community Extensions
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[
{
"color": "e102d8",
"default": false,
"description": null,
"id": 117745,
"name": "Planned",
"node_id": "MDU6TGFiZWwxMTc3NDU=",
"url": "https://api.github.com/repos/psf/requests/labels/Planned"
},
{
"color": "0b02e1",
"default": false,
"description": null,
"id": 191274,
"name": "Contributor Friendly",
"node_id": "MDU6TGFiZWwxOTEyNzQ=",
"url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly"
},
{
"color": "fad8c7",
"default": false,
"description": null,
"id": 136616769,
"name": "Documentation",
"node_id": "MDU6TGFiZWwxMzY2MTY3Njk=",
"url": "https://api.github.com/repos/psf/requests/labels/Documentation"
}
] |
closed
| true |
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
] | null | 5 |
2017-08-29T06:04:44Z
|
2021-09-06T00:06:34Z
|
2019-01-15T13:37:05Z
|
CONTRIBUTOR
|
resolved
|
Exceptional:
- https://github.com/requests/toolbelt
- https://github.com/ionrock/cachecontrol
Note-worthy:
- https://github.com/kislyuk/requests-http-signature
- https://github.com/ross/requests-futures
- https://pypi.python.org/pypi/requests-mock
- https://vcrpy.readthedocs.io/en/latest/
- https://pypi.python.org/pypi/requests-cache
Participation award:
- https://github.com/twisted/treq (maybe https://pypi.python.org/pypi/requests-twisted/0.1.1 instead?)
- https://github.com/getsentry/responses (maybe not mention)
- https://httpie.org
Let's list others.
|
{
"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/4267/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4267/timeline
| null |
completed
| null | null | false |
[
"I would say `cachecontrol` falls under `Exceptional`. `responses` isn't an extension and if it is then there are far better ones out there.",
"@sigmavirus24 thanks for the feedback :)",
"updated",
"@kennethreitz i would like to work on this. Should they be documented in the ReadMe.md file?",
"I think these are already done, actually, @vhawk19 http://docs.python-requests.org/en/latest/community/recommended/"
] |
https://api.github.com/repos/psf/requests/issues/4266
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4266/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4266/comments
|
https://api.github.com/repos/psf/requests/issues/4266/events
|
https://github.com/psf/requests/issues/4266
| 253,273,400 |
MDU6SXNzdWUyNTMyNzM0MDA=
| 4,266 |
A problem with proxies parameters
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18119763?v=4",
"events_url": "https://api.github.com/users/loisjee/events{/privacy}",
"followers_url": "https://api.github.com/users/loisjee/followers",
"following_url": "https://api.github.com/users/loisjee/following{/other_user}",
"gists_url": "https://api.github.com/users/loisjee/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/loisjee",
"id": 18119763,
"login": "loisjee",
"node_id": "MDQ6VXNlcjE4MTE5NzYz",
"organizations_url": "https://api.github.com/users/loisjee/orgs",
"received_events_url": "https://api.github.com/users/loisjee/received_events",
"repos_url": "https://api.github.com/users/loisjee/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/loisjee/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/loisjee/subscriptions",
"type": "User",
"url": "https://api.github.com/users/loisjee",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-28T09:21:34Z
|
2021-09-08T04:00:46Z
|
2018-01-23T16:16:57Z
|
NONE
|
resolved
|
I have a problem about proxies, when I was using ip agent
`requests.get('http://1212.ip138.com/ic.asp', headers=headers,proxies=pro, timeout=9)`
How can i know if I succeed to use the ip agent, sometimes the result from the url is my own ip instead of the ip in proxies.Does that means the ip in proxies is useless?
Thx for your reply.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5271761?v=4",
"events_url": "https://api.github.com/users/nateprewitt/events{/privacy}",
"followers_url": "https://api.github.com/users/nateprewitt/followers",
"following_url": "https://api.github.com/users/nateprewitt/following{/other_user}",
"gists_url": "https://api.github.com/users/nateprewitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nateprewitt",
"id": 5271761,
"login": "nateprewitt",
"node_id": "MDQ6VXNlcjUyNzE3NjE=",
"organizations_url": "https://api.github.com/users/nateprewitt/orgs",
"received_events_url": "https://api.github.com/users/nateprewitt/received_events",
"repos_url": "https://api.github.com/users/nateprewitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nateprewitt/starred{/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/4266/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4266/timeline
| null |
completed
| null | null | false |
[
"Without seeing how your proxies are configured I have no idea if that will work or not.",
"Given that we haven't seen in additional information to help debug this, I'm going to close this out. Feel free to ping if you have more information @SongJee."
] |
https://api.github.com/repos/psf/requests/issues/4265
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4265/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4265/comments
|
https://api.github.com/repos/psf/requests/issues/4265/events
|
https://github.com/psf/requests/pull/4265
| 253,271,602 |
MDExOlB1bGxSZXF1ZXN0MTM3OTAyODU1
| 4,265 |
fixed syntax for code block for prepared requests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24897834?v=4",
"events_url": "https://api.github.com/users/PascalVA/events{/privacy}",
"followers_url": "https://api.github.com/users/PascalVA/followers",
"following_url": "https://api.github.com/users/PascalVA/following{/other_user}",
"gists_url": "https://api.github.com/users/PascalVA/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/PascalVA",
"id": 24897834,
"login": "PascalVA",
"node_id": "MDQ6VXNlcjI0ODk3ODM0",
"organizations_url": "https://api.github.com/users/PascalVA/orgs",
"received_events_url": "https://api.github.com/users/PascalVA/received_events",
"repos_url": "https://api.github.com/users/PascalVA/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/PascalVA/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/PascalVA/subscriptions",
"type": "User",
"url": "https://api.github.com/users/PascalVA",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 0 |
2017-08-28T09:14:12Z
|
2021-09-04T00:06:51Z
|
2017-08-28T09:39:27Z
|
CONTRIBUTOR
|
resolved
|
I just noticed you need to add a double colon for the code block to render.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4265/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4265/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4265.diff",
"html_url": "https://github.com/psf/requests/pull/4265",
"merged_at": "2017-08-28T09:39:27Z",
"patch_url": "https://github.com/psf/requests/pull/4265.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4265"
}
| true |
[] |
https://api.github.com/repos/psf/requests/issues/4264
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4264/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4264/comments
|
https://api.github.com/repos/psf/requests/issues/4264/events
|
https://github.com/psf/requests/pull/4264
| 253,268,111 |
MDExOlB1bGxSZXF1ZXN0MTM3OTAwMzEy
| 4,264 |
Add environment info to prepared requests docs
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24897834?v=4",
"events_url": "https://api.github.com/users/PascalVA/events{/privacy}",
"followers_url": "https://api.github.com/users/PascalVA/followers",
"following_url": "https://api.github.com/users/PascalVA/following{/other_user}",
"gists_url": "https://api.github.com/users/PascalVA/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/PascalVA",
"id": 24897834,
"login": "PascalVA",
"node_id": "MDQ6VXNlcjI0ODk3ODM0",
"organizations_url": "https://api.github.com/users/PascalVA/orgs",
"received_events_url": "https://api.github.com/users/PascalVA/received_events",
"repos_url": "https://api.github.com/users/PascalVA/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/PascalVA/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/PascalVA/subscriptions",
"type": "User",
"url": "https://api.github.com/users/PascalVA",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-28T08:59:14Z
|
2021-09-04T00:06:51Z
|
2017-08-28T09:08:08Z
|
CONTRIBUTOR
|
resolved
|
When using prepared requests, the environment is not taken into account. This should be reflected in the documentation.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4",
"events_url": "https://api.github.com/users/Lukasa/events{/privacy}",
"followers_url": "https://api.github.com/users/Lukasa/followers",
"following_url": "https://api.github.com/users/Lukasa/following{/other_user}",
"gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Lukasa",
"id": 1382556,
"login": "Lukasa",
"node_id": "MDQ6VXNlcjEzODI1NTY=",
"organizations_url": "https://api.github.com/users/Lukasa/orgs",
"received_events_url": "https://api.github.com/users/Lukasa/received_events",
"repos_url": "https://api.github.com/users/Lukasa/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Lukasa",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4264/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4264/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4264.diff",
"html_url": "https://github.com/psf/requests/pull/4264",
"merged_at": "2017-08-28T09:08:08Z",
"patch_url": "https://github.com/psf/requests/pull/4264.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4264"
}
| true |
[
"# [Codecov](https://codecov.io/gh/requests/requests/pull/4264?src=pr&el=h1) Report\n> Merging [#4264](https://codecov.io/gh/requests/requests/pull/4264?src=pr&el=desc) into [master](https://codecov.io/gh/requests/requests/commit/369be8afd07e7a0f38bc4f78d6f3764a800711aa?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[](https://codecov.io/gh/requests/requests/pull/4264?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4264 +/- ##\n=======================================\n Coverage 88.66% 88.66% \n=======================================\n Files 18 18 \n Lines 2021 2021 \n=======================================\n Hits 1792 1792 \n Misses 229 229\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/requests/requests/pull/4264?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/requests/requests/pull/4264?src=pr&el=footer). Last update [369be8a...785c733](https://codecov.io/gh/requests/requests/pull/4264?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"
] |
https://api.github.com/repos/psf/requests/issues/4263
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4263/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4263/comments
|
https://api.github.com/repos/psf/requests/issues/4263/events
|
https://github.com/psf/requests/pull/4263
| 253,183,270 |
MDExOlB1bGxSZXF1ZXN0MTM3ODQ0NjE1
| 4,263 |
[don't merge] unpin httpbin
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21099?v=4",
"events_url": "https://api.github.com/users/kevin1024/events{/privacy}",
"followers_url": "https://api.github.com/users/kevin1024/followers",
"following_url": "https://api.github.com/users/kevin1024/following{/other_user}",
"gists_url": "https://api.github.com/users/kevin1024/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kevin1024",
"id": 21099,
"login": "kevin1024",
"node_id": "MDQ6VXNlcjIxMDk5",
"organizations_url": "https://api.github.com/users/kevin1024/orgs",
"received_events_url": "https://api.github.com/users/kevin1024/received_events",
"repos_url": "https://api.github.com/users/kevin1024/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kevin1024/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kevin1024/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kevin1024",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 2 |
2017-08-27T19:16:18Z
|
2021-09-03T00:11:09Z
|
2018-03-08T18:01:26Z
|
NONE
|
resolved
|
The upstream bug has been fixed
See also:
* requests/requests#4261
* requests/requests#4258
* requests/requests#4259
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4",
"events_url": "https://api.github.com/users/kennethreitz/events{/privacy}",
"followers_url": "https://api.github.com/users/kennethreitz/followers",
"following_url": "https://api.github.com/users/kennethreitz/following{/other_user}",
"gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kennethreitz",
"id": 119893,
"login": "kennethreitz",
"node_id": "MDQ6VXNlcjExOTg5Mw==",
"organizations_url": "https://api.github.com/users/kennethreitz/orgs",
"received_events_url": "https://api.github.com/users/kennethreitz/received_events",
"repos_url": "https://api.github.com/users/kennethreitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kennethreitz",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4263/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4263/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4263.diff",
"html_url": "https://github.com/psf/requests/pull/4263",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4263.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4263"
}
| true |
[
"✨🍰✨\r\n\r\nsorry for the bug!",
"Hmm... it would appear that there are some upstream changes to digest auth in the newest httpbin that are causing some requests test failures."
] |
https://api.github.com/repos/psf/requests/issues/4262
|
https://api.github.com/repos/psf/requests
|
https://api.github.com/repos/psf/requests/issues/4262/labels{/name}
|
https://api.github.com/repos/psf/requests/issues/4262/comments
|
https://api.github.com/repos/psf/requests/issues/4262/events
|
https://github.com/psf/requests/pull/4262
| 253,177,041 |
MDExOlB1bGxSZXF1ZXN0MTM3ODQwOTgw
| 4,262 |
[do not merge] Try to fix hanging tests
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21099?v=4",
"events_url": "https://api.github.com/users/kevin1024/events{/privacy}",
"followers_url": "https://api.github.com/users/kevin1024/followers",
"following_url": "https://api.github.com/users/kevin1024/following{/other_user}",
"gists_url": "https://api.github.com/users/kevin1024/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kevin1024",
"id": 21099,
"login": "kevin1024",
"node_id": "MDQ6VXNlcjIxMDk5",
"organizations_url": "https://api.github.com/users/kevin1024/orgs",
"received_events_url": "https://api.github.com/users/kevin1024/received_events",
"repos_url": "https://api.github.com/users/kevin1024/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kevin1024/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kevin1024/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kevin1024",
"user_view_type": "public"
}
|
[] |
closed
| true | null |
[] | null | 1 |
2017-08-27T17:20:21Z
|
2021-09-04T00:06:52Z
|
2017-08-27T17:33:10Z
|
NONE
|
resolved
|
The tests are hanging sometimes, see #4259 and #4261. I wonder if it would work to unpin both packages since I think I fixed a bug with pytest-httpbin hanging awhile back.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21099?v=4",
"events_url": "https://api.github.com/users/kevin1024/events{/privacy}",
"followers_url": "https://api.github.com/users/kevin1024/followers",
"following_url": "https://api.github.com/users/kevin1024/following{/other_user}",
"gists_url": "https://api.github.com/users/kevin1024/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kevin1024",
"id": 21099,
"login": "kevin1024",
"node_id": "MDQ6VXNlcjIxMDk5",
"organizations_url": "https://api.github.com/users/kevin1024/orgs",
"received_events_url": "https://api.github.com/users/kevin1024/received_events",
"repos_url": "https://api.github.com/users/kevin1024/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kevin1024/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kevin1024/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kevin1024",
"user_view_type": "public"
}
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/psf/requests/issues/4262/reactions"
}
|
https://api.github.com/repos/psf/requests/issues/4262/timeline
| null | null | false |
{
"diff_url": "https://github.com/psf/requests/pull/4262.diff",
"html_url": "https://github.com/psf/requests/pull/4262",
"merged_at": null,
"patch_url": "https://github.com/psf/requests/pull/4262.patch",
"url": "https://api.github.com/repos/psf/requests/pulls/4262"
}
| true |
[
"welp, that doesn't appear to be working."
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.