From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PzAb8-0000EW-QL for garchives@archives.gentoo.org; Mon, 14 Mar 2011 16:26:22 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3410A1C047; Mon, 14 Mar 2011 16:24:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 029141C04A for ; Mon, 14 Mar 2011 16:24:45 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C17131BC0E7 for ; Mon, 14 Mar 2011 16:24:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 3048B8006E for ; Mon, 14 Mar 2011 16:24:45 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:2.1.9 commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/ebuild-ipc.py X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: ef6643061e9c7f1447968d916cc876d91da59b76 Date: Mon, 14 Mar 2011 16:24:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: f6450b654b155e4d3d344246e9617a86 commit: ef6643061e9c7f1447968d916cc876d91da59b76 Author: Zac Medico gentoo org> AuthorDate: Thu Mar 10 22:49:47 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Mar 14 16:23:19 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Def664306 ebuild-ipc: use plain file read instead of array Array.fromfile() seems to be more error prone. For example, see bug 337465. --- bin/ebuild-ipc.py | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py index 45d7120..d8e7e55 100755 --- a/bin/ebuild-ipc.py +++ b/bin/ebuild-ipc.py @@ -1,11 +1,10 @@ #!/usr/bin/python -# Copyright 2010 Gentoo Foundation +# Copyright 2010-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # # This is a helper which ebuild processes can use # to communicate with portage's main python process. =20 -import array import logging import os import pickle @@ -141,13 +140,11 @@ class EbuildIpc(object): # read and write of whole pickles. input_file =3D open(self.ipc_out_fifo, 'rb', 0) =20 - # For maximum portability, us an array in order to force - # a single atomic read of a whole pickle (bug #337465). - buf =3D array.array('B') - + # For maximum portability, use a single atomic read. + buf =3D None try: - buf.fromfile(input_file, self._BUFSIZE) - except (EOFError, IOError) as e: + buf =3D input_file.read(self._BUFSIZE) + except IOError as e: if not buf: portage.util.writemsg_level( "ebuild-ipc: %s\n" % (e,), @@ -167,7 +164,7 @@ class EbuildIpc(object): else: =20 try: - reply =3D pickle.loads(buf.tostring()) + reply =3D pickle.loads(buf) except SystemExit: raise except Exception as e: