Skip to content

Commit

Permalink
Update patches for upstream changes
Browse files Browse the repository at this point in the history
No substantive changes here, this is purely updating the patch files so
they apply cleanly after upstream updates.
  • Loading branch information
me-and committed Nov 6, 2023
1 parent 98e8661 commit 3e487b6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
20 changes: 8 additions & 12 deletions Remove-tests-that-use-the-tarpit.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,34 @@ diff --git a/tests/test_requests.py b/tests/test_requests.py
index 7d4a4eb5..8d1c55fc 100644
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -2186,31 +2186,6 @@ class TestTimeout:
@@ -2475,27 +2475,6 @@ class TestTimeout:
except ReadTimeout:
pass

- @pytest.mark.parametrize(
- 'timeout', (
- (0.1, None),
- Urllib3Timeout(connect=0.1, read=None)
- ))
- "timeout", ((0.1, None), Urllib3Timeout(connect=0.1, read=None))
- )
- def test_connect_timeout(self, timeout):
- try:
- requests.get(TARPIT, timeout=timeout)
- pytest.fail('The connect() request should time out.')
- pytest.fail("The connect() request should time out.")
- except ConnectTimeout as e:
- assert isinstance(e, ConnectionError)
- assert isinstance(e, Timeout)
-
- @pytest.mark.parametrize(
- 'timeout', (
- (0.1, 0.1),
- Urllib3Timeout(connect=0.1, read=0.1)
- ))
- "timeout", ((0.1, 0.1), Urllib3Timeout(connect=0.1, read=0.1))
- )
- def test_total_timeout_connect(self, timeout):
- try:
- requests.get(TARPIT, timeout=timeout)
- pytest.fail('The connect() request should time out.')
- pytest.fail("The connect() request should time out.")
- except ConnectTimeout:
- pass
-
def test_encoded_methods(self, httpbin):
"""See: https://github.com/psf/requests/issues/2316"""
r = requests.request(b'GET', httpbin('get'))
r = requests.request(b"GET", httpbin("get"))
--
2.24.1

14 changes: 7 additions & 7 deletions patch-requests-certs.py-to-use-the-system-CA-bundle.patch
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ index a14a7ee..b4957d1 100644
+ """Return the absolute path to the system CA bundle."""
+ return '/etc/pki/tls/certs/ca-bundle.crt'

if __name__ == '__main__':
if __name__ == "__main__":
print(where())
diff --git a/setup.py b/setup.py
index ce5e5c8..de86a91 100755
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,6 @@ requires = [
'idna>=2.5,<3; python_version < "3"',
'idna>=2.5,<4; python_version >= "3"',
'urllib3>=1.21.1,<1.27',
- 'certifi>=2017.4.17'

@@ -62,7 +62,6 @@ requires = [
"charset_normalizer>=2,<4",
"idna>=2.5,<4",
"urllib3>=1.21.1,<3",
- "certifi>=2017.4.17",
]
test_requirements = [
"pytest-httpbin==2.0.0",
--
2.31.1

18 changes: 9 additions & 9 deletions requests-2.12.4-tests_nonet.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- requests-2.12.4/tests/testserver/server.py 2016-12-21 11:31:56.000000000 -0800
+++ requests-2.12.4/tests/testserver/server.py.new 2016-12-30 10:40:06.085995065 -0800
@@ -27,7 +27,7 @@
"""Dummy server using for unit testing"""
WAIT_EVENT_TIMEOUT = 5

- def __init__(self, handler=None, host='localhost', port=0, requests_to_handle=1, wait_to_close_event=None):
+ def __init__(self, handler=None, host='127.0.0.1', port=0, requests_to_handle=1, wait_to_close_event=None):
super(Server, self).__init__()

self.handler = handler or consume_socket_content
@@ -29,7 +29,7 @@ class Server(threading.Thread):
def __init__(
self,
handler=None,
- host="localhost",
+ host="127.0.0.1",
port=0,
requests_to_handle=1,
wait_to_close_event=None,

0 comments on commit 3e487b6

Please sign in to comment.