From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 751BB138010 for ; Mon, 8 Oct 2012 14:54:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B67BDE0369; Mon, 8 Oct 2012 14:54:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3FCB1E0369 for ; Mon, 8 Oct 2012 14:54:33 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7385A33C4EE for ; Mon, 8 Oct 2012 14:54:32 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id E0E6FE5436 for ; Mon, 8 Oct 2012 14:54:30 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1349708054.84ce763b5d397dc836b7132c0961d8f2b1a2d1f1.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/process.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 84ce763b5d397dc836b7132c0961d8f2b1a2d1f1 X-VCS-Branch: master Date: Mon, 8 Oct 2012 14:54:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 84ea847b-4f2e-4090-935f-9fb3ce8119ee X-Archives-Hash: 1a323627ed5db36792aa74579a135abc commit: 84ce763b5d397dc836b7132c0961d8f2b1a2d1f1 Author: Zac Medico gentoo org> AuthorDate: Mon Oct 8 14:54:14 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Oct 8 14:54:14 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84ce763b spawn: use finally block for failure os._exit() Also, use writemsg for unicode safety. --- pym/portage/process.py | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pym/portage/process.py b/pym/portage/process.py index 32e60ac..a3461f4 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -15,7 +15,7 @@ from portage import _encodings from portage import _unicode_encode import portage portage.proxy.lazyimport.lazyimport(globals(), - 'portage.util:dump_traceback', + 'portage.util:dump_traceback,writemsg', ) from portage.const import BASH_BINARY, SANDBOX_BINARY, FAKEROOT_BINARY @@ -268,9 +268,12 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False, # We need to catch _any_ exception so that it doesn't # propagate out of this function and cause exiting # with anything other than os._exit() - sys.stderr.write("%s:\n %s\n" % (e, " ".join(mycommand))) + writemsg("%s:\n %s\n" % (e, " ".join(mycommand)), noiselevel=-1) traceback.print_exc() sys.stderr.flush() + finally: + # Call os._exit() from finally block, in order to suppress any + # finally blocks from earlier in the call stack. See bug #345289. os._exit(1) if not isinstance(pid, int):