Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 341293 - app-portage/gentoolkit-0.3.0_rc10-r1: glsa-check TypeError in write
Summary: app-portage/gentoolkit-0.3.0_rc10-r1: glsa-check TypeError in write
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 237964
  Show dependency tree
 
Reported: 2010-10-16 15:33 UTC by Dmitry Karasik
Modified: 2011-05-11 00:34 UTC (History)
1 user (show)

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


Attachments
Patch to avoid the type errors when sending the glsa-check mail (bug341293.patch,2.32 KB, patch)
2011-01-27 00:01 UTC, Andy Kittner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Karasik 2010-10-16 15:33:19 UTC
running /usr/bin/glsa-check -m affected on my system always results in:

Traceback (most recent call last):
  File "/usr/bin/glsa-check", line 384, in <module>
    myfd.write("GLSA Summary report for host %s\n" % socket.getfqdn())
  File "/usr/lib/python2.6/io.py", line 1515, in write
    s.__class__.__name__)
TypeError: can't write str to text stream
Comment 1 Dmitry Karasik 2010-10-16 15:34:02 UTC
emerge --info:

Portage 2.2_rc97 (default/linux/x86/10.0/desktop/kde, gcc-4.4.4, glibc-2.12.1-r1, 2.6.35-gentoo-r9 i686)
=================================================================
System uname: Linux-2.6.35-gentoo-r9-i686-Intel-R-_Xeon-TM-_CPU_3.06GHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 16 Oct 2010 14:30:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
Repositories: gentoo java-overlay ibm-internal
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/4.5/env /usr/kde/4.5/share/config /usr/kde/4.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /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 -march=native -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.arcticnetwork.ca/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_US"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O1,--hash-style=gnu,--sort-common,--as-needed"
LINGUAS="en en_US en_GB en_ZA ru he af am ar as as_IN az be be_BY bg bn bn_BD bn_IN bo br brx bs ca ca@valencia cs csb cy da de dgo dz el eo es es_AR es_CL es_ES es_MX et eu fa fi fo fr fy fy_NL ga ga_IE gl gu gu_IN hi hi_IN hne hr hsb hu hy id ia is it ja ka kk km kn kn_IN ko kok ks ku la lt lv mai mk ml ml_IN mn mni mr mr_IN ms mt nb nb_NO nds ne nl nn nn_NO no nr ns or or_IN oc pa pa_IN pl pt pt_BR pt_PT rm ro rw se sa_IN sat sd sh sh_YU si sk sl sq sr sr@Latn sr@ijekavian sr@ijekavianlatin sr@latin sr_CS ss st sv sv_SE sw sw_TZ ta ta_IN ta_LK te te_IN tg th ti_ER tl tn tr ts uk ur_IN uz uz@cyrillic ve vi wa xh zh zh_CN zh_TW zu"
MAKEOPTS="-j5"
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="/var/lib/layman/java-overlay /var/lib/layman/ibm-internal-cvs"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac acl acpi ads aio akode alsa ao aotuv ares async audiofile audit authdaemond avahi bash-completion bcp berkdb bidi bjam bluetooth bonjour bzip2 cairo caps captury cddb cdio cdparanoia cdr chm chroot cjk cli consolekit cracklib crypt cscope cups curl cvs cxx cyrillic dbus device-mapper dga disk-partition diskio djbfft dmi dmx dri dts dv dvd dvdnav dvdr dvdread dvipdfm ebook ecc edl eds elf emboss enca encode ethereal exif extra-tools faac faad fam fbcon ffmpeg fftw firefox flac fontconfig foomaticdb ftp gcj gcrypt gd gdbm geoip gif gimp gimpprint git glibc-omitfp glitz glut gmp gphoto2 gpm graphite gs gsm gstreamer gtk gtkhtml hal hdri history howl-compat iconv icq icu id3tag idea idn imagemagick imlib inotify irc jabber java5 java6 jce jpeg kde kdehiddenvisibility kdeprefix kipi kpathsea lame latex latex3 lcms ldap libedit libnl libnotify libproxy libsamplerate libssh2 live lm_sensors lmtp logrotate loop-aes lzma mad mailwrapper mbox mbx md5sum mdi mdnsresponder-compat meanwhile mfd-rewrites mikmod mmap mmx mmx2 mmxext mng modules motif mozdevelop mozilla moznocompose moznoirc moznomail mozsvg mp2 mp3 mp4 mpeg msn multiuser ncurses nemesi network network-cron new-login nfs nls nntp no-old-linux nocardbus nodrm nptl nptlonly nsplugin ntlm ntlm_unsupported_patch ogg ooo-kde openal opengl openmp openssl optimized-qmake oscar oss pam pango passwdqc pcap pcre pdf perl phonon png pnm pnp portaudio ppds pppd prediction print qt qt3support qt4 rar rdesktop rdp readline real reflection remote rtc samba sametime sasl scanner sdl sensord session sftplogging slp smbclient smi smp smux sndfile snmp socks5 sound spell srp srt sse sse2 ssl startup-notification subversion svg symlink sysfs syslog t1lib tcpd teletext templates tetex tga threads tidy tiff tools truetype unicode upnp usb utempter utils v4l2 vcd vidix vim vim-syntax vim-with-x vnc vorbis webdav webkit win32codecs winbind wmf x264 x86 xanim xattr xcb xcomposite xforms xft xine xinerama xml xorg xpm xrandr xscreensaver xulrunner xv xvid xvmc zeroconf zip zlib" ALSA_CARDS="intel8x0 pcsp loopback" ALSA_PCM_PLUGINS="copy linear route mulaw alaw adpcm rate plug multi shm file null empty share meter hooks lfloat ladspa dmix dshare dsnoop asym iec958 softvol extplug ioplug" APACHE2_MODULES="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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" 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 ubx" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US en_GB en_ZA ru he af am ar as as_IN az be be_BY bg bn bn_BD bn_IN bo br brx bs ca ca@valencia cs csb cy da de dgo dz el eo es es_AR es_CL es_ES es_MX et eu fa fi fo fr fy fy_NL ga ga_IE gl gu gu_IN hi hi_IN hne hr hsb hu hy id ia is it ja ka kk km kn kn_IN ko kok ks ku la lt lv mai mk ml ml_IN mn mni mr mr_IN ms mt nb nb_NO nds ne nl nn nn_NO no nr ns or or_IN oc pa pa_IN pl pt pt_BR pt_PT rm ro rw se sa_IN sat sd sh sh_YU si sk sl sq sr sr@Latn sr@ijekavian sr@ijekavianlatin sr@latin sr_CS ss st sv sv_SE sw sw_TZ ta ta_IN ta_LK te te_IN tg th ti_ER tl tn tr ts uk ur_IN uz uz@cyrillic ve vi wa xh zh zh_CN zh_TW zu" PHP_TARGETS="php-5.2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau nv nvidia fbdev vesa vga none" 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, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Christoph Mende (RETIRED) gentoo-dev 2011-01-23 09:33:59 UTC
Not sure if this is the same error, but on python 2.7 the same line causes an error because the string passed to myfd.write() is not a unicode string. Simply prefixing a u to the string fixes that, but produces the same error later in the source.

The workaround I'm using for now: glsa-check -mq affected works on python3 (you need -q because otherwise glsa-check would write byte streams to stdout which won't work).
Comment 3 Andy Kittner 2011-01-26 23:59:15 UTC
Oops, that looks like fallout from the 2to3 run I did for the addition of python3 support last year. A friend of mine told me about this issue and I immediately felt guilty... I have a patch that makes it work again with python2 and 3 for me, but code-wise I think it would be cleaner to have a variant of the summarylist()/GLSA.dump() functions which work with a passed in text stream instead of doing the encoding themself. That way we could work exclusively with unicode objects and avoid the ugly conversions to/from bytes. I might find some time to look into this on the weekend, but since I can't promise it I'll attach the quick patch I currently have, in case anyone is interrested.
Comment 4 Andy Kittner 2011-01-27 00:01:11 UTC
Created attachment 260820 [details, diff]
Patch to avoid the type errors when sending the glsa-check mail
Comment 5 Paul Varner (RETIRED) gentoo-dev 2011-01-28 17:29:57 UTC
Patch pushed to the git repo.
Comment 6 Paul Varner (RETIRED) gentoo-dev 2011-05-11 00:34:25 UTC
This was released in gentoolkit-0.3.0