This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author draghuram
Recipients draghuram, loewis, pythonmeister, robert.ancell
Date 2007-09-13.17:58:12
SpamBayes Score 0.00057786214
Marked as misclassified No
Message-id <2c51ecee0709131058j1b8fc02jdb106f52d6efb1c7@mail.gmail.com>
In-reply-to <1189705432.8.0.301339620378.issue1159@psf.upfronthosting.co.za>
Content
> Stefan Sonnenberg-Carstens added the comment:
>
> > As per the document and my simple test (on Linux), os.putenv() does
> > not update os.environ. I think, it should update it.
> What would be the benefit ?

Symmetrical behaviour. When os.getenv() returns the value from
os.environ, one would expect, os.putenv to store the value there (At
least, I did). On the other hand, it is also ok for both os.getenv and
os.putenv get/set the environment directly instead of going through
os.environ. I am sure there was some reason for the current behaviour
of os.putenv. Perhaps, because putenv is supposedly not available on
all platforms?

Any way, I think the OP was asking to always "get" the value
dynamically when ever os.environ['VAR'] or os.getenv['VAR'] is done. I
don't see any problem with that approach. How ever, if it is
considered backwards incompatible, I guess an optional parameter can
be added to os.getenv.
History
Date User Action Args
2007-09-13 17:58:13draghuramsetspambayes_score: 0.000577862 -> 0.00057786214
recipients: + draghuram, loewis, pythonmeister, robert.ancell
2007-09-13 17:58:13draghuramlinkissue1159 messages
2007-09-13 17:58:12draghuramcreate