title: startswith TypeError in function
body: <p>Here is the code:</p>
  
  <pre><code>    def readFasta(filename):
          """ Reads a sequence in Fasta format """
          fp = open(filename, 'rb')
          header = ""
          seq = ""
          while True:
              line = fp.readline()
              if (line == ""):
                  break
              if (line.startswith('&gt;')):
                  header = line[1:].strip()
              else:
                  seq = fp.read().replace('\n','')
                  seq = seq.replace('\r','')          # for windows
                  break
          fp.close()
          return (header, seq)
  
      FASTAsequence = readFasta("MusChr01.fa")
  </code></pre>
  
  <p>The error I'm getting is:</p>
  
  <pre><code>TypeError: startswith first arg must be bytes or a tuple of bytes, not str
  </code></pre>
  
  <p>But the first argument to <code>startswith</code> is supposed to be a string according to the docs... so what is going on?</p>
  
  <p>I'm assuming I'm using at least Python 3 since I'm using the latest version of LiClipse.</p>