首页 文章

获取错误<'NoneType'对象没有属性'peer_certificate'>从Mercurial的谷歌代码克隆代码时

提问于
浏览
0

Description

通过http克隆时没有错误,只有在通过https克隆时才会出现错误 .

Env

通过mercurial-1.9.1 20110801-py2.6-macosx10.6.mpkg从http://mercurial.berkwood.com/binaries/Mercurial-1.9.1-py2.6-macosx10.6.zip安装Mercurial

site-packages location:/Library/Python/2.6/site-packages

Command:

hg clone https://code.google.com/p/cooliris-toolkit/

Error Info

hg clone https://code.google.com/p/cooliris-toolkit/
    ** unknown exception encountered, please report by visiting
    **  http://mercurial.selenic.com/wiki/BugTracker
    ** Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)]
    ** Mercurial Distributed SCM (version 1.9.1+20110801)
    ** Extensions loaded: 
    Traceback (most recent call last):
      File "/usr/local/bin/hg", line 38, in 
        mercurial.dispatch.run()
      File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 27, in run
        sys.exit(dispatch(request(sys.argv[1:])))
      File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 64, in dispatch
        return _runcatch(req)
      File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 87, in _runcatch
        return _dispatch(req)
      File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 679, in _dispatch
        cmdpats, cmdoptions)
      File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 454, in runcommand
        ret = _runcommand(ui, options, cmd, d)
      File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 733, in _runcommand
        return checkargs()
      File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 687, in checkargs
        return cmdfunc()
      File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 676, in 
        d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
      File "/Library/Python/2.6/site-packages/mercurial/util.py", line 385, in check
        return func(*args, **kwargs)
      File "/Library/Python/2.6/site-packages/mercurial/commands.py", line 1041, in clone
        branch=opts.get('branch'))
      File "/Library/Python/2.6/site-packages/mercurial/hg.py", line 217, in clone
        srcrepo = repository(remoteui(ui, peeropts), source)
      File "/Library/Python/2.6/site-packages/mercurial/hg.py", line 93, in repository
        repo = _peerlookup(path).instance(ui, path, create)
      File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 231, in instance
        inst._fetchcaps()
      File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 56, in _fetchcaps
        self.caps = set(self._call('capabilities').split())
      File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 164, in _call
        fp = self._callstream(cmd, **args)
      File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 114, in _callstream
        resp = self.urlopener.open(req)
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 383, in open
        response = self._open(req, data)
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 401, in _open
        '_open', req)
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 361, in _call_chain
        result = func(*args)
      File "/Library/Python/2.6/site-packages/mercurial/url.py", line 352, in https_open
        return self.do_open(self._makeconnection, req)
      File "/Library/Python/2.6/site-packages/mercurial/keepalive.py", line 256, in do_open
        self._start_transaction(h, req)
      File "/Library/Python/2.6/site-packages/mercurial/url.py", line 342, in _start_transaction
        return keepalive.KeepAliveHandler._start_transaction(self, h, req)
      File "/Library/Python/2.6/site-packages/mercurial/keepalive.py", line 354, in _start_transaction
        h.endheaders()
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 868, in endheaders
        self._send_output()
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 740, in _send_output
        self.send(msg)
      File "/Library/Python/2.6/site-packages/mercurial/url.py", line 129, in _sendfile
        orgsend(self, data)
      File "/Library/Python/2.6/site-packages/mercurial/keepalive.py", line 537, in safesend
        self.connect()
      File "/Library/Python/2.6/site-packages/mercurial/url.py", line 331, in connect
        sslutil.validator(self.ui, host)(self.sock)
      File "/Library/Python/2.6/site-packages/mercurial/sslutil.py", line 97, in __call__
        msg = _verifycert(sock.getpeercert(), host)
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ssl.py", line 157, in getpeercert
        return self._sslobj.peer_certificate(binary_form)
    AttributeError: 'NoneType' object has no attribute 'peer_certificate'

Question

我该如何解决错误? python库中是否有冲突?

1 回答

  • 1

    在我安装了Mercurial(版本1.9.3)后,我遇到了与Sailing相同的问题,当时我遇到克隆https://code.google.com/p/vim/

    我的解决方案是:hg clone http://code.google.com/p/vim/

    我猜Mercurial 1.9.3 sslutil.py在第105行有bug:peercert = sock.getpeercert(True)

相关问题