title: How can I send a StringIO via FTP in python 3?
body: <p>I want to upload a text string as a file via FTP.</p>
  
  <pre><code>import ftplib
  from io import StringIO
  
  file = StringIO()
  file.write("aaa")
  file.seek(0)
  
  
  with ftplib.FTP() as ftp:
      ftp.connect("192.168.1.104", 2121)
      ftp.login("ftp", "ftp123")
      ftp.storbinary("STOR 123.txt", file)
  </code></pre>
  
  <p>This code returns an error:</p>
  
  <pre><code>TypeError: 'str' does not support the buffer interface
  </code></pre>