[
https://issues.apache.org/jira/browse/PROTON-1417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15885575#comment-15885575
]
ASF GitHub Bot commented on PROTON-1417:
----------------------------------------
GitHub user jdanekrh opened a pull request:
https://github.com/apache/qpid-proton/pull/96
PROTON-1417 fix TypeError when address is already in use
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jdanekrh/qpid-proton-fuzz patch-1
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/qpid-proton/pull/96.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #96
----
commit 6374ef0b20af5072ec67693bcb0dd8d4951a3ed0
Author: Jiří Daněk <[email protected]>
Date: 2017-02-27T11:01:08Z
PROTON-1417 fix TypeError when address is already in use
----
> [python] TypeError on listener when handling address already in use
> -------------------------------------------------------------------
>
> Key: PROTON-1417
> URL: https://issues.apache.org/jira/browse/PROTON-1417
> Project: Qpid Proton
> Issue Type: Bug
> Components: python-binding
> Affects Versions: 0.18.0
> Reporter: Jiri Danek
> Priority: Minor
>
> There is a wrong syntax in exception handling code when raising the "Address
> already in use" error in _proton-c/bindings/python/proton/reactor.py_ (line
> 179):
> {code}
> raise IOError("%s (%s:%s)" % pn_error_text(pn_reactor_error(self._impl)),
> host, port)
> {code}
> Which leads to unexpected TypeError:
> {code}
> Traceback (most recent call last):
> File "in_handler.py", line 15, in <module>
> container.run()
> File "/usr/lib64/python2.7/site-packages/proton/reactor.py", line 133, in
> run
> while self.process(): pass
> File "/usr/lib64/python2.7/site-packages/proton/reactor.py", line 159, in
> process
> self._check_errors()
> File "/usr/lib64/python2.7/site-packages/proton/reactor.py", line 155, in
> _check_errors
> _compat.raise_(exc, value, tb)
> File "/usr/lib64/python2.7/site-packages/proton/__init__.py", line 4040, in
> dispatch
> ev.dispatch(self.handler)
> File "/usr/lib64/python2.7/site-packages/proton/__init__.py", line 3949, in
> dispatch
> result = dispatch(handler, type.method, self)
> File "/usr/lib64/python2.7/site-packages/proton/__init__.py", line 3827, in
> dispatch
> return m(*args)
> File "/usr/lib64/python2.7/site-packages/proton/handlers.py", line 436, in
> on_reactor_init
> self.on_start(event)
> File "in_handler.py", line 6, in on_start
> acceptor = event.container.listen("localhost:5672")
> File "/usr/lib64/python2.7/site-packages/proton/reactor.py", line 869, in
> listen
> acceptor = self.acceptor(url.host, url.port)
> File "/usr/lib64/python2.7/site-packages/proton/reactor.py", line 179, in
> acceptor
> raise IOError("%s (%s:%s)" % pn_error_text(pn_reactor_error(self._impl)),
> host, port)
> TypeError: not enough arguments for format string
> {code}
> Proposed fix:
> {code}
> diff --git a/proton-c/bindings/python/proton/reactor.py
> b/proton-c/bindings/python/proton/reactor.py
> index 269ed9e..a0699c8 100644
> --- a/proton-c/bindings/python/proton/reactor.py
> +++ b/proton-c/bindings/python/proton/reactor.py
> @@ -176,7 +176,7 @@ class Reactor(Wrapper):
> if aimpl:
> return Acceptor(aimpl)
> else:
> - raise IOError("%s (%s:%s)" %
> pn_error_text(pn_reactor_error(self._impl)), host, port)
> + raise IOError("%s (%s:%s)" %
> (pn_error_text(pn_reactor_error(self._impl)), host, port))
>
> def connection(self, handler=None):
> """Deprecated: use connection_to_host() instead
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]