Bug 1185105 - update mercurial to fix AttributeError
Summary: update mercurial to fix AttributeError
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mercurial
Version: 21
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Neal Becker
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-22 22:21 UTC by Guohua Ouyang
Modified: 2015-01-23 12:04 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-01-23 12:04:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Guohua Ouyang 2015-01-22 22:21:53 UTC
Description of problem:
The line 228 of file url.py in current mercurial package use an non-public API from python-27, "self._set_hostport(self.host, self.port)".

However, there is a change in python27 httplib.py, which change the API name from from "_set_hostport" to "_get_hostport", I met an error "AttributeError: httpsconnection instance has no attribute '_set_hostport'" when use the mercurial-3.0-2.fc21.x86_64.rpm package. [2]

And I checked the stable source from the official repo [1], there are some updates and it does not use "set_hostport" any more , please update the package to fix the problem.

[1] http://selenic.com/repo/hg-stable/file/de519517f597/mercurial/url.py

[2] $ go get code.google.com/p/go-uuid/uuid
# cd .; hg clone -U https://code.google.com/p/go-uuid
/home/guohua/go/src/code.google.com/p/go-uuid
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.8 (default, Nov 10 2014, 08:19:18) [GCC 4.9.2 20141101
(Red Hat 4.9.2-1)]
** Mercurial Distributed SCM (version 3.0)
** Extensions loaded:
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py",
line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py",
line 69, in dispatch
    ret = _runcatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py",
line 138, in _runcatch
    return _dispatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py",
line 810, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py",
line 590, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py",
line 901, in _runcommand
    return checkargs()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py",
line 872, in checkargs
    return cmdfunc()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py",
line 807, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line
518, in check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/mercurial/commands.py",
line 1298, in clone
    branch=opts.get('branch'))
  File "/usr/lib64/python2.7/site-packages/mercurial/hg.py", line 295, in clone
    srcpeer = peer(ui, peeropts, source)
  File "/usr/lib64/python2.7/site-packages/mercurial/hg.py", line 129, in peer
    return _peerorrepo(rui, path, create).peer()
  File "/usr/lib64/python2.7/site-packages/mercurial/hg.py", line 106,
in _peerorrepo
    obj = _peerlookup(path).instance(ui, path, create)
  File "/usr/lib64/python2.7/site-packages/mercurial/httppeer.py",
line 261, in instance
    inst._fetchcaps()
  File "/usr/lib64/python2.7/site-packages/mercurial/httppeer.py",
line 58, in _fetchcaps
    self.caps = set(self._call('capabilities').split())
  File "/usr/lib64/python2.7/site-packages/mercurial/httppeer.py",
line 172, in _call
    fp = self._callstream(cmd, **args)
  File "/usr/lib64/python2.7/site-packages/mercurial/httppeer.py",
line 119, in _callstream
    resp = self.urlopener.open(req)
  File "/usr/lib64/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib64/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/site-packages/mercurial/url.py", line
372, in https_open
    return self.do_open(self._makeconnection, req)
  File "/usr/lib64/python2.7/site-packages/mercurial/keepalive.py",
line 254, in do_open
    self._start_transaction(h, req)
  File "/usr/lib64/python2.7/site-packages/mercurial/url.py", line
358, in _start_transaction
    return keepalive.KeepAliveHandler._start_transaction(self, h, req)
  File "/usr/lib64/python2.7/site-packages/mercurial/keepalive.py",
line 352, in _start_transaction
    h.endheaders()
  File "/usr/lib64/python2.7/httplib.py", line 991, in endheaders
    self._send_output(message_body)
  File "/usr/lib64/python2.7/httplib.py", line 844, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.7/site-packages/mercurial/url.py", line
144, in _sendfile
    orgsend(self, data)
  File "/usr/lib64/python2.7/site-packages/mercurial/keepalive.py",
line 532, in safesend
    self.connect()
  File "/usr/lib64/python2.7/site-packages/mercurial/url.py", line
342, in connect
    _generic_proxytunnel(self)
  File "/usr/lib64/python2.7/site-packages/mercurial/url.py", line
228, in _generic_proxytunnel
    self._set_hostport(self.host, self.port)
AttributeError: httpsconnection instance has no attribute '_set_hostport'
package code.google.com/p/go-uuid/uuid: exit status 1

Version-Release number of selected component (if applicable):
mercurial-3.0-2.fc21.x86_64

How reproducible:
100%

Steps to Reproduce:
1. use go get the package behind http or https proxy.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Neal Becker 2015-01-23 12:04:06 UTC
3.2.2 is in updates-testing.


Note You need to log in before you can comment on or make changes to this bug.