from binascii import b2a_base64

def b64open(url, postdata):
    req = Request(url, b2a_base64(postdata), headers={
        'Content-Transfer-Encoding': 'base64'})
Send file using POST from a Python script