Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 292528 - sys-apps/portage-2.2_rc49 and 2.1.7.4 TypeError: can't use a string pattern on a bytes-like object
Summary: sys-apps/portage-2.2_rc49 and 2.1.7.4 TypeError: can't use a string pattern o...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 292724 (view as bug list)
Depends on:
Blocks: 288499
  Show dependency tree
 
Reported: 2009-11-09 14:30 UTC by Darren Dale
Modified: 2009-11-16 01:18 UTC (History)
1 user (show)

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


Attachments
use fix suggested in bugs.python.org/issue4403#msg76425 (email_typeerror.patch,1.34 KB, patch)
2009-11-11 06:48 UTC, Zac Medico
Details | Diff
use fix suggested in bugs.python.org/issue4403#msg76425 (email_typeerror.patch,1.35 KB, patch)
2009-11-11 06:51 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Dale 2009-11-09 14:30:24 UTC
This morning I upgraded to portage-2.2_rc49. I had the python3 USE flag enabled. Now I am unable to merge some packages, including portage itself:

$ sudo emerge portage
[...]
>>> Installing (1 of 1) sys-apps/portage-2.2_rc49
 * Cleaning orphaned Python bytecode from /usr/lib64/portage/pym ..
 * Byte compiling python modules for python-2.6 .. ...                              [ ok ]
 *                                                                                        
 * For help with using portage please consult the Gentoo Handbook                         
 * at http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3                       
 *                                                                                        
 * If you always want to use the latest development version of portage                    
 * please read http://www.gentoo.org/proj/en/portage/doc/testing.xml                      
 *                                                                                        
Traceback (most recent call last):                                                        
  File "/usr/bin/emerge", line 42, in <module>                                            
    retval = emerge_main()                                                                
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1529, in emerge_main                
    myopts, myaction, myfiles, spinner)                                                   
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 428, in action_build             
    retval = mergetask.merge()                                                            
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 841, in merge                  
    rval = self._merge()                                                                  
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1149, in _merge                
    self._main_loop()                                                                     
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1296, in _main_loop            
    self._poll_loop()                                                                     
  File "/usr/lib64/portage/pym/_emerge/PollScheduler.py", line 134, in _poll_loop         
    handler(f, event)                                                                     
  File "/usr/lib64/portage/pym/_emerge/SpawnProcess.py", line 192, in _output_handler     
    self._unregister_if_appropriate(event)                                                
  File "/usr/lib64/portage/pym/_emerge/AbstractPollTask.py", line 27, in _unregister_if_appropriate                                                                                 
    self.wait()                                                                           
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 42, in wait             
    self._wait_hook()                                                                     
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 115, in _wait_hook      
    self._exit_listener_stack.pop()(self)                                                 
  File "/usr/lib64/portage/pym/_emerge/EbuildPhase.py", line 94, in _post_phase_exit      
    self.wait()                                                                           
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 42, in wait             
    self._wait_hook()                                                                     
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 115, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib64/portage/pym/_emerge/TaskSequence.py", line 44, in _task_exit_handler
    self.wait()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 42, in wait
    self._wait_hook()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 115, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib64/portage/pym/_emerge/CompositeTask.py", line 106, in _default_final_exit
    return self.wait()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 42, in wait
    self._wait_hook()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 115, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib64/portage/pym/_emerge/EbuildBuild.py", line 180, in _build_exit
    self.wait()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 42, in wait
    self._wait_hook()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 115, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib64/portage/pym/_emerge/CompositeTask.py", line 106, in _default_final_exit
    return self.wait()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 42, in wait
    self._wait_hook()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 115, in _wait_hook
    self._exit_listener_stack.pop()(self)
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1128, in _build_exit
    self._schedule()
  File "/usr/lib64/portage/pym/_emerge/PollScheduler.py", line 43, in _schedule
    return self._schedule_tasks()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1318, in _schedule_tasks
    if q.schedule():
  File "/usr/lib64/portage/pym/_emerge/SequentialTaskQueue.py", line 56, in schedule
    task.start()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 24, in start
    self._start()
  File "/usr/lib64/portage/pym/_emerge/PackageMerge.py", line 44, in _start
    self.returncode = self.merge.merge()
  File "/usr/lib64/portage/pym/_emerge/MergeListItem.py", line 148, in merge
    retval = self._install_task.install()
  File "/usr/lib64/portage/pym/_emerge/EbuildBuild.py", line 271, in install
    rval = merge.execute()
  File "/usr/lib64/portage/pym/_emerge/EbuildMerge.py", line 27, in execute
    blockers=self.find_blockers)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 7603, in merge
    mydbapi=mydbapi, prev_mtimes=prev_mtimes)
  File "/usr/lib64/portage/pym/portage/dbapi/vartree.py", line 4366, in merge
    mydbapi=mydbapi, prev_mtimes=prev_mtimes)
  File "/usr/lib64/portage/pym/portage/dbapi/vartree.py", line 4380, in _merge
    elog_process(self.mycpv, self.settings, phasefilter=filter_mergephases)
  File "/usr/lib64/portage/pym/portage/elog/__init__.py", line 165, in elog_process
    m.process(mysettings, str(key), mod_logentries, mod_fulllog)
  File "/usr/lib64/portage/pym/portage/elog/mod_mail.py", line 40, in process
    portage.mail.send_mail(mysettings, mymessage)
  File "/usr/lib64/portage/pym/portage/mail.py", line 132, in send_mail
    myconn.sendmail(myfrom, myrecipient, msg)
  File "/usr/lib64/python3.1/smtplib.py", line 718, in sendmail
    (code,resp) = self.data(msg)
  File "/usr/lib64/python3.1/smtplib.py", line 480, in data
    q = quotedata(msg)
  File "/usr/lib64/python3.1/smtplib.py", line 157, in quotedata
    re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
  File "/usr/lib64/python3.1/re.py", line 166, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: can't use a string pattern on a bytes-like object


