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.

classification
Title: os.environ documentation should mention unsetenv
Type: Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: bwelling, georg.brandl, georg.brandl
Priority: normal Keywords:

Created on 2005-06-22 18:09 by bwelling, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg25615 - (view) Author: Brian Wellington (bwelling) Date: 2005-06-22 18:09
The (current) documentation for os.environ says:

---
If the platform supports the putenv() function, this
mapping may be used to modify the environment as well
as query the environment. putenv() will be called
automatically when the mapping is modified.
---

Some platforms (Solaris 8 and 9, at least) have
putenv() but not unsetenv(), which means that setting
environment variables by assigning values in os.environ
works, but unsetting them by deleting from os.environ
doesn't.  This is confusing, and should at least be
documented (if for no other reason than no one else
should waste several hours figuring this out).  This
was tested with Python 2.4.1 and earlier versions.

I'd suggest documenting os.unsetenv() in 6.1.1 (Process
Parameters) of the manual, and modifying the above text
to say something like:

---
If the platform supports the putenv() and unsetenv()
functions, this mapping may be used to modify the
environment as well as query the environment. putenv()
will be called automatically when an entry in the
mapping is added or changed, and unsetenv() will be
called automatically when an entry is deleted.
---
msg25616 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-06-25 18:47
Logged In: YES 
user_id=1188172

Fixed as Doc/lib/libos.tex r1.158, r1.146.2.4. Thanks for
the report!
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 42111
2005-06-22 18:09:06bwellingcreate