Work around Python 2.7 failure to initialize base class
Work around Python 2.7 failure to initialize base class

urllib2 returns a malformed HTTPError object in certain situations.
For example, urllib2 has a couple of places where it creates an
HTTPError object with no fp:

  if self.retried > 5:
    # retry sending the username:password 5 times before failing.
    raise HTTPError(req.get_full_url(), 401, "basic auth failed",
                    headers, None)

When it does that, HTTPError's ctor doesn't call through to
addinfourl's ctor:

  # The addinfourl classes depend on fp being a valid file
  # object.  In some cases, the HTTPError may not have a valid
  # file object.  If this happens, the simplest workaround is to
  # not initialize the base classes.
  if fp is not None:
    self.__super_init(fp, hdrs, url, code)

Which means the 'headers' slot in addinfourl is not initialized and
info() fails.  It is completely insane that urllib2 decides not to
initialize its own base class sometimes.

Change-Id: I32a0d738f71bdd7d38d86078b71d9001e26f1ec3
Signed-off-by: Shawn O. Pearce <f3ea74d906fa9fe97c1fef6bad9cb871485c7045@google.com>

Copypeng/git-repo,hackbutty/git-repo,xhteam/git-repo,linux-knight/repo,ericmckean/git-repo,yanjiegit/jiangxin-repo,enochcheng/git-repo,Copypeng/git-repo,wavecomp/git-repo,ilansmith/repo,windyan/git-repo,yanjiegit/andriod-repo,kdavis-mozilla/repo-repo,DavidPu/git-repo,aep/repo,urras/git-repo,lshain/repo,xxxrac/git-repo,testbetta/repo-pub,duralog/repo,nbp/git-repo,qioixiy/git-repo,hyper123/git-repo,alanbian/git-repo,testbetta/repo-pub,darrengarvey/git-repo,jpzhu/git-repo,aosp-mirror/tools_repo,ilansmith/repo,ceejatec/git-repo,hejq0310/git-repo,mixedpuppy/git-repo,testbetta/git-repo-pub,mixedpuppy/git-repo,wzhy90/git-repo,sb2008/git-repo,josn-jys/git-repo,RuanJG/git-repo,FlymeOS/repo,hacker-camp/google_repo,daimajia/git-repo,jmollan/git-repo,linuxdeepin/git-repo,SunRain/repo,opencontrail-ci-admin/git-repo,azzurris/git-repo,djibi2/git-repo,xianyo/git-repo,yanjiegit/jiangxin-repo,hackbutty/git-repo,chenyun90323/git-repo,dsiganos/git-repo,frogbywyplay/git-repo,loungin/git-repo,FlymeOS/repo,chusiang/git-repo,rochy2014/repo,crashkita/git-repo,hisilicon/git-repo,TheQtCompany/git-repo,HenningSchroeder/git-repo,chzhong/git-repo,derron/git-repo,windyan/git-repo,zbunix/git-repo,fantasyfly/git-repo,nuclearmistake/repo,opensourcechipspark/repo,GerritCodeReview/git-repo,jingyu/git-repo,artprogramming/git-repo,RuanJG/git-repo,hanw/git-repo,enochcheng/git-repo,vmx/git-repo,dsiganos/git-repo,finik/git-repo,wzhy90/git-repo,jmollan/git-repo,ronan22/repo,nucked/git-repo,xhteam/git-repo,venus-solar/git-repo,CedricCabessa/repo,jcfrank/myrepo,CyanogenMod/tools_repo,todototry/git-repo,chenzilin/git-repo,sapiippo/git-repo,4455jkjh/repo,artprogramming/git-repo,Jokebin/git-repo,chusiang/git-repo,baidurom/repo,Omnifarious/git-repo,flingone/git-repo,LA-Toth/git-repo,gbraad/git-repo,posix4e/git-repo,ChronoMonochrome/repo,qingpingguo/git-repo,loungin/git-repo,dinpot/git-repo,yanjiegit/jiangxin-repo,cubieboard/git-repo,lipro-yocto/git-repo,daimajia/git-repo,slfyusufu/repo,linuxdeepin/git-repo,masscre/git-repo,COrtegaflowcorp/git-repo,lovesecho/xrepo,aep/repo,FuangCao/repo,iAlios/git-repo,xin3liang/git-repo,liaog/git-repo,aosp-mirror/tools_repo,zbunix/git-repo,petemoore/git-repo,zemug/repo,gbraad/git-repo,slfyusufu/repo,simbasailor/git-repo,bestes/repo,yanjiegit/andriod-repo,bestes/repo,mer-tools/git-repo,11NJ/git-repo,testbetta/git-repo-pub,chenyun90323/git-repo,ossxp-com/repo,yanjiegit/andriod-repo,chenzilin/git-repo,folpindo/git-repo,amersons/git-repo,opencontrail-ci-admin/git-repo,fantasyfly/git-repo,lanniaoershi/git-repo,AurelienBallier/git-repo,ronan22/repo,eric011/git-repo,cubieboard/git-repo,kangear/git-repo,codetutil/git-repo,cubieboard/git-repo,qioixiy/git-repo,djibi2/git-repo,chzhong/git-repo,eric011/git-repo,idwanglu2010/git-repo,luohongzhen/git-repo,Fr4ncky/git-repo,Fr4ncky/git-repo,dsiganos/git-repo,Jokebin/git-repo,qupai/git-repo,iAlios/git-repo,duralog/repo,todototry/git-repo,frogbywyplay/git-repo,LA-Toth/git-repo,petemoore/git-repo,lovesecho/xrepo,luohongzhen/git-repo,FuangCao/git-repo,hanw/git-repo,llg84/google_repo,aep/repo,eligoenergy/git-repo,hanchentech/git-repo,zbunix/git-repo,lchiocca/repo,derron/git-repo,TheQtCompany/git-repo,ericmckean/git-repo,Pankaj-Sakariya/android-source-browsing.git-repo,CedricCabessa/repo,zemug/repo,lovesecho/xrepo,Pivosgroup/google-git-repo,AurelienBallier/git-repo,jingyu/git-repo,xianyo/git-repo,ChronoMonochrome/repo,GerritCodeReview/git-repo,codetutil/git-repo,josn-jys/git-repo,jangle789/git-repo,liaog/git-repo,biaolv/git-repo,posix4e/git-repo,IbpTeam/repo,ediTLJ/git-repo,ceejatec/git-repo,martinjina/git-repo,ossxp-com/repo,simbasailor/git-repo,la4430/repo,hyper123/git-repo,alanbian/git-repo,darrengarvey/git-repo,rochy2014/repo,flingone/git-repo,wavecomp/git-repo,amersons/git-repo,SaleJumper/android-source-browsing.git-repo,dodocat/git-repo,llg84/google_repo,nbp/git-repo,kangear/git-repo,4455jkjh/repo,xecle/git-repo,linux-knight/repo,hejq0310/git-repo,DavidPu/git-repo,xin3liang/git-repo,Pivosgroup/google-git-repo,alessandro-aglietti/git-repo,11NJ/git-repo,folpindo/git-repo,CedricCabessa/repo,mozilla/git-repo,couchbasedeps/git-repo,opensourcechipspark/repo,qupai/git-repo,ossxp-com/repo,martinjina/git-repo,linux-knight/repo,lchiocca/repo,bhargavkumar040/android-source-browsing.git-repo,Omnifarious/git-repo,qingpingguo/git-repo,sb2008/git-repo,jangle789/git-repo,ThangBK2009/android-source-browsing.git-repo,zodsoft/git-repo,dodocat/git-repo,SaleJumper/android-source-browsing.git-repo,gabbayo/git-repo,sapiippo/git-repo,urras/git-repo,lipro-yocto/git-repo,eligoenergy/git-repo,couchbasedeps/git-repo,lewixliu/git-repo,demonyangyue/git-repo,jcfrank/myrepo,HenningSchroeder/git-repo,FuangCao/repo,zodsoft/git-repo,alessandro-aglietti/git-repo,SunRain/repo,xyyangkun/git-repo,bhargavkumar040/android-source-browsing.git-repo,lanniaoershi/git-repo,demonyangyue/git-repo,lightsofapollo/git-repo,sramaswamy/repo,vmx/git-repo,sramaswamy/repo,weixiaodong/git-repo,hanchentech/git-repo,idwanglu2010/git-repo,xecle/git-repo,hacker-camp/google_repo,mozilla/git-repo,ediTLJ/git-repo,masscre/git-repo,kdavis-mozilla/repo-repo,lewixliu/git-repo,GatorQue/git-repo-flow,crashkita/git-repo,lshain/repo,baidurom/repo,finik/git-repo,nickpith/git-repo,FuangCao/git-repo,CyanogenMod/tools_repo,la4430/repo,xxxrac/git-repo,COrtegaflowcorp/git-repo,nucked/git-repo,gabbayo/git-repo,lightsofapollo/git-repo,Pankaj-Sakariya/android-source-browsing.git-repo,venus-solar/git-repo,jpzhu/git-repo,biaolv/git-repo,finik/git-repo,dinpot/git-repo,xyyangkun/git-repo,GatorQue/git-repo-flow,azzurris/git-repo,hisilicon/git-repo,nuclearmistake/repo,mer-tools/git-repo,IbpTeam/repo,Omnifarious/git-repo,nickpith/git-repo,weixiaodong/git-repo,ThangBK2009/android-source-browsing.git-repo