From 37e01fd5095a40b6a57b1365add1c64f29671211 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 2 Oct 2011 12:52:57 -0700 Subject: dblink._elog_process: handle newlines in messages This will fix bug #385341. --- pym/portage/dbapi/vartree.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pym') diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index a4c54bd87..50fa6f5ac 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -3125,9 +3125,12 @@ class dblink(object): if isinstance(lines, basestring): lines = [lines] for line in lines: - fields = (funcname, phase, cpv, line.rstrip('\n')) - str_buffer.append(' '.join(fields)) - str_buffer.append('\n') + for line in line.split('\n'): + if not line: + continue + fields = (funcname, phase, cpv, line) + str_buffer.append(' '.join(fields)) + str_buffer.append('\n') if str_buffer: os.write(self._pipe, _unicode_encode(''.join(str_buffer))) -- cgit v1.2.3-1-g7c22