summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsetuptools/package_index.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index bc276a26..2e8f62e2 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -908,8 +908,13 @@ def _encode_auth(auth):
"""
A function compatible with Python 2.3-3.3 that will encode
auth from a URL suitable for an HTTP header.
- >>> _encode_auth('username%3Apassword')
- u'dXNlcm5hbWU6cGFzc3dvcmQ='
+ >>> str(_encode_auth('username%3Apassword'))
+ 'dXNlcm5hbWU6cGFzc3dvcmQ='
+
+ Long auth strings should not cause a newline to be inserted.
+ >>> long_auth = 'username:' + 'password'*10
+ >>> chr(10) in str(_encode_auth(long_auth))
+ False
"""
auth_s = unquote(auth)
# convert to bytes