Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 367473 - app-portage/gentoolkit-0.3.0.2: eshowkw does not work with python3
Summary: app-portage/gentoolkit-0.3.0.2: eshowkw does not work with python3
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 06:35 UTC by Peter Volkov (RETIRED)
Modified: 2011-12-02 06:39 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 Peter Volkov (RETIRED) gentoo-dev 2011-05-16 06:35:05 UTC
With python3 as main interpreter eshowkw issues backtrace:

$ eshowkw 
Traceback (most recent call last):
  File "/usr/bin/eshowkw", line 7, in <module>
    from gentoolkit.eshowkw import main as emain
  File "/usr/lib64/python3.1/site-packages/gentoolkit/eshowkw/__init__.py", line 17, in <module>
    from .keywords_header import keywords_header
  File "/usr/lib64/python3.1/site-packages/gentoolkit/eshowkw/keywords_header.py", line 9, in <module>
    from display_pretty import colorize_string
ImportError: No module named display_pretty
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2011-05-16 07:47:04 UTC
hmm, changing the imports to .display_pretty for both keywords_header.py and keywords_content.py fix that error.  display_pretty also needs a change since izip_longest has been renamed to zip_longest.

diff --git a/pym/gentoolkit/eshowkw/display_pretty.py b/pym/gentoolkit/eshowkw/display_pretty.py
index 270a0eb..325235d 100644
@@ -3,7 +3,10 @@
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.output import colorize
-from itertools import izip_longest
+try: # newer python versions
+	from itertools import zip_longest
+except ImportError: # older python naming
+	from itertools import izip_longest as zip_longest
 
 __all__ = ['string_rotator', 'colorize_string', 'align_string', 'rotate_dash', 'print_content', 'display']
 
@@ -17,7 +20,7 @@ def display(plain_list, rotated_list, plain_width, rotated_height, cp, toplist =
 	if toplist != 'archlist':
 		corner_image.extend(plain_list)
 	data_printout = ['%s%s' % (x, y)
-		for x, y in izip_longest(corner_image, rotated_list, fillvalue=corner_image[0])]
+		for x, y in zip_longest(corner_image, rotated_list, fillvalue=corner_image[0])]
 	if toplist == 'archlist':
 		data_printout.extend(plain_list)
 	output.extend(data_printout)

But It did not produce any output for me.  No traceback, no output, but works in 2.6 & 2.7 for me with the changes

So, it needs more troubleshooting.
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2011-05-16 16:45:28 UTC
ok, py3 compatibility issues should be fixed in:

commit f5def123a156abc90841da2ade2601f06623010d

tested with py 2.6, 2.7, 3.2

There were a couple uses of map() which also needed to be changed due to the changes in py3.
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2011-12-02 06:39:54 UTC
this is fixed & released in >=gentoolkit-0.3.0.3