Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #84208

An improper change in httplib.py

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!217.188.199.168.MISMATCH!takemy.news.telefonica.de!telefonica.de!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ouyanggh0815@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'attribute': 0.07; 'skip:" 60': 0.07; '*args,': 0.09; 'exit': 0.09; 'host,': 0.09; 'http': 0.09; 'mercurial': 0.09; 'obj': 0.09; 'resp': 0.09; 'shows.': 0.09; 'url:github': 0.09; 'python': 0.11; 'def': 0.12; 'changes': 0.15; '**kwargs)': 0.16; '3.0)': 0.16; '58,': 0.16; 'clone': 0.16; 'cmd,': 0.16; 'create)': 0.16; 'data)': 0.16; 'encountered,': 0.16; 'https': 0.16; 'lambda:': 0.16; "method's": 0.16; 'proxy,': 0.16; 'url:py': 0.16; 'exception': 0.16; 'extensions': 0.16; 'trying': 0.19; 'work,': 0.20; 'error': 0.23; 'first,': 0.26; 'skip:" 30': 0.26; 'post': 0.26; 'skip:_ 20': 0.27; 'url:bugs': 0.29; '[1]': 0.29; 'url:code': 0.29; "doesn't": 0.30; '[2]': 0.30; 'message-id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; 'url:wiki': 0.31; 'second,': 0.31; 'trace': 0.31; 'file': 0.32; 'skip:c 30': 0.32; 'run': 0.32; 'open': 0.33; 'url:python': 0.33; '(most': 0.33; 'skip:_ 10': 0.34; 'skip:s 30': 0.35; 'skip:u 20': 0.35; 'received:google.com': 0.35; 'right?': 0.36; 'skip:" 50': 0.36; 'url:org': 0.36; 'should': 0.36; 'behind': 0.37; 'reports': 0.37; 'system,': 0.38; 'hat': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'list,': 0.38; 'recent': 0.39; 'skip:_ 30': 0.39; 'to:addr:python.org': 0.39; 'break': 0.61; 'skip:* 10': 0.61; 'first': 0.61; 'url:p': 0.64; 'details': 0.65; 'caused': 0.69; 'visiting': 0.79; '138,': 0.84; '2014,': 0.84; 'url:cpython': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=VdrZzSrnxxUpNa4wABobiwuamQVehX28J/z5mhZEbug=; b=TtO/BtUJNMKdgUOlnW02qXftE8Wm9Hnu3+1GSYdDR7/98muZ2BoUHymIXFvq+GmsE4 uIQuLZtTkMUf4uSx3H7S1q85tTPhcXoa0RaUmK1xCe6p3+vU0Wy+JTJG6M6nDG8HIuDu H8hWWJCq8LshCreXAP9TKNjFpfag2q/uNFeAilWpzozlCQ4P7CXQWx/xJoTzl7lvHKnU ranO6Kl/jgTDxlUnkudezs9+dWBL6hWdKhVQUQ8SECr6i/Q+1rTR8iMfIWWSW+o+A01+ A5rARK4LiO3twyi90h4VdQsAH77KEuh9OLrZr8luRxbp4W6efWKmkGrSYOQA2/0wFBsa qvag==
MIME-Version 1.0
X-Received by 10.140.82.136 with SMTP id h8mr60263229qgd.75.1421897902411; Wed, 21 Jan 2015 19:38:22 -0800 (PST)
Date Thu, 22 Jan 2015 11:38:22 +0800
Subject An improper change in httplib.py
From Guohua Ouyang <ouyanggh0815@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=UTF-8
X-Mailman-Approved-At Thu, 22 Jan 2015 09:16:50 +0100
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17959.1421914611.18130.python-list@python.org> (permalink)
Lines 124
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1421914611 news.xs4all.nl 2929 [2001:888:2000:d::a6]:33422
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:84208

Show key headers only | View raw


This is my first post to the list, I apologies firstly if I made any mistake.

I was trying to get a package in golang behind the http or https
proxy, and it reports  an error "AttributeError: httpsconnection
instance has no attribute '_set_hostport'", details in the bottom.
After some trace work, I found it caused by the changes in the issue issue7776.

@@ -718,7 +734,7 @@
         else:
             self._tunnel_headers.clear()

-    def _set_hostport(self, host, port):
+    def _get_hostport(self, host, port):

First, it changes the method's name, doesn't it break the
compatibility for other packages, on my system,
mercurial-3.0-2.fc21.x86_64 still use "_set_hostport" as the error
shows.

Second, I found that line 1132 of [2] still use "
self._conn._set_hostport(host, port)", which should be
"_get_hostport", right?

[1] http://bugs.python.org/issue7776
[2] https://github.com/python/cpython/blob/2.7/Lib/httplib.py


$ 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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

An improper change in httplib.py Guohua Ouyang <ouyanggh0815@gmail.com> - 2015-01-22 11:38 +0800

csiph-web