title: Sqlite3.Binary gives TypeError: buffer object expected
body: <p>I have a list which I extracted from a txt file as follows:</p>
  
  <pre><code>authors = re.match('#@(.*)', line)
  if authors:
     authors_list = authors.group(1).split(",")
  </code></pre>
  
  <p>Now I need to insert these into my database, which should be done as follows:</p>
  
  <pre><code>for a in authors_list:
      c.execute("INSERT INTO authors(Name) VALUES (?)", (a))
  </code></pre>
  
  <p>But when I do that I get the following error:</p>
  
  <pre><code>ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 17 supplied.
  </code></pre>
  
  <p>So I did some research and found that I should change my variable a into a tuple (a, ) as such:</p>
  
  <pre><code>c.execute("INSERT INTO authors(Name) VALUES (?)", (a,))
  </code></pre>
  
  <p>And I also tried this:</p>
  
  <pre><code>c.execute("INSERT INTO authors(Name) VALUES (?)", ((a,)))
  </code></pre>
  
  <p>But got the following error:</p>
  
  <pre><code>ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.
  </code></pre>
  
  <p>So I did more research and found that I should use sqlite3's Binary function. So I tried the following:</p>
  
  <pre><code>c.execute("INSERT INTO authors(Name) VALUES (?)", (sqlite3.Binary((a,))))
  </code></pre>
  
  <p>And got the following error:</p>
  
  <pre><code>TypeError: buffer object expected
  </code></pre>
  
  <p>I keep going back and forth between all three errors no mater what combination I try. Any help would be appreciated. I don't know what I'm doing wrong.</p>