basic auth py3 encoding fix