From: Tom Christie Date: Thu, 23 Jul 2020 08:44:54 +0000 (+0100) Subject: client.netrc should be private (#1071) X-Git-Tag: 0.14.0~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd339212de277a8b8a1b3028147854fc0e7e6353;p=thirdparty%2Fhttpx.git client.netrc should be private (#1071) --- diff --git a/httpx/_client.py b/httpx/_client.py index 1ee93521..d4ec7aaa 100644 --- a/httpx/_client.py +++ b/httpx/_client.py @@ -80,7 +80,7 @@ class BaseClient: self.timeout = Timeout(timeout) self.max_redirects = max_redirects self.trust_env = trust_env - self.netrc = NetRCInfo() + self._netrc = NetRCInfo() def _get_proxy_map( self, proxies: typing.Optional[ProxiesTypes], trust_env: bool, @@ -269,7 +269,7 @@ class BaseClient: return BasicAuth(username=username, password=password) if self.trust_env and "Authorization" not in request.headers: - credentials = self.netrc.get_credentials(request.url.authority) + credentials = self._netrc.get_credentials(request.url.authority) if credentials is not None: return BasicAuth(username=credentials[0], password=credentials[1])