title: Getting TypeError: <file object at ..>is not json serializable
body: <p>I am trying to fetch json data from url link of api. i want to write data into a json file locally. but i am getting this error</p>
  
  <pre><code>File "C:\Python27\lib\json\encoder.py", line 184, in default
      raise TypeError(repr(o) + " is not JSON serializable")
  TypeError: &lt;addinfourl at 52466872 whose fp = &lt;socket._fileobject object at 0x0320C330&gt;&gt; is not JSON serializable
  </code></pre>
  
  <p>my code is give bellow</p>
  
  <pre><code>import json
  import urllib2
  urllink=urllib2.urlopen("url")
  
  
  
  with open('urljson.json','w')as outfile:
      json.dumps(urllink,outfile,indent=4,sort_keys=True, separators=(',', ':'))
  </code></pre>
  
  <p>kindly help me, Thanks in advance
  Kalyan</p>