title: paho.mqtt + python TypeError: a bytes-like object is required, not 'str'
body: <p>Two <code>paho.mqtt</code> clients (client1 and client2) are created in Python, which connects to <code>mosquitto</code> brokers. Two clients subscribe to different topics. client1 runs <code>loop_forever()</code>, and client2 runs <code>loop_start()</code>. client1's <code>on_message()</code> callback stores the message in MySQL database. client2's <code>on_message()</code> callback runs a simple test.</p>
  
  <p>The test contains a test method which uses mock object <code>paho.mqtt.client.MQTTMessage</code>. For client2, I am publishing the message from <code>mosquitto_pub</code> in a command line. when I receive the message to run the test, the test runs successfully. But after that I get this below error message. when I comment the test method which uses this mock object <code>paho.mqtt.client.MQTTMessage</code> for test, I don't get this error message.</p>
  
  <p>Is this error coming from Python or <code>paho.mqtt</code>? or is it from <code>client1.loop_forever()</code> method?</p>
  
  <pre><code>File "/usr/local/lib/python3.6/site-packages/paho_mqtt-1.3.1-py3.6.egg/paho/mqtt/client.py", line 1481, in loop_forever
  rc = self.loop(timeout, max_packets)
  File "/usr/local/lib/python3.6/site-packages/paho_mqtt-1.3.1-py3.6.egg/paho/mqtt/client.py", line 1003, in loop
  rc = self.loop_read(max_packets)
  File "/usr/local/lib/python3.6/site-packages/paho_mqtt-1.3.1-py3.6.egg/paho/mqtt/client.py", line 1284, in loop_read
  rc = self._packet_read()
  File "/usr/local/lib/python3.6/site-packages/paho_mqtt-1.3.1-py3.6.egg/paho/mqtt/client.py", line 1849, in _packet_read
  rc = self._packet_handle()
  File "/usr/local/lib/python3.6/site-packages/paho_mqtt-1.3.1-py3.6.egg/paho/mqtt/client.py", line 2305, in _packet_handle
  return self._handle_publish()
  File "/usr/local/lib/python3.6/site-packages/paho_mqtt-1.3.1-py3.6.egg/paho/mqtt/client.py", line 2500, in _handle_publish
  self._handle_on_message(message)
  File "/usr/local/lib/python3.6/site-packages/paho_mqtt-1.3.1-py3.6.egg/paho/mqtt/client.py", line 2640, in _handle_on_message
  for callback in self._on_message_filtered.iter_match(message.topic):
  File "/usr/local/lib/python3.6/site-packages/paho_mqtt-1.3.1-py3.6.egg/paho/mqtt/matcher.py", line 60, in iter_match
  lst = topic.split('/')
  TypeError: a bytes-like object is required, not 'str'
  </code></pre>