So the process I'm performing seems to make logical sense to me but I keep getting an error. So I have this binary file I'm trying to send to a server (Shapeways to be exact. It's a binary 3d model file) so I go through this process to make it acceptable in a URL
theFile = open(fileloc,'rb')
contents = theFile.read()
b64 = base64.urlsafe_b64encode(contents)
url = urllib.urlencode(b64) # error
The problem is the last line always throws the error
TypeError: not a valid non-string sequence or mapping object
Which doesn't make sense to me as the data is suppose to be encoded for URLs. Is it possible it simply contains other characters that weren't encoded or something like that?