Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403681 - dev-python/pygit2-0.16.0 - UnicodeEncodeError: 'ascii' codec can't encode characters in position 19-20: ordinal not in range(128)
Summary: dev-python/pygit2-0.16.0 - UnicodeEncodeError: 'ascii' codec can't encode cha...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tim Harder
URL:
Whiteboard:
Keywords:
Depends on: 343721
Blocks:
  Show dependency tree
 
Reported: 2012-02-14 19:19 UTC by Francesco Riosa
Modified: 2013-03-15 08:04 UTC (History)
1 user (show)

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 Francesco Riosa 2012-02-14 19:19:13 UTC
it fail with python 3.2

* Installation of dev-python/pygit2-0.16.0 with CPython 3.2...
python3.2 setup.py build -b build-3.2 install --no-compile --root=/var/tmp/portage/dev-python/pygit2-0.16.0/temp/images/3.2
running build
running build_ext
running install
running install_lib
creating /var/tmp/portage/dev-python/pygit2-0.16.0/temp/images/3.2
creating /var/tmp/portage/dev-python/pygit2-0.16.0/temp/images/3.2/usr
creating /var/tmp/portage/dev-python/pygit2-0.16.0/temp/images/3.2/usr/lib64
creating /var/tmp/portage/dev-python/pygit2-0.16.0/temp/images/3.2/usr/lib64/python3.2
creating /var/tmp/portage/dev-python/pygit2-0.16.0/temp/images/3.2/usr/lib64/python3.2/site-packages
copying build-3.2/lib.linux-x86_64-3.2/pygit2.cpython-32.so -> /var/tmp/portage/dev-python/pygit2-0.16.0/temp/images/3.2/usr/lib64/python3.2/site-packages
warning: install_lib: byte-compiling is disabled, skipping.

running install_egg_info 
running egg_info
writing pygit2.egg-info/PKG-INFO
Traceback (most recent call last):
  File "setup.py", line 94, in <module>
    **kwargs
  File "/usr/lib64/python3.2/distutils/core.py", line 148, in setup
    dist.run_commands()  
  File "/usr/lib64/python3.2/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/lib64/python3.2/site-packages/setuptools/command/install.py", line 53, in run
    return _install.run(self)
  File "/usr/lib64/python3.2/distutils/command/install.py", line 581, in run
    self.run_command(cmd_name)
  File "/usr/lib64/python3.2/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib64/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/lib64/python3.2/site-packages/setuptools/command/install_egg_info.py", line 29, in run
    self.run_command('egg_info')
  File "/usr/lib64/python3.2/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib64/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/lib64/python3.2/site-packages/setuptools/command/egg_info.py", line 172, in run
    writer(self, ep.name, os.path.join(self.egg_info,ep.name))
  File "/usr/lib64/python3.2/site-packages/setuptools/command/egg_info.py", line 384, in write_pkg_info
    metadata.write_pkg_info(cmd.egg_info)
  File "/usr/lib64/python3.2/distutils/dist.py", line 1015, in write_pkg_info
    self.write_pkg_file(pkg_info)
  File "/usr/lib64/python3.2/distutils/dist.py", line 1031, in write_pkg_file
    file.write('Author: %s\n' % self.get_contact() )
UnicodeEncodeError: 'ascii' codec can't encode characters in position 19-20: ordinal not in range(128)
 * ERROR: dev-python/pygit2-0.16.0 failed (install phase):
 *   Installation failed with CPython 3.2 in distutils_installation() function
 *
 * Call stack:
 *     ebuild.sh, line   85:  Called src_install
 *   environment, line 3716:  Called distutils_src_install
 *   environment, line 1065:  Called python_execute_function 'distutils_installation'
 *   environment, line 2096:  Called die
 * The specific snippet of code:
 *                       die "${failure_message}";
 *
 * If you need support, post the output of 'emerge --info =dev-python/pygit2-0.16.0',
 * the complete build log and the output of 'emerge -pqv =dev-python/pygit2-0.16.0'.
 * The complete build log is located at '/var/log/portage/dev-python:pygit2-0.16.0:20120214-190028.log.gz'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/pygit2-0.16.0/temp/environment'.
 * S: '/var/tmp/portage/dev-python/pygit2-0.16.0/work/pygit2-0.16.0'

>>> Failed to emerge dev-python/pygit2-0.16.0, Log file:

>>>  '/var/log/portage/dev-python:pygit2-0.16.0:20120214-190028.log.gz'
Comment 1 Tim Harder gentoo-dev 2012-02-14 21:34:27 UTC
Doesn't fail here.

And please always post emerge --info and full build log for build failures as per the instructions in the error message.
Comment 2 Tim Harder gentoo-dev 2012-02-15 07:00:10 UTC
This appears to be a bug in python which doesn't properly handle the unicode characters in the author's name when it's installing the module under a non-unicode environment.

If you switch to using a unicode locale [1] it installs fine.

[1]: http://www.gentoo.org/doc/en/utf-8.xml
Comment 3 Francesco Riosa 2012-02-15 11:39:21 UTC
indeed setting an appropriated package.env for this ebuild does solve the problem.
Yet setuptools should be more smart, anyway I think the time has come for gentoo to set a unicode environment by default even if it mean arbitrarily chose en_US.UTF-8 and that's wrong in principle -> sending a mail to gentoo-dev about this
Comment 4 Mike Gilbert gentoo-dev 2012-03-23 14:38:02 UTC
Should be fixed in latest versions of python:3.1 and python:3.2.
Comment 5 Johan Bergström 2012-05-20 22:15:56 UTC
Cannot reproduce either. Close?
Comment 6 Francesco Riosa 2012-05-22 10:14:43 UTC
=dev-python/pygit2-0.16.0 build fine, now the problem is in 0.16.1

eselect python set python3.2
LC_ALL=C emerge -1 --buildpkgonly =dev-python/pygit2-0.16.1

x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common -Wl,--no-
copy-dt-needed-entries -Wl,--build-id -Wl,-flto -O2 -march=core2 -pipe -frecord-gcc-switches -mno-bmi2 -mno-avx2 -mno-lzcnt -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -msse4.1 --param l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=2048 -mtune=core2 -fgcse-after-reload -fpredictive-commoning -ftree-vectorize -funswitch-loops -fgraphite-identity -floop-block -floop-interchange -floop-strip-mine -flto --param=inline-unit-growth=5 -fmerge-all-constants -ggdb -gdwarf-4 -fvar-tracking-assignments -grecord-gcc-switches build-2.7/temp.linux-x86_64-2.7/pygit2.o -L/usr/local/lib -L/usr/lib64 -lgit2 -lz -lcrypto -lpython2.7 -o build-2.7/lib.linux-x86_64-2.7/pygit2.so
 * Building of dev-python/pygit2-0.16.1 with CPython 3.2...
python3.2 setup.py build -b build-3.2
Traceback (most recent call last):
  File "setup.py", line 87, in <module>
    long_description = readme.read()
  File "/usr/lib64/python3.2/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 6827: ordinal not in range(128)
 * ERROR: dev-python/pygit2-0.16.1 failed (compile phase):   
 *   Building failed with CPython 3.2 in distutils_building() function
 *
 * Call stack:
 *     ebuild.sh, line   85:  Called src_compile
 *   environment, line 3717:  Called distutils_src_compile   
 *   environment, line 1037:  Called python_execute_function 'distutils_building'
 *   environment, line 2102:  Called die
 * The specific snippet of code:
 *                       die "${failure_message}";
 *
 * If you need support, post the output of `emerge --info '=dev-python/pygit2-0.16.1'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/pygit2-0.16.1'`.
 * The complete build log is located at '/var/log/portage/build/dev-python/pygit2-0.16.1:20120522-101020.log.gz'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-python/pygit2-0.16.1/temp/build.log.gz'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/pygit2-0.16.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/pygit2-0.16.1/work/pygit2-0.16.1'
 * S: '/var/tmp/portage/dev-python/pygit2-0.16.1/work/pygit2-0.16.1'




Portage 2.2.0_alpha107 (default/linux/amd64/10.0/developer, gcc-4.7.0, glibc-2.15-r2, 3.3.0-vs2.3.3.1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.3.0-vs2.3.3.1-x86_64-Intel-R-_Core-TM-_i7-2600_CPU_@_3.40GHz-with-gentoo-2.1
Timestamp of tree: Tue, 22 May 2012 09:30:01 +0000
ccache version 3.1.7 [enabled]
app-shells/bash:          4.2_p28
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.2-r1
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.8-r2
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.9.3
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.5
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2, 4.6.2, 4.7.0::hardened-dev
sys-devel/gcc-config:     1.7.1
sys-devel/libtool:        1.5.26-r1, 2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.3 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo vivovl digikam kde x11 hardened-dev toolchain
Installed sets:
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"   
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -pipe -frecord-gcc-switches -mno-bmi2 -mno-avx2 -mno-lzcnt -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -msse4.1 --param l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=2048 -mtune=core2 -fgcse-after-reload -fpredictive-commoning -ftree-vectorize -funswitch-loops -fgraphite-identity -floop-block -floop-interchange -floop-strip-mine -flto --param=inline-unit-growth=5 -fmerge-all-constants -ggdb -gdwarf-4 -fvar-tracking-assignments -grecord-gcc-switches"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /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 -march=core2 -pipe -frecord-gcc-switches -mno-bmi2 -mno-avx2 -mno-lzcnt -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -msse4.1 --param l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=2048 -mtune=core2 -fgcse-after-reload -fpredictive-commoning -ftree-vectorize -funswitch-loops -fgraphite-identity -floop-block -floop-interchange -floop-strip-mine -flto --param=inline-unit-growth=5 -fmerge-all-constants -ggdb -gdwarf-4 -fvar-tracking-assignments -grecord-gcc-switches -fvisibility-inlines-hidden"
DISTDIR="/g/distfiles"
EMERGE_DEFAULT_OPTS="--ask-enter-invalid"
FEATURES="assume-digests binpkg-logs buildpkg ccache compress-build-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles installsources metadata-transfer multilib-strict news noinfo parallel-fetch parse-eapi-ebuild-head sandbox sfperms sign split-elog split-log splitdebug strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox xattr"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.netcologne.de/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://mirror.switch.ch/ftp/mirror/gentoo/ http://gentoo.lagis.at/ http://mirror.qubenet.net/mirror/gentoo/"
INSTALL_MASK=" /usr/lib64/libogrove.la /usr/lib64/libospgrove.la /usr/lib64/libostyle.la /usr/lib64/vlc/plugins/codec/libdirac_plugin.la /usr/lib64/vlc/plugins/demux/libdirac_plugin.la /usr/lib64/mysql/plugin/*.la "
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common -Wl,--no-copy-dt-needed-entries -Wl,--build-id -Wl,-flto"
LINGUAS="it"
MAKEOPTS="-j4"
PKGDIR="/g/packages" 
PORTAGE_COMPRESS="lzma"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/g/portage" 
PORTDIR_OVERLAY="/g/ovl/tmp /g/ovl/digikam /g/ovl/kde /g/ovl/x11 /g/ovl/hardened-dev /g/ovl/toolchain"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dmouse X a52 aac acl acpi akonadi alsa amd64 amr apache2 apm asf attica automount avahi avi bash-completion berkdb bitmap-fonts bluetooth browserplugin bzip2 cairo caps captury cdda cddb cdr chm cli cmake compositor consolekit cpudetection cracklib crypt cups curl cxx cycles dbus decibel declarative dedicated device-mapper djvu dri dts dvd dvdr dvdread emboss encode engines erandom exif exiv2 extrafilters fam fame ffmpeg firefox flac foomaticdb fortran frei0r g3dvl gallium gdbm geos gif gles2 glitz gpm gstreamer gtk gtk2 hal hdf hdf5 hpijs hpn htmlhandbook iconv idn imagemagick imlib iproute2 ipv6 ithreads jack java jemalloc jingle jpeg justify kde kdeenablefinal kdehiddenvisibility kdepim kipi kontact latex lcms ldap lensfun libg++ libnotify libwww lua lzma lzo mad messenger mikmod mjpeg mng modules motif mp3 mp4 mpeg mplayer mudflap multilib mysql ncurses nepomuk network-cron new-hpcups newxkb nls nptl odbc ogdi ogg opencl openexr opengl openmp osmesa pam pam_chroot pango pcre pdf perl plasma plugins png policykit ppds pppd prison private-headers pulseaudio python qt qt3support qt4 quicktime radeon raster rdesktop readline realtime reiserfs samba sasl scanner schroedinger screen sdl semantic-desktop server session skey slang smp snmp social-desktop spell sqlite3 sse sse2 sse3 sse4_1 ssl ssse3 startup-notification static static-libs svg system-sqlite taglib tcltk tcpd telepathy theora threads tiff tls truetype truetype-fonts ucs2 udev udisks unicode upower urandom usb userlocales utempter utils v4l v4l2 valgrind vdpau vnc vorbis wayland webkit wxwidgets x264 xattr xcb xcomposite xinerama xml xorg xulrunner xv xvid xvmc zeroconf 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 reqtimeout" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="karbon krita flow sheets" CAMERAS="ptp2 directory canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="bootchart btrfs crypt dmsquash-live mdraid syslog uswsusp biosdevname caps ssh-client" ELIBC="glibc" FFTOOLS="aviocat cws2fws ffeval ismindex pktdumper" 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 ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="keyboard mouse evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="it" PHP_TARGETS="php5-3 php5-4" PYTHON_TARGETS="python3_2 python2_7" QEMU_SOFTMMU_TARGETS="arm x86_64" QEMU_USER_TARGETS="arm x86_64" RUBY_TARGETS="ruby18 ruby19" SANE_BACKENDS="hp4200 net ricoh" USERLAND="GNU" VIDEO_CARDS="nouveau radeon r300 r600 r700 r800 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:  CPPFLAGS, CTARGET, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

dev-python/pygit2-0.16.1 was built with the following:
USE="(multilib) test"
Comment 7 Francesco Riosa 2012-05-22 10:16:14 UTC
please ignore previous comment, still needed to upgrade python:

[ebuild     U  ] dev-lang/python-3.2.3-r1 [3.2.2-r1]