res = urllib2.urlopen(pic,timeout=10) f = cStringIO.StringIO(res.read())