title: Open() and codecs.open() in Python 2.7 behave strangely different
body: <p>I have a text file with first line of unicode characters and all other lines in ASCII.
  I try to read the first line as one variable, and all other lines as another. However, when I use the following code:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  import codecs
  import os
  filename = '1.txt'
  f = codecs.open(filename, 'r3', encoding='utf-8')
  print f
  names_f = f.readline().split(' ')
  data_f = f.readlines()
  print len(names_f)
  print len(data_f)
  f.close()
  print 'And now for something completely differerent:'
  g = open(filename, 'r')
  names_g = g.readline().split(' ')
  print g
  data_g = g.readlines()
  print len(names_g)
  print len(data_g)
  g.close()
  </code></pre>
  
  <p>I get the following output:</p>
  
  <pre><code>&lt;open file '1.txt', mode 'rb' at 0x01235230&gt;
  28
  
  7
  
  And now for something completely differerent:
  
  &lt;open file '1.txt', mode 'r' at 0x017875A0&gt;
  
  28
  
  77
  </code></pre>
  
  <p>If I don't use readlines(), whole file reads, not only first 7 lines both at codecs.open() and open().</p>
  
  <p>Why does such thing happen?
  And why does codecs.open() read file in binary mode, despite the 'r' parameter is added?</p>
  
  <p>Upd: This is original file: <a href="http://www1.datafilehost.com/d/0792d687" rel="nofollow">http://www1.datafilehost.com/d/0792d687</a></p>