From ddcec924cd2bafedfa067edf6b7c964fb73fd584 Mon Sep 17 00:00:00 2001 From: GaleWombat Date: Wed, 27 Jan 2021 18:28:26 +0100 Subject: [PATCH] Adding missing property annotation and updating method name --- coapthon/client/coap.py | 2 +- coapthon/messages/message.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/coapthon/client/coap.py b/coapthon/client/coap.py index 5a3747c..0bf3e28 100644 --- a/coapthon/client/coap.py +++ b/coapthon/client/coap.py @@ -178,7 +178,7 @@ class CoAP(object): if opt.value == 26: return - if self._receiver_thread is None or not self._receiver_thread.isAlive(): + if self._receiver_thread is None or not self._receiver_thread.is_alive(): self._receiver_thread = threading.Thread(target=self.receive_datagram) self._receiver_thread.daemon = True self._receiver_thread.start() diff --git a/coapthon/messages/message.py b/coapthon/messages/message.py index 98e4a76..e4fd61d 100644 --- a/coapthon/messages/message.py +++ b/coapthon/messages/message.py @@ -127,7 +127,7 @@ class Message(object): self._token = value return if not isinstance(value, bytes): - value = bytes(value) + value = bytes(value, 'utf-8') if len(value) > 256: raise AttributeError @@ -645,7 +645,8 @@ class Message(object): Delete the Block2 option. """ self.del_option_by_number(defines.OptionRegistry.BLOCK2.number) - + + @property def size1(self): value = None for option in self.options: