Hello, i found a minor layout bug that happened when you misconfigure PORTAGE_ELOG_MAILURI emerge doesn't evaluate '\n' and returns, "!!! A network error occur(r)ed while trying to send logmail:\n(-2, 'Name or service not known')\nSure you configured PORTAGE_ELOG_MAILURI correctly?" Jj
Obviously, this message comes from send_mail function defined in /usr/lib/portage/pym/portage_mail.py, where PortageException is raised with the value containing several newline characters. The problem shows up because the function elog_process defined in /usr/lib/portage/pym/portage.py simply prints exceptions without any conversion, whereas other code uses a little more sophisticated method: (from elog_process) except (ImportError, AttributeError), e: print "!!! Error while importing logging modules while loading \"mod_%s\":" % s print e except portage_exception.PortageException, e: print e (from class config/_init_dirs) except portage_exception.PortageException, e: writemsg("!!! Directory initialization failed: '%s'\n" % mydir, noiselevel=-1) writemsg("!!! %s\n" % str(e), noiselevel=-1) Looks like a simple conversion from "print" to analogous "writemsg" calls in elog_process should do the trick.
Shouldn't matter as print implicitly calls str(e) (or rather e.__str__()) while writemsg has to do it explicitly. And the latest releases already use writemsg anyway. The problem is somehow caused when assembling the Exception, have to test this some more.
Turned out the problem was actually in PortageException itself as it escaped newlines accidently.
(In reply to comment #3) > Turned out the problem was actually in PortageException itself as it escaped > newlines accidently. > Glad to see you get time to trace the problem. Portage is a nice piece of code :) Thank you for your effort.
This is fixed in svn r5546.
This has been released in 2.1.2_rc4-r9.