[jira] [Updated] (PROTON-1592) [proton-python] accessing properties of event.receiver in on_link_opened throws exception

2018-03-28 Thread Alan Conway (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTON-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alan Conway updated PROTON-1592:

Fix Version/s: (was: proton-c-0.22.0)

> [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
>Priority: Major
>  Labels: regression
>
> 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 
> 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
(v7.6.3#76005)

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



[jira] [Updated] (PROTON-1592) [proton-python] accessing properties of event.receiver in on_link_opened throws exception

2018-02-28 Thread Alan Conway (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTON-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alan Conway updated PROTON-1592:

Fix Version/s: (was: proton-c-future)
   proton-c-0.22.0

> [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
>Priority: Major
>  Labels: regression
> Fix For: proton-c-0.22.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 
> 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
(v7.6.3#76005)

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



[jira] [Updated] (PROTON-1592) [proton-python] accessing properties of event.receiver in on_link_opened throws exception

2018-01-26 Thread Justin Ross (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTON-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Ross updated PROTON-1592:

Fix Version/s: (was: proton-c-0.18.0)
   proton-c-future

> [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
>Priority: Major
>  Labels: regression
> Fix For: proton-c-future
>
>
> 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 
> 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
(v7.6.3#76005)

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



[jira] [Updated] (PROTON-1592) [proton-python] accessing properties of event.receiver in on_link_opened throws exception

2017-10-10 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/PROTON-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jiri Daněk updated PROTON-1592:
---
Description: 
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 
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.

  was:
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 
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 

[jira] [Updated] (PROTON-1592) [proton-python] accessing properties of event.receiver in on_link_opened throws exception

2017-10-10 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/PROTON-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jiri Daněk updated PROTON-1592:
---
Description: 
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 
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.

  was:
Apply the following patch to the {{tx-recv.py}} example

{code}
{code}

Now run first {{tx_send.py}}, then this {{tx_recv.py}}. The second command 
throws exception

{noformat}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)
$ 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 
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 

[jira] [Updated] (PROTON-1592) [proton-python] accessing properties of event.receiver in on_link_opened throws exception

2017-10-10 Thread Alan Conway (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTON-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alan Conway updated PROTON-1592:

Description: 
Apply the following patch to the {{tx-recv.py}} example

{code}
{code}

Now run first {{tx_send.py}}, then this {{tx_recv.py}}. The second command 
throws exception

{noformat}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)
$ 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 
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.

  was:
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 
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 

[jira] [Updated] (PROTON-1592) [proton-python] accessing properties of event.receiver in on_link_opened throws exception

2017-09-19 Thread Justin Ross (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTON-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Ross updated PROTON-1592:

Fix Version/s: proton-c-0.18.0

> [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 Danek
>  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 
> 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-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Updated] (PROTON-1592) [proton-python] accessing properties of event.receiver in on_link_opened throws exception

2017-09-19 Thread Jiri Danek (JIRA)

 [ 
https://issues.apache.org/jira/browse/PROTON-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jiri Danek updated PROTON-1592:
---
Description: 
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 
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.

  was:
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)
{noformat}

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 
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