How to verify - run the example posted on README with python3. When at last step, i.e. trying to pushtx() I receive:
Exception Traceback (most recent call last)
<ipython-input-8-8648951e913e> in <module>()
----> 1 pushtx(tx2)
/usr/local/lib/python3.6/site-packages/bitcoin/bci.py in pushtx(*args, **kwargs)
302 def pushtx(*args, **kwargs):
303 f = pushtx_getters.get(kwargs.get('source', ''), bci_pushtx)
--> 304 return f(*args)
305
306
/usr/local/lib/python3.6/site-packages/bitcoin/bci.py in bci_pushtx(tx)
257 if not re.match('^[0-9a-fA-F]*$', tx):
258 tx = tx.encode('hex')
--> 259 return make_request('https://blockchain.info/pushtx', 'tx='+tx)
260
261
/usr/local/lib/python3.6/site-packages/bitcoin/bci.py in make_request(*args)
21 except:
22 p = e
---> 23 raise Exception(p)
24
25
Exception: POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str.
The fix is easy, I believe - encode the string for the python3 usage. Will validate and propose the PR.
Nevermind, this issue is gone in the current git version. It is however still in place if I install using official pip repository - might want to push it to pypi at some point.
How to verify - run the example posted on README with python3. When at last step, i.e. trying to pushtx() I receive:
The fix is easy, I believe - encode the string for the python3 usage. Will validate and propose the PR.