Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 686464 - app-portage/mirrorselect-2.2.4 with python2 - mirrorselect: KeyError: '_Request__r_host'
Summary: app-portage/mirrorselect-2.2.4 with python2 - mirrorselect: KeyError: '_Reque...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-21 10:13 UTC by Sophie Hamilton
Modified: 2019-05-21 22:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sophie Hamilton 2019-05-21 10:13:54 UTC
Trying to run app-portage/mirrorselect-2.2.4 (currently keyworded ~amd64) requires python3 (or presumably newer). Attempting to run it with Python 2.7 fails with this error:

> ~/mirrorselect $ mirrorselect -s3 -b10 -D -o > mtest5
> * Using url: https://api.gentoo.org/mirrors/distfiles.xml
> * Downloading a list of mirrors...
>  Got 147 mirrors.
> * Downloading mirrorselect-test files from each mirror... [1 of 147]Traceback (most recent call last):
>   File "/usr/lib/python-exec/python2.7/mirrorselect", line 61, in <module>
>     MirrorSelect().main(sys.argv)
>   File "/usr/lib64/python2.7/site-packages/mirrorselect/main.py", line 380, in main
>     urls = self.select_urls(hosts, options)
>   File "/usr/lib64/python2.7/site-packages/mirrorselect/main.py", line 329, in select_urls
>     selector = Deep(hosts, options, self.output)
>   File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 229, in __init__
>     self.deeptest()
>   File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 256, in deeptest
>     mytime, ignore = self.deeptime(host, maxtime)
>   File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 341, in deeptime
>     ip, ips[ips.index(ip):])
>   File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 428, in _test_connection
>     f = url_open(r)
>   File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
>     return opener.open(url, data, timeout)
>   File "/usr/lib64/python2.7/urllib2.py", line 427, in open
>     req = meth(req)
>   File "/usr/lib64/python2.7/urllib2.py", line 1139, in do_request_
>     if request.has_proxy():
>   File "/usr/lib64/python2.7/urllib2.py", line 306, in has_proxy
>     return self.__r_host == self.__original
>   File "/usr/lib64/python2.7/urllib2.py", line 253, in __getattr__
>     return self.__dict__[attr]
> KeyError: '_Request__r_host'

I imagine this is due to bug 566778, which may have introduced some Python 2 incompatibility.
Comment 1 Larry the Git Cow gentoo-dev 2019-05-21 21:54:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd614c54ccb70d1f9ffa8e2869baa9636c3e6d28

commit fd614c54ccb70d1f9ffa8e2869baa9636c3e6d28
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-05-21 21:48:22 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-05-21 21:53:56 +0000

    app-portage/mirrorselect: drop python2.7 from PYTHON_COMPAT
    
    Support for python2.7 broke with the urllib2.Request.host usage
    introduced in this commit:
    
    https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=856abee86416d4b2159f81d34cf28ef3422b92ec
    
    Reported-by: Sophie Hamilton <gentoo-bugs@theblob.org>
    Closes: https://bugs.gentoo.org/686464
    Package-Manager: Portage-2.3.66, Repoman-2.3.12
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 app-portage/mirrorselect/mirrorselect-2.2.4.ebuild | 2 +-
 app-portage/mirrorselect/mirrorselect-9999.ebuild  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Comment 2 Larry the Git Cow gentoo-dev 2019-05-21 22:02:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51c5f6ff551b106f3eb5b953214b65aede658345

commit 51c5f6ff551b106f3eb5b953214b65aede658345
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-05-21 21:56:55 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-05-21 22:01:58 +0000

    app-portage/mirrorselect: revbump for bug 686464
    
    Bug: https://bugs.gentoo.org/686464
    Package-Manager: Portage-2.3.66, Repoman-2.3.12
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 .../{mirrorselect-2.2.4.ebuild => mirrorselect-2.2.4-r1.ebuild}           | 0
 1 file changed, 0 insertions(+), 0 deletions(-)