title: Let JSON object accept bytes or let urlopen output strings
body: <p>With Python 3 I am requesting a json document from a URL.</p>
  
  <pre><code>response = urllib.request.urlopen(request)
  </code></pre>
  
  <p>The <code>response</code> object is a file-like object with <code>read</code> and <code>readline</code> methods. Normally a JSON object can be created with a file opened in text mode.</p>
  
  <pre><code>obj = json.load(fp)
  </code></pre>
  
  <p>What I would like to do is:</p>
  
  <pre><code>obj = json.load(response)
  </code></pre>
  
  <p>This however does not work as urlopen returns a file object in binary mode.</p>
  
  <p>A work around is of course:</p>
  
  <pre><code>str_response = response.read().decode('utf-8')
  obj = json.loads(str_response)
  </code></pre>
  
  <p>but this feels bad...</p>
  
  <p>Is there a better way that I can transform a bytes file object to a string file object? Or am I missing any parameters for either <code>urlopen</code> or <code>json.load</code> to give an encoding?</p>