Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 282269 - sys-apps/portage-2.2_rc39 fails with UnicodeEncodeError when there's overlay with non ASCII char in it's path
Summary: sys-apps/portage-2.2_rc39 fails with UnicodeEncodeError when there's overlay ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks:
 
Reported: 2009-08-22 07:12 UTC by Ctibor Brančík
Modified: 2010-04-01 11:36 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
avoid str() calls with overlay paths (overlay_unicode.patch,2.29 KB, patch)
2009-08-22 07:56 UTC, Zac Medico
Details | Diff
avoid UnicodeEncodeError shown in comment #2 (xtermTitle.patch,517 bytes, patch)
2009-08-22 19:31 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ctibor Brančík 2009-08-22 07:12:56 UTC
I have custom overlay in my HOMEDIR which has non ASCII chars in it's path (see emerge --info). When enabled portage spits out error: 

Calculating dependencies /Traceback (most recent call last):
  File "/usr/bin/emerge", line 40, in <module>              
    retval = emerge_main()                                  
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1412, in emerge_main
    myopts, myaction, myfiles, spinner)                                   
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 300, in action_build
    settings, trees, myopts, myparams, myaction, myfiles, spinner)           
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 4986, in backtrack_depgraph
    runtime_pkg_mask=runtime_pkg_mask)                                               
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 259, in __init__           
    allow_backtracking, runtime_pkg_mask)                                            
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 177, in __init__           
    vardb.aux_get(pkg.cpv, [])                                                       
  File "/usr/lib64/portage/pym/_emerge/FakeVartree.py", line 115, in _aux_get_wrapper
    self._portdb.aux_get(pkg, self._portdb_keys)))                                   
  File "/usr/lib64/portage/pym/portage/dbapi/porttree.py", line 615, in aux_get      
    writemsg(_("Generating cache entry(0) for: ")+str(myebuild)+"\n", 1)             
UnicodeEncodeError: 'ascii' codec can't encode characters in position 15-16: ordinal not in range(128)

emerge --info:

Portage 2.2_rc39 (default/linux/amd64/2008.0/desktop, gcc-4.1.2, glibc-2.9_p20081201-r2, 2.6.29-tuxonice-r2 x86_64)
=================================================================                                                  
System uname: Linux-2.6.29-tuxonice-r2-x86_64-Mobile_AMD_Sempron-tm-_Processor_3500+-with-gentoo-2.0.0             
Timestamp of tree: Sat, 22 Aug 2009 06:30:01 +0000                                                                 
distcc 3.1 x86_64-pc-linux-gnu [disabled]                                                                          
ccache version 2.4 [enabled]                                                                                       
app-shells/bash:     3.2_p39                                                                                       
dev-java/java-config: 1.3.7-r1, 2.1.8-r1                                                                           
dev-lang/python:     2.5.4-r2, 2.6.2-r1                                                                            
dev-util/ccache:     2.4-r7                                                                                        
dev-util/cmake:      2.6.4                                                                                         
sys-apps/baselayout: 2.0.0                                                                                         
sys-apps/openrc:     0.4.3-r3                                                                                      
sys-apps/sandbox:    1.6-r2                                                                                        
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=k8 -msse3 -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/initng/daemon /etc/initng/net /etc/initng/service /etc/initng/system /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -march=k8 -msse3 -ggdb"
DISTDIR="/mnt/server/ctibor/portage/distfiles/"
FEATURES="assume-digests buildpkg ccache distlocks fixpackages metadata-transfer parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans usepkg userfetch"
GENTOO_MIRRORS="http://gentoo.mirror.dkm.cz/pub/gentoo/ http://gentoo.mneisen.org/ http://mirror.jamit.de/gentoo/"
LC_ALL="cs_CZ.UTF8"
LDFLAGS="-Wl,-O1"
LINGUAS="cs"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/oss-overlay /usr/portage/local /home/ctibor/počítač/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 7zip X a52 aac aalib acl acpi aiglx alsa amd64 apache2 aspell avahi avi berkdb bitmap-fonts bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups dbus debug dga dirac djvu docbook dri dts dvd dvdr dvdread eds emboss encode evo exif exiv2 fam ffmpeg firefox flac foomaticdb fortran gdbm gif gphoto2 gpm gtk hal htmlhandbook iconv icq id3tag ieee1394 imagemagick imlib ipv6 irc isdnlog jabber jack jingle jpeg kde kerberos ladspa lash lcms ldap libnotify mad midi mikmod mmx mp3 mp4 mpeg mudflap multilib musicbrainz ncurses nepomuk networkmanager nls nptl nptlonly offensive ogg openexr opengl openmp oss oss4 pam pcmcia pcre pda pdf perl plasma png policykit portaudio ppds pppd python qt qt3 qt3support qt4 quicktime rdesktop readline reflection samba sasl sdl session speex spell spl sse sse2 ssl ssse3 startup-notification svg sysfs tcpd telepathy theora threads tiff truetype truetype-fonts type1-fonts unicode usb v4l v4l2 vorbis wifi x264 xcomposite xinerama xml xorg xscreensaver xulrunner xv xvid zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" FOO2ZJS_DEVICES="km2300" INITNG_PLUGINS="also bash_launcher chdir chroot conflict cpout critical ctrlaltdel daemon_clean debug_commands envparser find fmon fstat history idleprobe initctl interactive iparser last limit lockfile logfile netdev netprobe ngc4 ngcs nge pause provide reload renice rlparser simple_launcher stcmd stdout suid syncron syslog sysreq unneeded usplash" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="cs" SANE_BACKENDS="gt68xx pixma plustek artec_eplus48u" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Reproducible: Always

