title: Python I/O: How to use the wsgi.input stream from io module
body: <p>In a WSGI application we can read the row input data from the <em>wsgi.input</em> field:</p>
  
  <pre><code>def application(env, start_response):
          .....
          data = env['wsgi.input'].read(num_bytes)
          .....
  </code></pre>
  
  <p>However, I want to wrap the file-like object using the new <em>io</em> module:</p>
  
  <pre><code>import io
  def application(env, start_response):
          .....
          f = io.open(env['wsgi.input'], 'rb')
          buffer = bytearray(buff_size)
          read = f.readinto(buffer)
          .....
  </code></pre>
  
  <p>The problem is that <code>io.open</code> doesn't accept these kind of file objects. Any idea on how to do that? I need to read from <code>env['wsgi.input']</code> to a buffer.</p>