mirror of
https://github.com/clearml/clearml
synced 2025-02-01 01:26:49 +00:00
Fix requests issue in python 2.7 that can cause a deadlock when importing netrc
This commit is contained in:
parent
f4be527a21
commit
62d5535351
@ -95,6 +95,13 @@ def get_http_session_with_retry(
|
|||||||
|
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
|
|
||||||
|
# HACK: with python 2.7 there is a potential race condition that can cause
|
||||||
|
# a deadlock when importing "netrc", inside the get_netrc_auth() function
|
||||||
|
# setting 'session.trust_env' to False will make sure the `get_netrc_auth()` is not called
|
||||||
|
# see details: https://github.com/psf/requests/issues/2925
|
||||||
|
if six.PY2:
|
||||||
|
session.trust_env = False
|
||||||
|
|
||||||
if backoff_max is not None:
|
if backoff_max is not None:
|
||||||
Retry.BACKOFF_MAX = backoff_max
|
Retry.BACKOFF_MAX = backoff_max
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user