When using the main.py test in TinCanPython with LearningLocker's LRS (https://github.com/LearningLocker/learninglocker), the LRS returns:
<title>400 Bad Request</title>
Bad Request
Your browser sent a request that this server could not understand.
Request header field is missing ':' separator.
Looking at the remote_lrs.py I find:
auth_string = "Basic " + base64.encodestring(unicode(kwargs["username"]) +
":" +
unicode(kwargs["password"]))[:-1]
base64.encodestring resulted in newlines added at the end and every 76 characters, so the header was being malformed by having the tail portion of the base64 encoded authentication string on a newline.
My suggestion is to use this instead:
auth_string = "Basic " + base64.b64encode(unicode(kwargs["username"]) +
":" +
unicode(kwargs["password"]))
Note: changed to use b64encode and remove [:-1].