Negative float values are not serialized correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Twotp |
Fix Released
|
Medium
|
Thomas Herve |
Bug Description
Erlang code:
-module(store).
-export([test/1]).
test(SomeFloat) ->
io:fwrite("the float: ~p~n", [SomeFloat]).
python code (variant of):
from twisted.internet import reactor
from twotp import OneShotPortMapp
def gotConnection(
return inst.factory.
def gotConnection(
return inst.factory.
def gotResult(resp):
print "Got response", resp
reactor.stop()
def eb(error):
print "Got error", error
reactor.stop()
cookie = readCookie()
nodeName = buildNodeName(
epmd = OneShotPortMapp
epmd.connectToN
reactor.run()
erlang error:
=ERROR REPORT==== 16-Nov-
Got invalid data on distribution channel, offending packet is: <<112,131,
description: | updated |
Changed in twotp: | |
status: | Fix Committed → Fix Released |
I fixed the bug using py_interface float serialization code. Change packer.py to this: self.MAGIC_ FLOAT) + floatStr + nullPadStr
def pack_float(self, term):
"""
Pack a float.
"""
floatStr = "%.20e" % term
nullPadStr = "\0" * (31 - len(floatStr))
return self.packChar(