Whenever running equery uses, regardless of argument, I get the following error: $ equery uses portage Traceback (most recent call last): File "/usr/lib/python-exec/python3.4/equery", line 38, in <module> equery.main(sys.argv) File "/usr/lib64/python3.4/site-packages/gentoolkit/equery/__init__.py", line 357, in main loaded_module.main(module_args) File "/usr/lib64/python3.4/site-packages/gentoolkit/equery/uses.py", line 297, in main global_usedesc = get_global_useflags() File "/usr/lib64/python3.4/site-packages/gentoolkit/equery/uses.py", line 159, in get_global_useflags for line in open_file: File "/usr/lib64/python3.4/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2716: ordinal not in range(128) $ I have figured out it is because the profiles/desc/linguas.desc is UTF-8 and not ASCII as all other desc files and that my locale of choice is C. $ file /usr/portage/profiles/desc/* <snip> /usr/portage/profiles/desc/input_devices.desc: ASCII text /usr/portage/profiles/desc/kernel.desc: ASCII text /usr/portage/profiles/desc/lcd_devices.desc: ASCII text /usr/portage/profiles/desc/libreoffice_extensions.desc: ASCII text /usr/portage/profiles/desc/linguas.desc: UTF-8 Unicode text /usr/portage/profiles/desc/lirc_devices.desc: ASCII text /usr/portage/profiles/desc/monkeyd_plugins.desc: ASCII text /usr/portage/profiles/desc/netbeans_modules.desc: ASCII text <snip> $ eselect locale list Available targets for the LANG variable: [1] C * [2] POSIX [3] en_GB [4] en_GB.iso88591 [5] en_GB.utf8 [6] sv_SE [7] sv_SE.iso88591 [8] sv_SE.utf8 [9] swedish [ ] (free form) $ $ emerge -pv gentoolkit These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] app-portage/gentoolkit-0.3.0.9-r2::gentoo PYTHON_TARGETS="python2_7 python3_4 -pypy -python3_3" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB $ Reproducible: Always
$ emerge --info '=app-portage/gentoolkit-0.3.0.9-r2' Portage 2.2.24 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.3, glibc-2.22-r1, 4.1.5-rt-rt5 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-4.1.5-rt-rt5-x86_64-AMD_Athlon-tm-_II_X4_640_Processor-with-gentoo-2.2 KiB Mem: 8177084 total, 3947036 free KiB Swap: 2097148 total, 2097148 free Timestamp of repository gentoo: Sun, 22 Nov 2015 18:12:05 +0000 sh bash 4.3_p42 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1 distcc 3.2rc1 x86_64-pc-linux-gnu [disabled] app-shells/bash: 4.3_p42::gentoo dev-java/java-config: 2.2.0::gentoo dev-lang/perl: 5.22.0::gentoo dev-lang/python: 2.7.10-r2::gentoo, 3.4.3-r2::gentoo, 3.5.0-r1::gentoo dev-util/cmake: 3.4.0::gentoo dev-util/pkgconfig: 0.29::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.18.3::gentoo sys-apps/sandbox: 2.9::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r1::gentoo sys-devel/automake: 1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo sys-devel/binutils: 2.25.1-r1::gentoo sys-devel/gcc: 4.9.3::gentoo, 5.2.0::gentoo sys-devel/gcc-config: 1.8::gentoo sys-devel/libtool: 2.4.6-r1::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers) sys-libs/glibc: 2.22-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: git sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 crossdev location: /usr/crossdev masters: gentoo priority: 0 lilrc location: /home/kalle/lilrc-overlay masters: gentoo priority: 1 proaudio location: /home/kalle/proaudio masters: gentoo priority: 2 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE @MISC-FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -O2 -fomit-frame-pointer -pipe -fno-stack-protector -march=amdfam10" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -pipe -O2 -fomit-frame-pointer -pipe -fno-stack-protector -march=amdfam10" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS=" --binpkg-changed-deps=y --binpkg-respect-use=y --buildpkg-exclude app-admin/lilrc-update --buildpkg-exclude app-emulation/virtualbox-modules --buildpkg-exclude sys-fs/vhba --buildpkg-exclude sys-kernel/* --buildpkg-exclude virtual/*" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs buildpkg buildsyspkg config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news noinfo parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org http://ftp.df.lth.se/pub/gentoo/ rsync://ftp.df.lth.se/pub/gentoo/ http://mirror.mdfnet.se/gentoo" INSTALL_MASK="/etc/systemd /usr/lib/systemd" LANG="C" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" USE="X a52 aac alloca alsa amd64 aspell cairo cd cdda cddb cdr consolekit cracklib crypt cups curl djvu dri drm dssi dvd dvdr dvi exif ffmpeg fftw flac fltk gallium gif gimp glib gmp gnuplot gnutls gstreamer gtk gtk2 gtkstyle gudev hwdb imap inotify jack javascript jit jpeg keymap ladspa lame libkms libnotify libsamplerate lv2 mad matplotlib mp3 mpeg netifrc nptl octave ogg opengl openmp openrc orc pam pdf png postscript qt4 qt5 readline sndfile spell ssl startup-notification subversion svg svn theora threads thunar tiff truetype udev udisks unicode usb v4l vaapi vdpau vlc vorbis webgl x264 xcb xcomposite xinerama xorg xscreensaver zlib" ABI_X86="64" ALSA_CARDS="hda-intel" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext sse sse2 sse3 sse4_1" CURL_SSL="gnutls" ELIBC="glibc" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LINGUAS="en en_GB" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby22" SANE_BACKENDS="xerox_mfp" USERLAND="GNU" VIDEO_CARDS="nouveau" Unset: CC, CPPFLAGS, CTARGET, CXX, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON ================================================================= Package Settings ================================================================= app-portage/gentoolkit-0.3.0.9-r2::gentoo was built with the following: USE="" ABI_X86="64" PYTHON_TARGETS="python2_7 python3_4 -pypy -python3_3"
The quick workaround for this is to set LC_CTYPE to a UTF-8 encoding. In the meantime, the best fix for this is to scrub the entire gentoolkit codebase and implement consistent Unicode encoding/decoding similar ro what portage does.
The fix has been committed to the gentoolkit repository. https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=c9a117bebeb04efcb731e47a12e79c4c8d065896
I can confirm this error, though reason is unclear Two machines sharing the same '/usr/portage' tree. One works fine with POSIX locale setting, the other one shows exactly the same error as stated Error disappears, when locale ist set to an UTF-8 variant ~ $ equery l python * Searching for python ... [IP-] [ ] dev-lang/python-2.7.10-r1:2.7 [IP-] [ ] dev-lang/python-3.3.5-r1:3.3 [IP-] [ ] dev-lang/python-3.4.3:3.4 ~ $ equery l gentoolkit * Searching for gentoolkit ... [IP-] [ ] app-portage/gentoolkit-0.3.0.9-r2:0 Output is identical on both boxes
(In reply to Malte Lundberg from comment #4) > I can confirm this error, though reason is unclear > Two machines sharing the same '/usr/portage' tree. One works fine with POSIX > locale setting, the other one shows exactly the same error as stated > > Error disappears, when locale ist set to an UTF-8 variant > > ~ $ equery l python > * Searching for python ... > [IP-] [ ] dev-lang/python-2.7.10-r1:2.7 > [IP-] [ ] dev-lang/python-3.3.5-r1:3.3 > [IP-] [ ] dev-lang/python-3.4.3:3.4 > > ~ $ equery l gentoolkit > * Searching for gentoolkit ... > [IP-] [ ] app-portage/gentoolkit-0.3.0.9-r2:0 > > Output is identical on both boxes Which version of python are you running on the boxes in question? You will get different results depending on if you are using python2 or python3. Also the recently released gentoolkit-0.3.1 still has some unicode issues under the POSIX or C locales. Until I finish hunting all of the bugs down, the best workaround is to set LC_CTYPE to a UTF-8 locale.
Hello, I've got the same problem and I'm using python3.
Only affects Python 3.4: ~ # eselect locale list Available targets for the LANG variable: [1] C [2] POSIX [3] en_GB.utf8 * [4] en_US.utf8 [ ] (free form) ~ # eselect python list Available Python interpreters: [1] python2.7 * [2] python3.3 [3] python3.4 ~ # for v in 2.7 3.3 3.4 ; do python${v} -c "import sys; print(sys.getdefaultencoding())" ; done ascii utf-8 utf-8 ~ # eselect python set 1 ~ # equery u app-misc/screen [ Legend : U - final flag setting for installation] [ : I - package is installed with flag ] [ Colors : set, unset ] * Found these USE flags for app-misc/screen-4.3.1-r1: U I - - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces - - multiuser : Enable multiuser support (by setting correct permissions) - - nethack : Express error messages in nethack style + + pam : Add support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip ~ # eselect python set 2 ~ # equery u app-misc/screen [ Legend : U - final flag setting for installation] [ : I - package is installed with flag ] [ Colors : set, unset ] * Found these USE flags for app-misc/screen-4.3.1-r1: U I - - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces - - multiuser : Enable multiuser support (by setting correct permissions) - - nethack : Express error messages in nethack style + + pam : Add support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip ~ # eselect python set 3 ~ # equery u app-misc/screen Traceback (most recent call last): File "/usr/lib/python-exec/python3.4/equery", line 38, in <module> equery.main(sys.argv) File "/usr/lib64/python3.4/site-packages/gentoolkit/equery/__init__.py", line 357, in main loaded_module.main(module_args) File "/usr/lib64/python3.4/site-packages/gentoolkit/equery/uses.py", line 297, in main global_usedesc = get_global_useflags() File "/usr/lib64/python3.4/site-packages/gentoolkit/equery/uses.py", line 159, in get_global_useflags for line in open_file: File "/usr/lib64/python3.4/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2716: ordinal not in range(128)
Just cropped up for me trying to check flags on the latest Firefox (48.0): Traceback (most recent call last): File "/usr/lib/python-exec/python2.7/equery", line 38, in <module> equery.main(sys.argv) File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/__init__.py", line 357, in main loaded_module.main(module_args) File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/uses.py", line 309, in main display_useflags(output) File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/uses.py", line 117, in display_useflags desc = twrap.fill(desc) File "/usr/lib64/python2.7/textwrap.py", line 338, in fill return "\n".join(self.wrap(text)) File "/usr/lib64/python2.7/textwrap.py", line 329, in wrap return self._wrap_chunks(chunks) File "/usr/lib64/python2.7/site-packages/gentoolkit/textwrap_.py", line 95, in _wrap_chunks lines.append(indent + ''.join(cur_line)) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 14: ordinal not in range(128)
Portage 2.2.28 (python 2.7.10-final-0, default/linux/amd64/13.0, gcc-4.9.3, glibc-2.22-r4, 4.4.15-gentoo x86_64) ================================================================= System uname: Linux-4.4.15-gentoo-x86_64-Intel-R-_Core-TM-_i5-2540M_CPU_@_2.60GHz-with-gentoo-2.2 KiB Mem: 8126180 total, 4382004 free KiB Swap: 8388604 total, 8333180 free Timestamp of repository gentoo: Fri, 05 Aug 2016 13:23:53 +0000 sh bash 4.3_p42-r1 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1 app-shells/bash: 4.3_p42-r1::gentoo dev-java/java-config: 2.2.0-r3::gentoo dev-lang/perl: 5.20.2::gentoo dev-lang/python: 2.7.10-r1::gentoo, 3.4.3-r1::gentoo dev-util/cmake: 3.3.1-r1::gentoo dev-util/pkgconfig: 0.28-r2::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.19.1::gentoo sys-apps/sandbox: 2.10-r1::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69::gentoo sys-devel/automake: 1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo sys-devel/binutils: 2.25.1-r1::gentoo sys-devel/gcc: 4.9.3::gentoo sys-devel/gcc-config: 1.7.3::gentoo sys-devel/libtool: 2.4.6::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers) sys-libs/glibc: 2.22-r4::gentoo Repositories: gentoo location: /usr/portage sync-type: git sync-uri: git://gentoo.danweeks.net/portage priority: -1000 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.danweeks.net/gentoo" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="acl amd64 berkdb bzip2 caps cli cracklib crypt cxx dri fortran gdbm glibc-omitfp gmp iconv ipv6 logrotate mmx mmxext modules multilib ncurses nls nptl nptl-only openmp pam pcre readline seccomp session smp sse sse2 ssl syslog tcpd threads unicode xattr zlib" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="i965 intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
These problems should be fixed in gentoolkit-0.3.2-r1 We have a stable request open under bug 590170
Created attachment 453958 [details] gentoolkit.log
Created attachment 453960 [details, diff] gentoolkit-textwrap.patch I faced same issue and fixed it. Please refer attached patch file.
Confirmed upgrading to app-portage/gentoolkit-0.3.2-r1 resolves this issue.
This should be fixed.