python-bitcoinrpc icon indicating copy to clipboard operation
python-bitcoinrpc copied to clipboard

fixed unicode serialisation

Open toyg opened this issue 11 years ago • 3 comments
trafficstars

unicode characters in arguments get mangled up. Tested in Python 3.3.3 only.

toyg avatar Jan 18 '14 16:01 toyg

Works fine in 2.5+ as well. Should be safe to merge :)

toyg avatar Jan 18 '14 18:01 toyg

I was just about to pull request the same: 666d96a2cea :laughing:. Anyway, :+1:

thedod avatar Mar 23 '14 16:03 thedod

Hmm, this doesn't seem to actually fix the issue, just avoids the infinite loop. In particular, by casting to a float you're not ensuring the Decimal value gets encoded correctly (with 8 decimal places). I think fixing this properly will require subclassing JSONEncoder - no need to round the value, though, just get it included precisely.

luke-jr avatar Apr 03 '15 05:04 luke-jr