Steps to Reproduce:
1. Create overlay with nonASCII char(s) in the path
2. Enable it in make.conf
3. Execute emerge

Actual Results:  
Portage ends with UnicodeEncodeError.

Expected Results:  
Emerge should create dep graph, install software etc.
Comment 1 Zac Medico gentoo-dev 2009-08-22 07:56:03 UTC
Created attachment 201914 [details, diff]
avoid str() calls with overlay paths

If this patch is saved as /tmp/overlay_unicode.patch, then it can be applied as follows:

 cd /usr/lib/portage
 patch -p0 < /tmp/overlay_unicode.patch
Comment 2 Ctibor Brančík 2009-08-22 09:21:44 UTC
Patch worked. However at the end of the merge portage gives another error:

====================================
Error in portage.process.run_exitfuncs

  File "/usr/lib64/portage/pym/portage/process.py", line 113, in run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1318, in emergeexit
    xtermTitleReset()
  File "/usr/lib64/portage/pym/portage/output.py", line 286, in xtermTitleReset
    xtermTitle(default_xterm_title, raw=True)
  File "/usr/lib64/portage/pym/portage/output.py", line 255, in xtermTitle
    sys.stderr.write(mystr)
'ascii' codec can't encode characters in position 25-26: ordinal not in range(128)
====================================

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/portage/process.py", line 113, in run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1318, in emergeexit
    xtermTitleReset()
  File "/usr/lib64/portage/pym/portage/output.py", line 286, in xtermTitleReset
    xtermTitle(default_xterm_title, raw=True)
  File "/usr/lib64/portage/pym/portage/output.py", line 255, in xtermTitle
    sys.stderr.write(mystr)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 25-26: ordinal not in range(128)
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/portage/process.py", line 113, in run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1318, in emergeexit
    xtermTitleReset()
  File "/usr/lib64/portage/pym/portage/output.py", line 286, in xtermTitleReset
    xtermTitle(default_xterm_title, raw=True)
  File "/usr/lib64/portage/pym/portage/output.py", line 255, in xtermTitle
    sys.stderr.write(mystr)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 25-26: ordinal not in range(128)

This does not affected installation of packages as far as I can say. Only the error prints in the end of emerge process.
Comment 3 Mounir Lamouri (volkmar) (RETIRED) gentoo-dev 2009-08-22 13:29:07 UTC
*** Bug 282306 has been marked as a duplicate of this bug. ***
Comment 4 Zac Medico gentoo-dev 2009-08-22 19:31:29 UTC
Created attachment 201956 [details, diff]
avoid UnicodeEncodeError shown in comment #2

(In reply to comment #2)
If this patch is saved as /tmp/xtermTitle.patch, then it can be applied as follows:

  patch /usr/lib/portage/pym/portage/output.py /tmp/xtermTitle.patch
Comment 5 Ctibor Brančík 2009-08-22 22:39:38 UTC
Seems to be working in my case. Thank you for quick fix!
Comment 6 Zac Medico gentoo-dev 2009-08-24 06:29:27 UTC
This is fixed in 2.2_rc40.
Comment 7 Navid Zamani 2009-09-05 06:29:55 UTC
(In reply to comment #6)
> This is fixed in 2.2_rc40.

No, its not. I’m running 2.2_rc40 here, and I just got it right now, while running an »emerge --regen« inside an »eix-sync«. :/

Also, these patches are no real solutions. It's still a problem related to sqlite.
Comment 8 Zac Medico gentoo-dev 2009-09-05 06:48:26 UTC
(In reply to comment #7)
That sounds like bug #283223.
Comment 9 Navid Zamani 2009-09-05 07:22:54 UTC
(In reply to comment #8)
Thanks. I thought they had a common cause.