Skip to content

Revert "Pin urllib3 to <2.0.0 for now" #2148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sphinx.builders.texinfo
import sphinx.builders.text
import sphinx.ext.autodoc
import urllib3.exceptions

typing.TYPE_CHECKING = True

Expand Down
4 changes: 2 additions & 2 deletions sentry_sdk/integrations/cloud_resource_context.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
import urllib3 # type: ignore
import urllib3

from sentry_sdk.integrations import Integration
from sentry_sdk.api import set_context
Expand Down Expand Up @@ -80,7 +80,7 @@ def _is_aws(cls):
if r.status != 200:
return False

cls.aws_token = r.data
cls.aws_token = r.data.decode()
return True

except Exception:
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/opentelemetry/span_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from sentry_sdk.utils import Dsn
from sentry_sdk._types import TYPE_CHECKING

from urllib3.util import parse_url as urlparse # type: ignore
from urllib3.util import parse_url as urlparse

if TYPE_CHECKING:
from typing import Any
Expand Down
6 changes: 3 additions & 3 deletions sentry_sdk/transport.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function

import io
import urllib3 # type: ignore
import urllib3
import certifi
import gzip
import time
Expand All @@ -26,7 +26,7 @@
from typing import Union
from typing import DefaultDict

from urllib3.poolmanager import PoolManager # type: ignore
from urllib3.poolmanager import PoolManager
from urllib3.poolmanager import ProxyManager

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

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

# new sentries with more rate limit insights. We honor this header
# no matter of the status code to update our internal rate limits.
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def get_file_text(file_name):
'urllib3>=1.25.7; python_version<="3.4"',
'urllib3>=1.26.9; python_version=="3.5"',
'urllib3>=1.26.11; python_version >="3.6"',
'urllib3<2.0.0',
"certifi",
],
extras_require={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_is_aws_ok():
CloudResourceContextIntegration.http.request = MagicMock(return_value=response)

assert CloudResourceContextIntegration._is_aws() is True
assert CloudResourceContextIntegration.aws_token == b"something"
assert CloudResourceContextIntegration.aws_token == "something"

CloudResourceContextIntegration.http.request = MagicMock(
side_effect=Exception("Test")
Expand Down