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 1Rx3ue-0002n8-Gj for garchives@archives.gentoo.org; Mon, 13 Feb 2012 21:58:20 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 911B3E086D; Mon, 13 Feb 2012 21:58:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5D028E086D for ; Mon, 13 Feb 2012 21:58:13 +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 C43631B400E for ; Mon, 13 Feb 2012 21:58:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 79286E5400 for ; Mon, 13 Feb 2012 21:58:11 +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: <1329170251.36883148297f4ff96c404ab23d75739dd21de31c.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/checksum.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 36883148297f4ff96c404ab23d75739dd21de31c X-VCS-Branch: master Date: Mon, 13 Feb 2012 21:58:11 +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: dfb47677-4e7a-4c30-bca1-ef464f696bc4 X-Archives-Hash: 156d0daa03ca772fd1d06b358d2431d7 commit: 36883148297f4ff96c404ab23d75739dd21de31c Author: Zac Medico gentoo org> AuthorDate: Mon Feb 13 21:57:31 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Feb 13 21:57:31 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D36883148 checksum.py: remove PyPy 1.7 workarounds The corresponding hashlib issues are fixed in PyPy 1.8: https://bugs.pypy.org/issue957 --- pym/portage/checksum.py | 31 +------------------------------ 1 files changed, 1 insertions(+), 30 deletions(-) diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index 77035b6..73e01b5 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -1,5 +1,5 @@ # checksum.py -- core Portage functionality -# Copyright 1998-2011 Gentoo Foundation +# Copyright 1998-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 =20 import portage @@ -9,7 +9,6 @@ from portage import os from portage import _encodings from portage import _unicode_encode import errno -import platform import stat import tempfile =20 @@ -62,28 +61,6 @@ class _generate_hash_function(object): =20 return (checksum.hexdigest(), size) =20 -_test_hash_func =3D False -if platform.python_implementation() =3D=3D 'PyPy': - def _test_hash_func(constructor): - """ - Test for PyPy crashes observed with hashlib's ripemd160 and whirlpool - functions executed under pypy-1.7 with Python 2.7.1: - *** glibc detected *** pypy-c1.7: free(): invalid next size (fast): 0x= 0b963a38 *** - *** glibc detected *** pypy-c1.7: free(): corrupted unsorted chunks: 0= x09c490b0 *** - """ - import random - pid =3D os.fork() - if pid =3D=3D 0: - data =3D list(b'abcdefg') - for i in range(10): - checksum =3D constructor() - random.shuffle(data) - checksum.update(b''.join(data)) - checksum.hexdigest() - os._exit(os.EX_OK) - pid, status =3D os.waitpid(pid, 0) - return os.WIFEXITED(status) and os.WEXITSTATUS(status) =3D=3D os.EX_OK - # Define hash functions, try to use the best module available. Later def= initions # override earlier ones =20 @@ -152,12 +129,6 @@ try: except ValueError: pass else: - if _test_hash_func and \ - not _test_hash_func(functools.partial(hashlib.new, hash_name)): - portage.util.writemsg("\n!!! hash function appears to " - "crash python: %s from %s\n" % - (hash_name, "hashlib"), noiselevel=3D-1) - continue globals()['%shash' % local_name] =3D \ _generate_hash_function(local_name.upper(), \ functools.partial(hashlib.new, hash_name), \