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 <gentoo-commits+bounces-324293-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1Pxoij-0001Fc-CL
	for garchives@archives.gentoo.org; Thu, 10 Mar 2011 22:52:38 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id A33FAE0574;
	Thu, 10 Mar 2011 22:52:28 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 5BAE1E0574
	for <gentoo-commits@lists.gentoo.org>; Thu, 10 Mar 2011 22:52:28 +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 B85BD1B4078
	for <gentoo-commits@lists.gentoo.org>; Thu, 10 Mar 2011 22:52:27 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 2207A8006A
	for <gentoo-commits@lists.gentoo.org>; Thu, 10 Mar 2011 22:52:27 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <79589a4ab283e2cd76452141d0a004a1cb347f24.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master 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: 79589a4ab283e2cd76452141d0a004a1cb347f24
Date: Thu, 10 Mar 2011 22:52:27 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: 22fdd2a62658ffb8851c6dd3513eb4cc

commit:     79589a4ab283e2cd76452141d0a004a1cb347f24
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 10 22:49:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 10 22:49:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3D79589a4a

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: