qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jiri Daněk (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (PROTON-1592) [proton-python] accessing properties of event.receiver in on_link_opened throws exception
Date Fri, 20 Oct 2017 14:26:00 GMT

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

Jiri Daněk edited comment on PROTON-1592 at 10/20/17 2:25 PM:
--------------------------------------------------------------

[~justi9], [~gsim] This was fixed how, exactly? As far as I can tell the issue is still there
in the RC1 release that is being voted on.


was (Author: jdanek):
[~justi9] This was fixed how, exactly? As far as I can tell the issue is still there in the
RC1 release that is being voted on.

> [proton-python] accessing properties of event.receiver in on_link_opened throws exception
> -----------------------------------------------------------------------------------------
>
>                 Key: PROTON-1592
>                 URL: https://issues.apache.org/jira/browse/PROTON-1592
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: python-binding
>            Reporter: Jiri Daněk
>            Assignee: Alan Conway
>              Labels: regression
>             Fix For: proton-c-0.18.0
>
>
> Apply the following patch to the {{tx-recv.py}} example
> {code}
> diff --git a/examples/python/tx_recv.py b/examples/python/tx_recv.py
> index 4baddcf5..54f3b489 100755
> --- a/examples/python/tx_recv.py
> +++ b/examples/python/tx_recv.py
> @@ -40,6 +40,9 @@ class TxRecv(MessagingHandler, TransactionHandler):
>          self.container.declare_transaction(self.conn, handler=self)
>          self.transaction = None
>  
> + def on_link_opened(self, event):
> +     event.receiver.drain_mode = True
> +
>      def on_message(self, event):
>          print(event.message.body)
>          self.transaction.accept(event.delivery)
> {code}
> Now run first {{tx_send.py}}, then this {{tx_recv.py}}. The second command throws exception
> {noformat}
> $ LD_LIBRARY_PATH=`pwd`/lib64 PYTHONPATH=`pwd`/lib64/proton/bindings/python python ../examples/python/tx_recv.py
> Traceback (most recent call last):
>   File "../examples/python/tx_recv.py", line 79, in <module>
>     Container(TxRecv(opts.address, opts.messages, opts.batch_size)).run()
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/reactor.py",
line 148, in run
>     while self.process(): pass
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/reactor.py",
line 174, in process
>     self._check_errors()
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/reactor.py",
line 170, in _check_errors
>     _compat.raise_(exc, value, tb)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/__init__.py",
line 4068, in dispatch
>     ev.dispatch(self.handler)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/__init__.py",
line 3977, in dispatch
>     result = dispatch(handler, type.method, self)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/__init__.py",
line 3857, in dispatch
>     return handler.on_unhandled(method, *args)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/reactor.py",
line 876, in on_unhandled
>     event.dispatch(handler)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/__init__.py",
line 3980, in dispatch
>     self.dispatch(h, type)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/__init__.py",
line 3977, in dispatch
>     result = dispatch(handler, type.method, self)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/__init__.py",
line 3855, in dispatch
>     return m(*args)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/handlers.py",
line 298, in on_link_remote_open
>     self.on_link_opened(event)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/handlers.py",
line 313, in on_link_opened
>     dispatch(self.delegate, 'on_link_opened', event)
>   File "/home/jdanek/Work/repos/qpid-proton/install/lib64/proton/bindings/python/proton/__init__.py",
line 3855, in dispatch
>     return m(*args)
>   File "../examples/python/tx_recv.py", line 44, in on_link_opened
>     event.receiver.drain_mode = True
> AttributeError: 'NoneType' object has no attribute 'drain_mode'
> {noformat}
> To see this is a regression, repeat now with python-qpid-proton 0.17.0 from Pypi. With
this previous release, there is success.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message