Kim van der Riet created PROTON-1838:
----------------------------------------

             Summary: [Python binding] proton.float32('inf') and 
proton.float32('-inf') fail during encoding on CentOS 7
                 Key: PROTON-1838
                 URL: https://issues.apache.org/jira/browse/PROTON-1838
             Project: Qpid Proton
          Issue Type: Bug
          Components: python-binding
            Reporter: Kim van der Riet
         Attachments: simple_send.py

Using the special float values {{'inf'}} and {{'-inf'}} in a {{proton.float32}} 
message body on CentOS 7 (both Python 2 and 3) result in the following error:
{noformat}
[kvdr@rhm-x3550-05 ~]$ cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
[kvdr@rhm-x3550-05 ~]$ python --version
Python 2.7.5
[kvdr@rhm-x3550-05 ~]$ python3 --version
Python 3.4.5
[kvdr@rhm-x3550-05 ~]$ python simple_send.py -a localhost:8001/qit.examples
Traceback (most recent call last):
  File "simple_send.py", line 62, in <module>
    Container(Send(opts.address, opts.messages)).run()
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/reactor.py",
 line 148, in run
    while self.process(): pass
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/reactor.py",
 line 174, in process
    self._check_errors()
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/reactor.py",
 line 170, in _check_errors
    _compat.raise_(exc, value, tb)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 3478, in dispatch
    ev.dispatch(self.handler)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 3390, in dispatch
    self.dispatch(h, type)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 3387, in dispatch
    result = dispatch(handler, type.method, self)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 3265, in dispatch
    return m(*args)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/handlers.py",
 line 41, in on_link_flow
    self.on_sendable(event)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/handlers.py",
 line 63, in on_sendable
    dispatch(self.delegate, 'on_sendable', event)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 3265, in dispatch
    return m(*args)
  File "simple_send.py", line 41, in on_sendable
    event.sender.send(msg)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 2437, in send
    return obj.send(self, tag=tag)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 540, in send
    encoded = self.encode()
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 523, in encode
    self._pre_encode()
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 267, in _pre_encode
    body.put_object(self.body)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 1698, in put_object
    putter(self, obj)
  File 
"/var/lib/jenkins/workspace/install/lib64/proton/bindings/python/proton/__init__.py",
 line 1209, in put_float
    self._check(pn_data_put_float(self._data, f))
OverflowError: in method 'pn_data_put_float', argument 2 of type 
'float'{noformat}
and which can be observed by running the attached reproducer based on the 
simple_send.py example. The use of float special value {{'NaN'}} does not 
produce this error, however.

This error does not occur on Fedora 27.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to