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 1Og2BV-00067o-1n for garchives@archives.gentoo.org; Mon, 02 Aug 2010 21:04:33 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 21AE6E0894; Mon, 2 Aug 2010 21:04:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E3AF2E09A8 for ; Mon, 2 Aug 2010 21:04:00 +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 C69251B42CF for ; Mon, 2 Aug 2010 21:03:59 +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:02:44 +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> <201007312211.03680.Arfrever@gentoo.org> <4C5486B6.7040408@gentoo.org> In-Reply-To: <4C5486B6.7040408@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="nextPart256159814.ZXElVNPFC5"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201008022303.20713.Arfrever@gentoo.org> X-Archives-Salt: 46311ed5-47c4-4ad3-b330-065fdbdafa3f X-Archives-Hash: 2c8d3fbb8dd0c24e0ca0481d365df26e --nextPart256159814.ZXElVNPFC5 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 2010-07-31 22:25:26 Petteri R=C3=A4ty napisa=C5=82(a): > On 07/31/2010 11:10 PM, Arfrever Frehtes Taifersar Arahesis wrote: > >> > >> If the variable is set but not exported then it is local to the shell > >> env. When bash goes to exec() python the local shell variables are > >> not in the env; so os.environ() will not contain them. > >> > >> antarus@kyoto ~ $ foo=3DBAR > >> antarus@kyoto ~ $ echo $foo > >> BAR > >> antarus@kyoto ~ $ python -c 'import os; print os.environ.get("foo")' > >> None > >> antarus@kyoto ~ $ export foo > >> antarus@kyoto ~ $ python -c 'import os; print os.environ.get("foo")' > >> BAR > >=20 > > I want only variables exported to Python processes. > >=20 >=20 > export -p It would have to be parsed using e.g. grep and sed. It's easier to call Pyt= hon in this case. The call to Python is sufficiently fast: $ time python -c 'import os; print(os.environ.get("LC_ALL", os.environ.get(= "LC_CTYPE", os.environ.get("LANG", "POSIX"))))' > /dev/null real 0m0.062s user 0m0.051s sys 0m0.011s =2D-=20 Arfrever Frehtes Taifersar Arahesis --nextPart256159814.ZXElVNPFC5 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) iQIcBAABAgAGBQJMVzKYAAoJEFU3/w1zlLfg/2cQAKZsWiKRHGQSnpdU3hEzPRa2 Yw4LtAOgjQWF4V7K6p4Y73e3OS/TaNd+wUlfY7v8hDlW89phAIPbN2bnwV0zrP5I pp2m46XN/KvtskNLHFMWj3O+7crNetVI0s9ilMBIl2oAI/LyDsi3s4Mm5oHMH2l/ /kPFUlQaxhQcaArs9EbrJxu2wfC/tYykzErM5KYnqOVa4XJvZG280LJ+aGVPkubk cpky10hGSD8WbyqjwB8r1w0q0SqDvYKPan3FenZCz36JLXcg9sI3R+nUL95mVyd9 mHuxa5FWc6WiIG/z72rgseD+Iwm9PhtIHCmf5w1qg9Ks/f5HU7vlwQ/jRKO8XZ3h 6/OyNE9gXXdExcnKoF8PgDofEvIzQge2zqIxzAZpCXyLmITi07IQWXCEImfISgs1 EGlZmnW3DnB4Q7T8jn02cd9EXiRmg7RXOnasUi3oyoF+Vqx9qURkbmzAxLM+iy/o 7T/kadtXIqSdGKA4jdhtzfnKu2jWbLiZqBzB41mMtFTzDd4/Kd+qSZ3sSLTqzAW1 MC550krxkLAHr1/SQeljOg+E+NRZqg+AytJ+ZnEkP9+74H//oyX/ZgWxsQsX5zW4 euz1LEmMJxHMJIBufXhldmV8vgvwY2ktk9vJTH9yQqkeUpNwmfDZL964nUdRzhmM VAgE8Axi/la58nWLI0jy =oKeX -----END PGP SIGNATURE----- --nextPart256159814.ZXElVNPFC5--