From 8a2918a87c93c7fcde4260d5ab2f45f33c70ec8a Mon Sep 17 00:00:00 2001
From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl>
Date: Tue, 10 Jan 2017 06:34:21 +0100
Subject: [PATCH] codings

---
 .../framing/compilation/compile_definitions.py    | 15 ++++++++-------
 coolamqp/framing/definitions.py                   |  4 +---
 coolamqp/framing/field_table.py                   |  2 +-
 coolamqp/objects.py                               |  2 ++
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/coolamqp/framing/compilation/compile_definitions.py b/coolamqp/framing/compilation/compile_definitions.py
index 855415b..a39e427 100644
--- a/coolamqp/framing/compilation/compile_definitions.py
+++ b/coolamqp/framing/compilation/compile_definitions.py
@@ -42,13 +42,14 @@ AMQP is copyright (c) 2016 OASIS
 CoolAMQP is copyright (c) 2016 DMS Serwis s.c.
 
 
-###########################################
-# IMPORTANT NOTE
-# Type of field may depend on the origin of packet.
-# strings will be memoryviews if we received the packet
-# while they may be bytes if we created it
-#
-# this has some use - speed :D
+###########################################################
+# IMPORTANT NOTE                                          #
+# Type of field may depend on the origin of packet.       #
+# strings will be memoryviews if we received the packet   #
+# while they may be bytes if we created it                #
+#                                                         #
+# this has some use - speed :D                            #
+###########################################################
 """
 
 import struct, collections, warnings, logging, six
diff --git a/coolamqp/framing/definitions.py b/coolamqp/framing/definitions.py
index d76defe..8a9e7d8 100644
--- a/coolamqp/framing/definitions.py
+++ b/coolamqp/framing/definitions.py
@@ -10,15 +10,13 @@ AMQP is copyright (c) 2016 OASIS
 CoolAMQP is copyright (c) 2016 DMS Serwis s.c.
 
 
-###########################################################
+###########################################
 # IMPORTANT NOTE
 # Type of field may depend on the origin of packet.
 # strings will be memoryviews if we received the packet
 # while they may be bytes if we created it
 #
 # this has some use - speed :D
-# Remember to call .tobytes() if you need so!
-###########################################################
 """
 
 import struct, collections, warnings, logging, six
diff --git a/coolamqp/framing/field_table.py b/coolamqp/framing/field_table.py
index 24a16fa..04cb39a 100644
--- a/coolamqp/framing/field_table.py
+++ b/coolamqp/framing/field_table.py
@@ -76,7 +76,7 @@ FIELD_TYPES = {
 
 def enframe_field_value(buf, fv):
     value, type = fv
-    buf.write(type)
+    buf.write(type.encode('utf8'))
 
     opt = FIELD_TYPES[type]
 
diff --git a/coolamqp/objects.py b/coolamqp/objects.py
index b476f5f..6d2fcc4 100644
--- a/coolamqp/objects.py
+++ b/coolamqp/objects.py
@@ -79,7 +79,9 @@ class ReceivedMessage(Message):
         :param connect_id: connection ID. ClusterHandlerThread will check this in order
             not to ack messages that were received from a dead connection
         :param exchange_name: name of exchange this message was submitted to
+        :type exchange_name: memoryview
         :param routing_key: routing key with which this message was sent
+        :type routing_key: memoryview
         :param properties: a suitable BasicContentPropertyList subinstance
 
         :param delivery_tag: delivery tag assigned by AMQP broker to confirm this message
-- 
GitLab