def basic_auth_header(username, password):

    auth = "%s:%s" % (username, password)
    if not isinstance(auth, bytes):
        # XXX: RFC 2617 doesn't define encoding, but ISO-8859-1
        # seems to be the most widely used encoding here. See also:
        # http://greenbytes.de/tech/webdav/draft-ietf-httpauth-basicauth-enc-latest.html
        auth = auth.encode('ISO-8859-1')
    return b'Basic ' + urlsafe_b64encode(auth)
Keep calling SSLSocket.write until the entire message has been sent
dataset/ETHPy150Open scrapy/w3lib/w3lib/http.py/basic_auth_header--crossover with--dataset/ETHPy150Open uber/clay/clay/logger.py/TCPHandler.send