Initial argument breaks 0.9.1

Bug #714290 reported by Liam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
txAMQP
Fix Released
Medium
Esteve Fernandez

Bug Description

Using the version of txamqp off pypi, the 0.9.1 AMQP spec cannot be used due to a failure caused by the "insist" option being removed in the spec.

The relevant part of the stack trace when trying to run a simple test script is:

File "d:\dev\eggs\txamqp-0.4-py2.6.egg\txamqp\protocol.py", line 359, in start
    result = yield channel0.connection_open(self.vhost, insist=self.insist)
exceptions.TypeError: connection_open() got an unexpected keyword argument 'insist'

A fairly straightforward patch (against trunk) that seems to fix the problem is below. I'm not sure if it there's another way of specifying that parameter that should be handled, and the AMQP site is down which made it difficult to check, so this patch just ignores the parameter.

=== modified file src/txamqp/protocol.py
--- src/txamqp/protocol.py 2010-04-14 20:07:01 +0000
+++ src/txamqp/protocol.py 2011-02-06 22:09:53 +0000
@@ -356,7 +356,12 @@
         yield self.started.wait()

         channel0 = yield self.channel(0)
- result = yield channel0.connection_open(self.vhost, insist=self.insist)
+
+ if self.check_0_8():
+ result = yield channel0.connection_open(self.vhost, insist=self.insist)
+ else:
+ result = yield channel0.connection_open(self.vhost)
+
         defer.returnValue(result)

     def sendHeartbeat(self):

Revision history for this message
Esteve Fernandez (esteve) wrote :

Thanks for your patch, I'm going to apply it to trunk asap.

Changed in txamqp:
importance: Undecided → Medium
status: New → Confirmed
status: Confirmed → In Progress
assignee: nobody → Esteve Fernandez (esteve)
Revision history for this message
Esteve Fernandez (esteve) wrote :

Hi Liam, just pushed a revision with the insist keyword removed. Thanks!

Changed in txamqp:
status: In Progress → Fix Committed
Revision history for this message
Esteve Fernandez (esteve) wrote :

Fixed in revno #56 Thanks Liam!

Changed in txamqp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.