Gentoo Archives: gentoo-dev

From: "Petteri Räty" <betelgeuse@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Locale check in python_pkg_setup()
Date: Sat, 31 Jul 2010 20:24:23
Message-Id: 4C5486B6.7040408@gentoo.org
In Reply to: Re: [gentoo-dev] Locale check in python_pkg_setup() by Arfrever Frehtes Taifersar Arahesis
1 On 07/31/2010 11:10 PM, Arfrever Frehtes Taifersar Arahesis wrote:
2 >>
3 >> If the variable is set but not exported then it is local to the shell
4 >> env. When bash goes to exec() python the local shell variables are
5 >> not in the env; so os.environ() will not contain them.
6 >>
7 >> antarus@kyoto ~ $ foo=BAR
8 >> antarus@kyoto ~ $ echo $foo
9 >> BAR
10 >> antarus@kyoto ~ $ python -c 'import os; print os.environ.get("foo")'
11 >> None
12 >> antarus@kyoto ~ $ export foo
13 >> antarus@kyoto ~ $ python -c 'import os; print os.environ.get("foo")'
14 >> BAR
15 >
16 > I want only variables exported to Python processes.
17 >
18
19 export -p
20
21 Petteri

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] Locale check in python_pkg_setup() Arfrever Frehtes Taifersar Arahesis <Arfrever@g.o>