title: Using io.BufferedReader on a stream obtained with open()?
body: <p>I want to use a buffered stream because I want to use a <code>peek()</code> method to peek ahead but use my stream with another method that expects a file-like object. (I'd use <code>seek()</code> but may have to handle piped-in I/O that doesn't support random access.)</p>
  
  <p>But this test case fails:</p>
  
  <p>AttributeError: 'file' object has no attribute '_checkReadable'</p>
  
  <pre><code>import sys
  import io
  
  srcfile = sys.argv[1]
  with open(srcfile, 'rb') as f:
      fbuf = io.BufferedReader(f)
      print fbuf.read(20)
  </code></pre>
  
  <p>What's going on and how do I fix it? I thought BufferedReader was intended to buffer a stream. If so, why does the <code>open()</code> function not return something that's compatible with it?</p>