title: TypeError sequence item 0: expected str instance, bytes found
body: <p>for some reason i keep getting the TypeError at this</p>
  
  <p>TypeError                                 Traceback (most recent call last)
  &lt;</p>
  
  <pre><code>ipython-input-19-3490eb36442d&gt; in &lt;module&gt;
        2 result, numbers = mail.uid('search', None, "ALL")
        3 uids = numbers[0].split()
  ----&gt; 4 result, messages = mail.uid('fetch', ','.join(uids), '(BODY[])')
  
  mail.select("INBOX")
  result, numbers = mail.uid('search', None, "ALL")
  uids = numbers[0].split()
  result, messages = mail.uid('fetch', ','.join(uids), '(BODY[])')
  date_list = []
  from_list = []
  message_text = []
  for _, message in messages[::2]:
      msg = email.message_from_string(message)
      if msg.is_multipart():
          t = []
      for p in msg.get_payload():
          t.append(p.get_payload(decode=True))
          message_text.append(t[0])
  
      else:message_text.append(msg.get_payload(decode=True))
      date_list.append(msg.get('date'))
      from_list.append(msg.get('from'))
      date_list = pd.to_datetime(date_list)
      print (len(message_text))
      print (len(from_list))
      df = pd.DataFrame(data={'Date':date_list,'Sender':from_list,'Message':message_text})
      print (df.head())
      df.to_csv('~inbox_email.csv',index=False)
  </code></pre>