From 188e7609b36eb2100abe3a6a5c3bbebcf1205cfb Mon Sep 17 00:00:00 2001 From: Vikram Oberoi Date: Thu, 27 Jun 2013 16:43:40 -0400 Subject: [PATCH] .netrc settings shouldn't blow away explicit auth settings on a session --- requests/sessions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requests/sessions.py b/requests/sessions.py index 6d1000dc..c24ed5aa 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.