diff --git a/coolamqp/framing/definitions.py b/coolamqp/framing/definitions.py index 4abf4bc2c47f086ad52da486fd3e830d293c1b61..14c8b3bb0f30a81dedec23fe3e03555e88549919 100644 --- a/coolamqp/framing/definitions.py +++ b/coolamqp/framing/definitions.py @@ -240,7 +240,7 @@ class ConnectionOpen(AMQPMethod): parts of the arguments section. :type out: callable(part_of_frame: binary type) -> nevermind """ - out(struct.pack('!pp?', self.virtual_host, u'', 0)) + out(struct.pack('!p?', self.virtual_host, 0)) class ConnectionOpenOk(AMQPMethod): @@ -277,7 +277,6 @@ class ConnectionOpenOk(AMQPMethod): parts of the arguments section. :type out: callable(part_of_frame: binary type) -> nevermind """ - out(struct.pack('!p', u'')) class ConnectionStart(AMQPMethod): @@ -837,7 +836,6 @@ class ChannelOpen(AMQPMethod): parts of the arguments section. :type out: callable(part_of_frame: binary type) -> nevermind """ - out(struct.pack('!p', u'')) class ChannelOpenOk(AMQPMethod): @@ -2029,7 +2027,6 @@ class BasicGetEmpty(AMQPMethod): parts of the arguments section. :type out: callable(part_of_frame: binary type) -> nevermind """ - out(struct.pack('!p', u'')) class BasicPublish(AMQPMethod): diff --git a/utils/compdefs.py b/utils/compdefs.py index 978643816a9ca1911672f2857a185e1608cec443..0c2e2f664ec79dc4cfc75e197709df7b5c96a0a5 100644 --- a/utils/compdefs.py +++ b/utils/compdefs.py @@ -269,7 +269,12 @@ class AMQPMethod(object): if tp == 'longstr': line(' out(self.'+name_field(field.name)+')\n') else: - good_structs.append((BASIC_TYPES[tp][1], 'self.'+name_field(field.name) if not field.reserved else frepr(BASIC_TYPES[tp][2]))) + # special case - empty string + if tp == 'shortstr' and field.reserved: + continue # just skip :) + + val = 'self.'+name_field(field.name) if not field.reserved else frepr(BASIC_TYPES[tp][2], sop=six.binary_type) + good_structs.append((BASIC_TYPES[tp][1], val)) emit_structs(good_structs) line('\n')