jgarzik / python-bitcoinrpc

Python interface to bitcoin's JSON-RPC API
GNU Lesser General Public License v2.1
642 stars 307 forks source link

EncodeDecimal must return a serializable type #55

Closed dpedu closed 8 years ago

dpedu commented 9 years ago

Fixes #54.

Python 2.x's round() automatically converts Decimal types to a float. Python 3's round() returns a rounded Decimal object, leading to infinite recursion as EncodeDecimal is again called (it was passed to json.dumps as default) to convert the Decimal into a serializable type. Explicitly converting to a float will work for both python versions.

FellowTraveler commented 9 years ago

Can definitely confirm.

reiven commented 9 years ago

+1

alecalve commented 8 years ago

Duplicate of the now merged #39