Commit 7ade322c authored by Jason R. Coombs's avatar Jason R. Coombs

Update docstring to reflect failure reported in pull request #21

parent c743916e
...@@ -908,8 +908,13 @@ def _encode_auth(auth): ...@@ -908,8 +908,13 @@ def _encode_auth(auth):
""" """
A function compatible with Python 2.3-3.3 that will encode A function compatible with Python 2.3-3.3 that will encode
auth from a URL suitable for an HTTP header. auth from a URL suitable for an HTTP header.
>>> _encode_auth('username%3Apassword') >>> str(_encode_auth('username%3Apassword'))
u'dXNlcm5hbWU6cGFzc3dvcmQ=' '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) auth_s = unquote(auth)
# convert to bytes # convert to bytes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment