Created attachment 347762 [details] Output of emerge --info Steps to reproduce: eselect python set python3.2 esearch -e portage traceback (most recent call last): File "/usr/bin/esearch", line 5, in <module> main() File "/usr/lib/python3.2/site-packages/esearch/search.py", line 530, in main success = output_results(config, regexlist, found) File "/usr/lib/python3.2/site-packages/esearch/search.py", line 445, in output_results True, searchdef, "", config, data) File "/usr/lib/python3.2/site-packages/esearch/search.py", line 110, in searchEbuilds pkgs.sort(mypkgcmp) TypeError: must use keyword argument for key function esearch -e works correctly with python2.7
This should fix it for python-2.7 or greater: --- /usr/lib/python3.2/site-packages/esearch/search.py +++ /usr/lib/python3.2/site-packages/esearch/search.py @@ -9,6 +9,7 @@ from __future__ import print_function +import functools from getopt import getopt, GetoptError import sys from os import listdir, getenv, system @@ -107,7 +108,7 @@ data['defebuild'] = (searchdef, pkgs[-1][3]) if not portdir: config['found_in_overlay'] = True - pkgs.sort(mypkgcmp) + pkgs.sort(key=functools.cmp_to_key(mypkgcmp)) for pkg in pkgs: rev = "" if pkg[2] != "r0": Alternatively, there's a portage.util.cmp_sort_key function that can be used for compatibility with python-2.6.
(In reply to comment #1) The patch solved the problem. It now works with both python3.2 and 2.7 Thanks.
The fix has been committed to the git repository and can be tested with esearch-9999. https://github.com/fuzzyray/esearch/commit/3978f923ac814aef014cf412b63d11fd94f60692
This was fixed with esearch-1.3-r1