[Python-bugs-list] [Bug #110690] Bug in os.environ for Windows (PR#50)

noreply@sourceforge.net noreply@sourceforge.net
Wed, 13 Sep 2000 03:30:46 -0700


Bug #110690, was updated on 2000-Jul-31 14:15
Here is a current snapshot of the bug.

Project: Python
Category: Windows
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 5
Summary: Bug in os.environ for Windows (PR#50)

Details: Jitterbug-Id: 50
Submitted-By: bobalex@uppercase.xerox.com
Date: Wed, 11 Aug 1999 19:19:16 -0400 (EDT)
Version: 1.5.2
OS: WinNT


os.environ for Windows appears to be a map-type object that converts its keys to
upper case. Retrieval using a mixed case key works in some cases, but some
overloaded "operators" don't seem to do the right thing unless I pass an
all-upper-case key. E.g.:

>>> os.environ["x"] = "y"               # Stores pair {"X": "y"}
>>> os.environ["x"]                     # Works, indicates an effort is made
'y'                                     #   to retrieve mixed case keys
>>> os.environ.get("x", "NOT FOUND")    # Doesn't see the key "x"
'NOT FOUND'
>>> os.environ.get("X", "NOT FOUND")    # Works with all-upper-case key
'y'
>>> del os.environ["x"]                 # Doesn't see the key "x"
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "E:\Program Files\Python\Lib\UserDict.py", line 16, in __delitem__
    def __delitem__(self, key): del self.data[key]
KeyError: x
>>> del os.environ["X"]                 # Works with all-upper-case key



====================================================================
Audit trail:
Mon Aug 30 12:33:44 1999	guido	moved from incoming to open

Follow-Ups:

Date: 2000-Sep-07 10:34
By: fdrake

Comment:
Fixed at some point in the past.  Tested OK using 2.0b1 on Win2K.
-------------------------------------------------------

Date: 2000-Sep-07 15:04
By: jhylton

Comment:
Please do triage on this bug.
-------------------------------------------------------

Date: 2000-Sep-13 03:30
By: gvanrossum

Comment:
This was fixed by os.py version 1.31 in April 2000, by Fred Gansevles.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=110690&group_id=5470