-
Notifications
You must be signed in to change notification settings - Fork 537
SNOW-896926 adjust vendored urllib3 and requests #2505
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
Changes from all commits
a0ea184
37b8cfe
88f0447
b858fa0
1e8e0bc
ccb44a4
4fb6b3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ | |
|
|
||
| import warnings | ||
|
|
||
| import urllib3 | ||
| from .. import urllib3 | ||
|
|
||
| from .exceptions import RequestsDependencyWarning | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Below in this file we have 2 more imports from urllib3 (line 131 and 143) - did we deliberately leave those unchanged? |
||
|
|
@@ -128,7 +128,7 @@ def _check_cryptography(cryptography_version): | |
| ssl = None | ||
|
|
||
| if not getattr(ssl, "HAS_SNI", False): | ||
| from urllib3.contrib import pyopenssl | ||
| from ..urllib3.contrib import pyopenssl | ||
|
|
||
| pyopenssl.inject_into_urllib3() | ||
|
|
||
|
|
@@ -140,7 +140,7 @@ def _check_cryptography(cryptography_version): | |
| pass | ||
|
|
||
| # urllib3's DependencyWarnings should be silenced. | ||
| from urllib3.exceptions import DependencyWarning | ||
| from ..urllib3.exceptions import DependencyWarning | ||
|
|
||
| warnings.simplefilter("ignore", DependencyWarning) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,22 +11,22 @@ | |
| import typing | ||
| import warnings | ||
|
|
||
| from urllib3.exceptions import ClosedPoolError, ConnectTimeoutError | ||
| from urllib3.exceptions import HTTPError as _HTTPError | ||
| from urllib3.exceptions import InvalidHeader as _InvalidHeader | ||
| from urllib3.exceptions import ( | ||
| from ..urllib3.exceptions import ClosedPoolError, ConnectTimeoutError | ||
| from ..urllib3.exceptions import HTTPError as _HTTPError | ||
| from ..urllib3.exceptions import InvalidHeader as _InvalidHeader | ||
| from ..urllib3.exceptions import ( | ||
| LocationValueError, | ||
| MaxRetryError, | ||
| NewConnectionError, | ||
| ProtocolError, | ||
| ) | ||
| from urllib3.exceptions import ProxyError as _ProxyError | ||
| from urllib3.exceptions import ReadTimeoutError, ResponseError | ||
| from urllib3.exceptions import SSLError as _SSLError | ||
| from urllib3.poolmanager import PoolManager, proxy_from_url | ||
| from urllib3.util import Timeout as TimeoutSauce | ||
| from urllib3.util import parse_url | ||
| from urllib3.util.retry import Retry | ||
| from ..urllib3.exceptions import ProxyError as _ProxyError | ||
| from ..urllib3.exceptions import ReadTimeoutError, ResponseError | ||
| from ..urllib3.exceptions import SSLError as _SSLError | ||
| from ..urllib3.poolmanager import PoolManager, proxy_from_url | ||
| from ..urllib3.util import Timeout as TimeoutSauce | ||
| from ..urllib3.util import parse_url | ||
| from ..urllib3.util.retry import Retry | ||
|
|
||
| from .auth import _basic_auth_str | ||
| from .compat import basestring, urlparse | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In line 59 we have from urllib3.contrib.socks import SOCKSProxyManager - was it intentional?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also have:
|
||
|
|
@@ -56,7 +56,7 @@ | |
| ) | ||
|
|
||
| try: | ||
| from urllib3.contrib.socks import SOCKSProxyManager | ||
| from ..urllib3.contrib.socks import SOCKSProxyManager | ||
| except ImportError: | ||
|
|
||
| def SOCKSProxyManager(*args, **kwargs): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The piece of logic below is the custom one we introduced. Can we override proxy_manager_for instead and avoid isinstance call?