Skip to content

Commit 26997ab

Browse files
Revert "Pin urllib3 to <2.0.0 for now" (#2148)
This reverts commit 0d301bb.
1 parent 2882ee8 commit 26997ab

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

docs/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import sphinx.builders.texinfo
1212
import sphinx.builders.text
1313
import sphinx.ext.autodoc
14+
import urllib3.exceptions
1415

1516
typing.TYPE_CHECKING = True
1617

sentry_sdk/integrations/cloud_resource_context.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
import urllib3 # type: ignore
2+
import urllib3
33

44
from sentry_sdk.integrations import Integration
55
from sentry_sdk.api import set_context
@@ -80,7 +80,7 @@ def _is_aws(cls):
8080
if r.status != 200:
8181
return False
8282

83-
cls.aws_token = r.data
83+
cls.aws_token = r.data.decode()
8484
return True
8585

8686
except Exception:

sentry_sdk/integrations/opentelemetry/span_processor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from sentry_sdk.utils import Dsn
2727
from sentry_sdk._types import TYPE_CHECKING
2828

29-
from urllib3.util import parse_url as urlparse # type: ignore
29+
from urllib3.util import parse_url as urlparse
3030

3131
if TYPE_CHECKING:
3232
from typing import Any

sentry_sdk/transport.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import print_function
22

33
import io
4-
import urllib3 # type: ignore
4+
import urllib3
55
import certifi
66
import gzip
77
import time
@@ -26,7 +26,7 @@
2626
from typing import Union
2727
from typing import DefaultDict
2828

29-
from urllib3.poolmanager import PoolManager # type: ignore
29+
from urllib3.poolmanager import PoolManager
3030
from urllib3.poolmanager import ProxyManager
3131

3232
from sentry_sdk._types import Event, EndpointType
@@ -186,7 +186,7 @@ def record_lost_event(
186186
self._discarded_events[data_category, reason] += quantity
187187

188188
def _update_rate_limits(self, response):
189-
# type: (urllib3.HTTPResponse) -> None
189+
# type: (urllib3.BaseHTTPResponse) -> None
190190

191191
# new sentries with more rate limit insights. We honor this header
192192
# no matter of the status code to update our internal rate limits.

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def get_file_text(file_name):
4141
'urllib3>=1.25.7; python_version<="3.4"',
4242
'urllib3>=1.26.9; python_version=="3.5"',
4343
'urllib3>=1.26.11; python_version >="3.6"',
44-
'urllib3<2.0.0',
4544
"certifi",
4645
],
4746
extras_require={

tests/integrations/cloud_resource_context/test_cloud_resource_context.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def test_is_aws_ok():
136136
CloudResourceContextIntegration.http.request = MagicMock(return_value=response)
137137

138138
assert CloudResourceContextIntegration._is_aws() is True
139-
assert CloudResourceContextIntegration.aws_token == b"something"
139+
assert CloudResourceContextIntegration.aws_token == "something"
140140

141141
CloudResourceContextIntegration.http.request = MagicMock(
142142
side_effect=Exception("Test")

0 commit comments

Comments
 (0)