[ python-Bugs-996748 ] os.environ documentation should indicate unreliability

SourceForge.net noreply at sourceforge.net
Sat Jul 24 22:25:48 CEST 2004


Bugs item #996748, was opened at 2004-07-23 13:41
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=996748&group_id=5470

Category: Python Library
Group: Feature Request
Status: Open
Resolution: None
Priority: 5
Submitted By: Richard Tibbetts (tibbetts)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.environ documentation should indicate unreliability

Initial Comment:
Looking at the documenation for the os module, nothing
in the documentation of os.environ would indicate that
it is unreliable. But then looking at os.putenv, we see
that os.environ will not reflect changes made to the
environment through other means.

To me, this makes os.environ much less useful. In fact,
it makes it somewhat harmful. I would argue for
deprecating it, or at least documenting this problem.

Thanks,
Richard


----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2004-07-24 15:25

Message:
Logged In: YES 
user_id=80475

FWIW, os.environ is reliable; it is putenv that is not doing
what you expect.

putenv() is there for updating the environment of
sub-processes. There doesn't appear to be a reliable cross
platform approach having any program update its own environment.

Look on ASPN for my recipe that shows an o.s. trick for
solving this problem.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=996748&group_id=5470


More information about the Python-bugs-list mailing list