title: Python gzip refuses to read uncompressed file
body: <p>I seem to remember that the Python gzip module previously allowed you to read non-gzipped files transparently. This was really useful, as it allowed to read an input file whether or not it was gzipped. You simply didn't have to worry about it.</p>
  
  <p>Now,I get an IOError exception (in Python 2.7.5):</p>
  
  <pre><code>   Traceback (most recent call last):
    File "tst.py", line 14, in &lt;module&gt;
      rec = fd.readline()
    File "/sw/lib/python2.7/gzip.py", line 455, in readline
      c = self.read(readsize)
    File "/sw/lib/python2.7/gzip.py", line 261, in read
      self._read(readsize)
    File "/sw/lib/python2.7/gzip.py", line 296, in _read
      self._read_gzip_header()
    File "/sw/lib/python2.7/gzip.py", line 190, in _read_gzip_header
      raise IOError, 'Not a gzipped file'
  IOError: Not a gzipped file
  </code></pre>
  
  <p>If anyone has a neat trick, I'd like to hear about it. Yes, I know how to catch the exception, but I find it rather clunky to first read a line, then close the file and open it again.</p>