[ 
https://issues.apache.org/jira/browse/PROTON-1149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15173983#comment-15173983
 ] 

Kim van der Riet commented on PROTON-1149:
------------------------------------------

The Python code which causes this error is from the Qpid Interop Test project 
which tests the interoperability of various clients against each other.

The Python code which creates this error uses test values represented in a 
string format. It is converted to a float value as follows:

{noformat}
float32(unpack('!f', test_value[2:].decode('hex'))[0]))
{noformat}

where:
* {{test_value}} contains the float value as a string, eg "0x7f800000" (+inf)
* {{float32}} is the python type defined in the proton binding for representing 
AMQP 32-bit floating point values.  It is a simple class derived from {{float}}
* {{unpack}} is imported from the Python {{struct}} package

> [Python binding] Python float values +inf and -inf do not work correctly as 
> 32-bit AMQP float values on RHEL7
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: PROTON-1149
>                 URL: https://issues.apache.org/jira/browse/PROTON-1149
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: python-binding
>    Affects Versions: 0.13.0
>            Reporter: Kim van der Riet
>
> When run on RHEL 7, the 32-bit floating point values +inf (0x7f800000) and 
> -inf (0xff800000) cause a failure in the swig interface:
> {{OverflowError: in method 'pn_data_put_float', argument 2 of type 'float'}}
> Interestingly, the test values +NaN (0x7fc00000) and -NaN(0xffc00000) which 
> are also a part of the same test, work ok.
> This error does not occur on Fedora 22.
> System details:
> Red Hat Enterprise Linux Server release 7.2 (Maipo)
> kernel: 3.10.0-327.el7.x86_64
> Python: 2.7.5 (default, Oct 11, 2015 17:47:16)
> SWIG version 2.0.10



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to