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 1Og2PQ-00082n-UP for garchives@archives.gentoo.org; Mon, 02 Aug 2010 21:18:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 90EF7E087A; Mon, 2 Aug 2010 21:18:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id AB4CEE072D for ; Mon, 2 Aug 2010 21:18:46 +0000 (UTC) Received: from afta-gentoo.localnet (ip-85-198-235-97.broker.com.pl [85.198.235.97]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPSA id 16D781B4279 for ; Mon, 2 Aug 2010 21:18:46 +0000 (UTC) From: Arfrever Frehtes Taifersar Arahesis To: Gentoo Development Subject: Re: [gentoo-dev] Locale check in python_pkg_setup() Date: Mon, 2 Aug 2010 23:18:59 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.34-tuxonice-r1-AFTA; KDE/4.4.5; x86_64; ; ) References: <201007300116.43653.Arfrever@gentoo.org> In-Reply-To: <201007300116.43653.Arfrever@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2130762.s8y5GNLLb1"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201008022319.00534.Arfrever@gentoo.org> X-Archives-Salt: db25337d-45f8-46b4-a50d-632d28f417dc X-Archives-Hash: 2dadc958ac4306afeca3d5abd02ccb5b --nextPart2130762.s8y5GNLLb1 Content-Type: multipart/mixed; boundary="Boundary-01=_EZzVMzvTt1dSRK1" Content-Transfer-Encoding: 7bit --Boundary-01=_EZzVMzvTt1dSRK1 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline A milder warning will be printed. =2D-=20 Arfrever Frehtes Taifersar Arahesis --Boundary-01=_EZzVMzvTt1dSRK1 Content-Type: text/x-patch; charset="utf-8"; name="python.eclass.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="python.eclass.patch" =2D-- python.eclass +++ python.eclass @@ -355,6 +355,8 @@ # Check if phase is pkg_setup(). [[ "${EBUILD_PHASE}" !=3D "setup" ]] && die "${FUNCNAME}() can be used on= ly in pkg_setup() phase" =20 + local locale + if [[ "$#" -ne 0 ]]; then die "${FUNCNAME}() does not accept arguments" fi @@ -407,6 +409,15 @@ unset -f python_pkg_setup_check_USE_flags fi =20 + if [[ "$(locale charmap)" !=3D "UTF-8" ]]; then + locale=3D"$(python -c 'import os; print(os.environ.get("LC_ALL", os.envi= ron.get("LC_CTYPE", os.environ.get("LANG", "POSIX"))))')" + ewarn + ewarn "Currently used locale '${locale}' can cause UnicodeDecodeError or= UnicodeEncodeError" + ewarn "exceptions. It is recommended to use a UTF-8 locale to avoid prob= lems." + ewarn "See http://www.gentoo.org/doc/en/utf-8.xml for information on how= to change locale." + ewarn + fi + PYTHON_PKG_SETUP_EXECUTED=3D"1" } =20 --Boundary-01=_EZzVMzvTt1dSRK1-- --nextPart2130762.s8y5GNLLb1 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iQIcBAABAgAGBQJMVzZEAAoJEFU3/w1zlLfga88QAJ1zZx1Frn3NqvTQGxyL0Ayx QJT12/wyjPeYPe9t7XMFKy0zpiNbe7tmkyjNR6JXMvmBnKtGsn8nuFN9zPFk7Dtq d1Jdx+aHcZ9RehagsD2hA1xkIVBNCyuTTaoNBVjhhd8Z9wCZ5f68Io4i5+H+FgM4 nbdH1VPex5OQoy+fcUVxMgcu8AXTOS+qhNH+mXbeM3C71DXYzNRAtLK6eat8QzAI iJQA8HGxsR9xKhtFCybIj767WmF4tFOOcN1eY3T+gNV7LUrD1G92C3+G8hZLY79h ZoMGqRJ+riFCSjJtz/oxnNjIAIwI9cGnnWU7bNLHpMDHYgYrcy09A8VisLZWPsiw bOu0BakVLyZ487DM0Y6VI3NQICpiFw16wM3iwh9AFPgJEez2JbJ26Ru7v3JomFnY 1GemZXOckpNLUoIbcOjfdvaOLElnbN+OE+yp1ibkILFtvo2D8rCOqLOQf6dHVjXy 6YRpl6m/W9sa6zES0CwLbj7B++rPs2Yg985veMgv4zYcPAJHnh0xkBYpKTmzS+Th YiXxp3+MQ8cc0MB9jnz0VYZ/2C7ao0tedqBIxn1DDzB6gnVlQ9yrrrTqc8pNqcCQ 5VG8/hBYyaWQMI5ZWjqPwKpBHaEPdN8hS4pHfNoDw/GZQJI23RO9G9wJRHqXqpAJ buCH0IbP+dJLpE8FIB6f =WzAL -----END PGP SIGNATURE----- --nextPart2130762.s8y5GNLLb1--