Author vstinner
Recipients Arfrever, ezio.melotti, gregory.p.smith, lemburg, loewis, pitrou, vstinner
Date 2010-05-03.22:20:47
SpamBayes Score 0.000939247
Marked as misclassified No
Message-id <1272925249.12.0.903710490314.issue8603@psf.upfronthosting.co.za>
In-reply-to
Content
> Can somebody please explain what problem is being solved with this patch?

The problem is that we don't have reliable algorithm to get the encoding of each environment variable. We cannot ensure that all variables are encoded "correctly".

Using os.getenvb(), you can decode the string using the right encoding (which may be different for each variable).

Marc proposed os.getenv(key, encoding=...) but I don't like this solution: you have to split correctly all unicode things and all bytes things. You should have the choice to keep environment unchanged, as byte strings, and manipulate only byte strings, or to use the classic API (unicode only, os.getenv, os.environ(), ....).

os.environb and os.getenvb() will be required to applications in real world application supporting all applications and misconfigured environments. Python3 shouldn't try to fix misconfigured systems but leave this problem to the developer.
History
Date User Action Args
2010-05-03 22:20:49vstinnersetrecipients: + vstinner, lemburg, loewis, gregory.p.smith, pitrou, ezio.melotti, Arfrever
2010-05-03 22:20:49vstinnersetmessageid: <1272925249.12.0.903710490314.issue8603@psf.upfronthosting.co.za>
2010-05-03 22:20:48vstinnerlinkissue8603 messages
2010-05-03 22:20:47vstinnercreate