Reproducible: Always

Steps to Reproduce:
1. emerge portage-2.2_rc49 with python3 USE flag enabled
2. emerge portage-2.2_rc49




$ sudo emerge --info
Password:                       
Portage 2.2_rc49 (default/linux/amd64/10.0/desktop, gcc-4.4.1, glibc-2.10.1-r0, 2.6.31-gentoo-r3 x86_64)                                                                            
=================================================================                         
System uname: Linux-2.6.31-gentoo-r3-x86_64-Dual_Core_AMD_Opteron-tm-_Processor_275-with-gentoo-2.0.1                                                                               
Timestamp of tree: Mon, 09 Nov 2009 13:30:04 +0000                                        
app-shells/bash:     4.0_p35                                                              
dev-java/java-config: 2.1.9-r1                                                            
dev-lang/python:     2.6.4, 3.1.1-r1                                                      
dev-python/pycrypto: 2.1.0_beta1                                                          
dev-util/cmake:      2.6.4-r3                                                             
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.2-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1, 2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -mtune=k8 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /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 /etc/udev/rules.d"
CXXFLAGS="-O2 -march=k8 -mtune=k8 -pipe -fomit-frame-pointer"
DISTDIR="/home/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_US"
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="/usr/local/portage/layman/science /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac acl acpi alsa amd64 apache2 atlas avahi bash-completion berkdb blas bluetooth bookmarks branding bzip2 cairo cblas cdr cleartype cli consolekit cracklib crypt ctype cups dbus dirac doc dri dts dvd dvdr eds emacs emboss encode evo examples f77 fam fftw firefox flac foomativdb fortran gdbm gfortran gif gimpprint glitz gnome gpm gstreamer gtk hal iconv imagemagick imap ivman java jpeg jpeg2k kde kdrive kpathsea lapack latex ldap libnotify lzo mad mdnsresponder-compat mikmod mime mmap mmx modules mozbranding mozilla mozsvg mp3 mp4 mpeg mplayer mudflap multilib multislot mysql ncurses newspr nptl nptlonly nsplugin ogg opengl openmp oss pam pcre pdf perl pertty pic png policykit postgres ppds pppd python python3 qt3support qt4 quicktime readline reflection rss samba sdl semantic-desktop session spell spl sse sse2 ssl startup-notification subversion svg symlink sysfs tcpd threads thunar tiff transparency truetype umfpack unicode usb v4l v4l2 vorbis webdav webkit winbind x264 xcomposite xfs xft xml xorg xulrunner xv xvid zeroconf 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" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="nvidia vga nv"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Zac Medico gentoo-dev 2009-11-09 21:09:57 UTC
This is related to bug #291331. Apparently we'll be forced to convert all characters to ascii only.
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-11-10 10:12:07 UTC
A workaround was suggested in http://bugs.python.org/issue4403
Comment 3 Zac Medico gentoo-dev 2009-11-10 22:35:35 UTC
*** Bug 292724 has been marked as a duplicate of this bug. ***
Comment 4 Zac Medico gentoo-dev 2009-11-11 06:48:46 UTC
Created attachment 209884 [details, diff]
use fix suggested in bugs.python.org/issue4403#msg76425

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

  patch /usr/lib/portage/pym/portage/mail.py /tmp/email_typeerror.patch
Comment 5 Zac Medico gentoo-dev 2009-11-11 06:51:33 UTC
Created attachment 209885 [details, diff]
use fix suggested in bugs.python.org/issue4403#msg76425
Comment 6 Zac Medico gentoo-dev 2009-11-16 01:18:36 UTC
This is fixed in portage-2.1.7.5 and 2.2_rc50.