This is a bug, but in certain way expected to happen. And, probably putting a warning in the documentation should be enough.
This provokes a callback error on the client side. And sometimes, the python instance is frozen, forcing to close the terminal or sending the process to the background.
(Cmd) Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2580, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1378, in loop_forever
rc = self.loop(timeout, max_packets)
File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 897, in loop
rc = self.loop_read(max_packets)
File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1177, in loop_read
rc = self._packet_read()
File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 1766, in _packet_read
rc = self._packet_handle()
File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2239, in _packet_handle
return self._handle_publish()
File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2414, in _handle_publish
self._handle_on_message(message)
File "/home/rfuentess/.local/lib/python2.7/site-packages/paho/mqtt/client.py", line 2568, in _handle_on_message
t[1](self, self._userdata, message)
File "/home/rfuentess/.local/lib/python2.7/site-packages/iotlabmqtt/mqttcommon.py", line 206, in _wrapper
return callback(msg, **fields)
File "/home/rfuentess/.local/lib/python2.7/site-packages/iotlabmqtt/clients/common.py", line 104, in _wrapped
ret = func(*args, **kwargs)
File "/home/rfuentess/.local/lib/python2.7/site-packages/iotlabmqtt/clients/serial.py", line 91, in line_handler
line = message.payload.decode('utf-8')
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 2: invalid start byte