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 1RG2UY-0000Re-Ea for garchives@archives.gentoo.org; Tue, 18 Oct 2011 05:45:34 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BC91E21C038; Tue, 18 Oct 2011 05:45:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6E06621C038 for ; Tue, 18 Oct 2011 05:45:25 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CAC971B4017 for ; Tue, 18 Oct 2011 05:45:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 074AA80042 for ; Tue, 18 Oct 2011 05:45:24 +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: <654fd3e173e7e92f9ff1ee1e55caa5c2e7a96ad9.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/dbapi/, pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/EbuildMetadataPhase.py pym/portage/dbapi/porttree.py pym/portage/package/ebuild/doebuild.py X-VCS-Directories: pym/portage/package/ebuild/ pym/portage/dbapi/ pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 654fd3e173e7e92f9ff1ee1e55caa5c2e7a96ad9 Date: Tue, 18 Oct 2011 05:45:24 +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: 8888c432cfc2ba170c4b7d30fb077c08 commit: 654fd3e173e7e92f9ff1ee1e55caa5c2e7a96ad9 Author: Zac Medico gentoo org> AuthorDate: Tue Oct 18 05:45:13 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Oct 18 05:45:13 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D654fd3e1 python3.2 fixes: "ResourceWarning: unclosed file" --- pym/_emerge/EbuildMetadataPhase.py | 6 +++--- pym/portage/dbapi/porttree.py | 6 +++--- pym/portage/package/ebuild/doebuild.py | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetad= ataPhase.py index 06cabe7..aa26e19 100644 --- a/pym/_emerge/EbuildMetadataPhase.py +++ b/pym/_emerge/EbuildMetadataPhase.py @@ -38,11 +38,11 @@ class EbuildMetadataPhase(SubProcess): eapi =3D self.eapi if eapi is None and \ 'parse-eapi-ebuild-head' in settings.features: - eapi =3D portage._parse_eapi_ebuild_head( - io.open(_unicode_encode(ebuild_path, + with io.open(_unicode_encode(ebuild_path, encoding=3D_encodings['fs'], errors=3D'strict'), mode=3D'r', encoding=3D_encodings['repo.content'], - errors=3D'replace')) + errors=3D'replace') as f: + eapi =3D portage._parse_eapi_ebuild_head(f) =20 if eapi is not None: if not portage.eapi_is_supported(eapi): diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.p= y index aad72e1..6f3d90f 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -519,11 +519,11 @@ class portdbapi(dbapi): =20 if eapi is None and \ 'parse-eapi-ebuild-head' in self.doebuild_settings.features: - eapi =3D portage._parse_eapi_ebuild_head(io.open( - _unicode_encode(myebuild, + with io.open(_unicode_encode(myebuild, encoding=3D_encodings['fs'], errors=3D'strict'), mode=3D'r', encoding=3D_encodings['repo.content'], - errors=3D'replace')) + errors=3D'replace') as f: + eapi =3D portage._parse_eapi_ebuild_head(f) =20 if eapi is not None: self.doebuild_settings.configdict['pkg']['EAPI'] =3D eapi diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package= /ebuild/doebuild.py index e479159..a324af2 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -290,10 +290,11 @@ def doebuild_environment(myebuild, mydo, myroot=3DN= one, settings=3DNone, eapi =3D None if mydo =3D=3D 'depend' and 'EAPI' not in mysettings.configdict['pkg']: if eapi is None and 'parse-eapi-ebuild-head' in mysettings.features: - eapi =3D _parse_eapi_ebuild_head( - io.open(_unicode_encode(ebuild_path, + with io.open(_unicode_encode(ebuild_path, encoding=3D_encodings['fs'], errors=3D'strict'), - mode=3D'r', encoding=3D_encodings['content'], errors=3D'replace')) + mode=3D'r', encoding=3D_encodings['content'], + errors=3D'replace') as f: + eapi =3D _parse_eapi_ebuild_head(f) =20 if eapi is not None: if not eapi_is_supported(eapi):