From: Vikram Oberoi Date: Thu, 27 Jun 2013 20:43:40 +0000 (-0400) Subject: .netrc settings shouldn't blow away explicit auth settings on a session X-Git-Tag: 2.0~22^2~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=188e7609b36eb2100abe3a6a5c3bbebcf1205cfb;p=services%2Fpython-requests.git .netrc settings shouldn't blow away explicit auth settings on a session --- diff --git a/requests/sessions.py b/requests/sessions.py index 6d1000d..c24ed5a 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -289,8 +289,8 @@ class Session(SessionRedirectMixin): for (k, v) in env_proxies.items(): proxies.setdefault(k, v) - # Set environment's basic authentication. - if not auth: + # Set environment's basic authentication if not explicitly set. + if not auth and not self.auth: auth = get_netrc_auth(url) # Look for configuration.