| Summary: | =app-portage/mirrorselect-? with =dev-lang/python-3.2 - TypeError: 'module' object is not callable | ||
|---|---|---|---|
| Product: | Portage Development | Reporter: | ewomer <ewomer> |
| Component: | Tools | Assignee: | Portage Tools Team <tools-portage> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | alicef, andre, eandry, gentoo_bugs_peep, jdavid.ibp, Martin.vGagern, mike.desimone, mplichta, tomboy64, zerochaos |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | AMD64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
Fix url parse
Fix url parse (tested version) mirrorselect-9999.ebuild working ebuild for testing Fix url_parse for python3 My emerge --info mirrorselect-9999 emerge log mirrorselect-9999 build log 0003-Fix-url_parse.patch.out E-build for applying patch to 2.2.0.1 |
||
patch for make it work:
--- /usr/lib/python3.2/site-packages/mirrorselect/selectors.py_backup 2013-09-01 13:18:09.000000000 +0900
+++ /usr/lib/python3.2/site-packages/mirrorselect/selectors.py 2013-09-01 14:05:44.000000000 +0900
@@ -329,7 +329,7 @@ class Deep(object):
else:
url = url + '/distfiles/mirrorselect-test'
- url_parts = url_parse(url)
+ url_parts = url_parse.urlparse(url)
class TimeoutException(Exception):
pass
Greate, works now, just need to get the a patch to work nicely with the ebuld.
I created a new patch to get it to work but it fails.
***************************
=======================================
patching file mirrorselect/selectors.py
Hunk #1 FAILED at 329.
1 out of 1 hunk FAILED -- saving rejects to file mirrorselect/selectors.py.rej
patch program exited with status 1
=======================================
********************************
Here is the patch I used.
*******************************
diff -Napur a/mirrorselect/selectors.py b/mirrorselect/selectors.py
--- a/mirrorselect/selectors.py 2012-12-15 21:34:54.000000000 -0500
+++ b/mirrorselect/selectors.py 2013-09-01 01:33:49.531460407 -0400
@@ -329,7 +329,7 @@ class Deep(object):
else:
url = url + '/distfiles/mirrorselect-test'
- url_parts = url_parse(url)
+ url_parts = url_parse.urlparse(url)
class TimeoutException(Exception):
pass
**********************************
Here is the realavent section in the ebuild
*********************************************
python_prepare_all() {
python_export_best
epatch "${FILESDIR}/${PV}-Fix-url_parse.patch"
eprefixify setup.py mirrorselect/main.py
echo Now setting version... VERSION="${PVR}" "${PYTHON}" setup.py set_version
VERSION="${PVR}" "${PYTHON}" setup.py set_version || die "setup.py set_version failed"
}
*************************************
Please comment with the output of `emerge --info app-portage/mirrorselect` Also, as a side note, please attach patches in the future; thank you in advance. Created attachment 357548 [details, diff]
Fix url parse
Created attachment 357550 [details, diff]
Fix url parse (tested version)
Created attachment 357552 [details]
mirrorselect-9999.ebuild working ebuild for testing
please try new patch and ebuild and as TomWij said comment with the output of your `emerge --info app-portage/mirrorselect Created attachment 357574 [details, diff]
Fix url_parse for python3
This fixes it to work with any version of python (including python2).
Failed with git error.
----------------------------------------
* Package: app-portage/mirrorselect-9999
* Repository: starvald_emeralian
* USE: amd64 elibc_glibc kernel_linux multilib_abi_amd64 python_targets_python2_7 python_targets_python3_2 userland_GNU
* FEATURES: preserve-libs sandbox userpriv usersandbox
>>> ABI=amd64
>>> Unpacking source...
Cloning into bare repository '/home/distfiles/egit-src/mirrorselect.git'...
fatal: Unable to look up git.overlays.gentoo.org (port 9418) (Name or service not known)
* ERROR: app-portage/mirrorselect-9999::starvald_emeralian failed (unpack phase):
* git-2_initial_clone: can't fetch from git://git.overlays.gentoo.org/proj/mirrorselect.git
*
* Call stack:
* ebuild.sh, line 94: Called src_unpack
* environment, line 4264: Called git-2_src_unpack
* environment, line 2781: Called git-2_fetch
* environment, line 2582: Called git-2_initial_clone
* environment, line 2675: Called die
* The specific snippet of code:
* [[ -n ${EGIT_REPO_URI_SELECTED} ]] || die "${FUNCNAME}: can't fetch from ${EGIT_REPO_URI}"
*
* If you need support, post the output of `emerge --info '=app-portage/mirrorselect-9999::starvald_emeralian'`,
* the complete build log and the output of `emerge -pqv '=app-portage/mirrorselect-9999::starvald_emeralian'`.
* The complete build log is located at '/var/log/portage/app-portage:mirrorselect-9999:20130902-181648.log'.
* The ebuild environment file is located at '/var/tmp/portage/app-portage/mirrorselect-9999/temp/environment'.
* Working directory: '/var/tmp/portage/app-portage/mirrorselect-9999/work'
* S: '/var/tmp/portage/app-portage/mirrorselect-9999/work/mirrorselect-9999'
Created attachment 357698 [details]
My emerge --info
is still not working ? you tried again ?
>fatal: Unable to look up git.overlays.gentoo.org (port 9418) (Name or service >not known)
> * ERROR: app-portage/mirrorselect-9999::starvald_emeralian failed (unpack >phase):
> * git-2_initial_clone: can't fetch from >git://git.overlays.gentoo.org/proj/mirrorselect.git
From your build log looks like you cannot fetch git://git.overlays.gentoo.org/proj/mirrorselect.git because of network problem
@Zac Medico I tested your patch and is working in python 2.7 and 3.2 Created attachment 357782 [details]
mirrorselect-9999 emerge log
Yes it worked. I might need to check out my network. or is gentoo having issues?
(In reply to salamanderrake from comment #13) > Created attachment 357782 [details] > mirrorselect-9999 emerge log > > Yes it worked. I might need to check out my network. or is gentoo having > issues? It works for me too now. I think the server may have been down temporarily. fixed in vcs: http://git.overlays.gentoo.org/gitweb/?p=proj/mirrorselect.git;a=commit;h=e8bd46886261aca42917e0d627a0a49b337b02f5 available in mirrorselect-9999 now. Created attachment 364308 [details]
mirrorselect-9999 build log
This is the output for emerging mirrorselect-9999.
Created attachment 364310 [details]
0003-Fix-url_parse.patch.out
The failed patch .out file.
You don't need to patch the -9999 version. It contains teh fix already, that is why the patch failed. Clean out your modified -9999 ebuild and re-emerge. You were right, once I removed the mirrorselect from the local overlay it emerged without a hitch, thanks. I still have this issue with app-portage/mirrorselect-2.2.0.1 It happens both with python 3.2 and 3.3. Once I "eselect python set python2.7" it runs well. Note that I have enabled all three python implementations in make.conf. I'm seeing this bug, too, using app-portage/mirrorselect-2.2.0.1. /usr/bin/python currently points to Python 3.3.3 (latest stable). The patch posted 2013-09-01 by Zac Medico fixes the bug.
BTW, the current -9999 ebuild fails with:
---
# mirrorselect -D -s4 -b4
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.3/mirrorselect", line 58, in <module>
from mirrorselect.main import MirrorSelect
File "/usr/lib64/python3.3/site-packages/mirrorselect/main.py", line 42, in <module>
from mirrorselect.selectors import Deep, Shallow, Interactive
File "/usr/lib64/python3.3/site-packages/mirrorselect/selectors.py", line 405
except HTTPError, e:
^
SyntaxError: invalid syntax
*** Bug 499230 has been marked as a duplicate of this bug. *** Occurs on 3.3 and 3.4 as well Created attachment 380134 [details] E-build for applying patch to 2.2.0.1 I ran into this bug today. Setting aside all the "-9999" issues that are going back and forth above, I've attached a "-r1" ebuild that is a copy of the 2.2.0.1 (which is the stable ebuild right now for most arches), that applies zmedico's patch #357574 comment #8 from above. (It expects that patch to be named "files/mirrorselect-2.2.0.1-urlparse.patch".) It would be nice if this could get in and stabilized while the dependencies for 2.2.2/9999 are being worked on. This was fixed in 2.2.2: https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=e8bd46886261aca42917e0d627a0a49b337b02f5 |
Running mirror select with python 3.2 set for system in eselect fails with TypeError: 'module' object is not callable. ``` mirrorselect -s3 -b10 -o -D * Downloading a list of mirrors... Got 221 mirrors. * Downloading 100k files from each mirror... [1 of 221]Traceback (most recent call last): File "/usr/bin/mirrorselect-python3.2", line 61, in <module> MirrorSelect().main(sys.argv) File "/usr/lib64/python3.2/site-packages/mirrorselect/main.py", line 411, in main urls = self.select_urls(hosts, options) File "/usr/lib64/python3.2/site-packages/mirrorselect/main.py", line 374, in select_urls selector = Deep(hosts, options, self.output) File "/usr/lib64/python3.2/site-packages/mirrorselect/selectors.py", line 273, in __init__ self.deeptest() File "/usr/lib64/python3.2/site-packages/mirrorselect/selectors.py", line 293, in deeptest mytime, ignore = self.deeptime(host, maxtime) File "/usr/lib64/python3.2/site-packages/mirrorselect/selectors.py", line 332, in deeptime url_parts = url_parse(url) TypeError: 'module' object is not callable ``` Reproducible: Always Steps to Reproduce: 1.run mirrorselect with python3.2 2. 3. Actual Results: Fails with TypeError: 'module' object is not callable message Expected Results: mirrors tested and the best three choosen.