Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 293468 - app-portage/gentoolkit equery unicode characters
Summary: app-portage/gentoolkit equery unicode characters
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 237964
  Show dependency tree
 
Reported: 2009-11-17 08:30 UTC by Mario Bachmann
Modified: 2010-01-07 16:42 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 Mario Bachmann 2009-11-17 08:30:22 UTC
equery command do not like to print unicode characters.

Reproducible: Always

Steps to Reproduce:
1. equery files media-tv/linuxtv-dvb-apps

Actual Results:  
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 28: ordinal not in range(128)

Expected Results:  
it should show all the filenames. 

i changed something to fix it:
/usr/lib64/python2.6/site-packages/gentoolkit/pprinter.py

in
def print_info(lv, s, line_break = True):

old:
sys.stdout.write(s)

new:
s2 = unicode(s)
s3=s2.encode( "utf-8" )
sys.stdout.write(s3)

i do not know if it is the correct way to handle unicode without side effects.
Comment 1 Mario Bachmann 2009-11-17 08:32:33 UTC
the filename with the non-asci character:
/usr/share/dvb/dvb-t/fr-Alençon
Comment 2 Douglas Anderson 2009-11-19 02:45:47 UTC
Thanks for reporting this bug.

I believe this bug has been (inadvertently) fixed in my svn repo (should be in the portage tree in a few weeks).

$ equery f linuxtv-dvb-apps |grep fr-Alen
/usr/share/dvb/dvb-t/fr-Alen��on

It doesn't traceback, but I'm not sure if the squares are a result of my terminal settings or equery internals. If you'd like to test for yourself:

$ svn co http://genscripts.googlecode.com/svn/trunk/gentoolkit
$ export PYTHONPATH="$(pwd)/gentoolkit/pym:${PYTHONPATH}"
$ export PATH="$(pwd)/gentoolkit/bin:${PATH}"
$ equery f linuxtv-dvb-apps

Thanks.
Comment 3 Mario Bachmann 2009-11-20 10:28:54 UTC
I tried your commands yesterday, it works here. 
the output of /usr/share/dvb/dvb-t/fr-Alençon
was correct. 

i use "LANG=de_DE.UTF-8" locale and x11-terms/rxvt-unicode. 
It shows me all unicode character. But i had to install 
a lot of font packages too. 
Comment 4 Paul Varner (RETIRED) gentoo-dev 2010-01-07 16:42:22 UTC
Released in gentoolkit-0.3.0_rc8