Merge commit 'df23c'

This commit is contained in:
Ben Darnell 2012-01-23 10:12:56 -08:00
commit 9a8e5e4d86
1 changed files with 3 additions and 3 deletions

View File

@ -383,10 +383,10 @@ def _curl_setup_request(curl, request, buffer, headers):
else:
curl.setopt(pycurl.INFILESIZE, len(request.body))
if request.auth_username and request.auth_password:
userpwd = "%s:%s" % (request.auth_username, request.auth_password)
if request.auth_username is not None:
userpwd = "%s:%s" % (request.auth_username, request.auth_password or '')
curl.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_BASIC)
curl.setopt(pycurl.USERPWD, userpwd)
curl.setopt(pycurl.USERPWD, utf8(userpwd))
logging.debug("%s %s (username: %r)", request.method, request.url,
request.auth_username)
else: