

def send_tx(tx):
    s = io.BytesIO()
    tx.stream(s)
    tx_as_hex = binascii.hexlify(s.getvalue()).decode('utf8')
    data = urllib.parse.urlencode(dict(tx=tx_as_hex)).encode('utf8')
    URL = 'http://blockchain.info/pushtx'
    try:
        d = urlopen(URL, data=data).read()
        return d
    except urllib.error.HTTPError as ex:
        d = ex.read()
        import pdb
        pdb.set_trace()
        print(ex)

dataset/ETHPy150Open maraoz/proofofexistence/pycoin/services/blockchain_info.py send_tx/original