Issue1176

classification
Title: "'VAR' in os.environ" always returns False when os.environ not touched otherwise
Type: Severity: normal
Components: Core Versions: 2.2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pekka.klarck, pjenvey, zyasoft
Priority: low Keywords:

Created on 2008-11-20.14:44:22 by pekka.klarck, last changed 2009-06-21.21:37:12 by pjenvey.

Messages
msg3792 (view) Author: Pekka Klärck (pekka.klarck) Date: 2008-11-20.14:44:21
Jython 2.2 on java1.5.0_16
Type "copyright", "credits" or "license" for more information.
>>> import os
>>> 'PATH' in os.environ
0
>>> os.environ['PATH']
'/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/peke/jython2.2/'
>>> 'PATH' in os.environ
1


If I remember correctly, os.environ is initialized lazily and most
likely 'in' doesn't tricker real initialization. Works without problems
in CPython (tested only on 2.5.1).
msg3812 (view) Author: Philip Jenvey (pjenvey) Date: 2008-11-22.23:57:44
trunk does not have this problem
msg4231 (view) Author: Jim Baker (zyasoft) Date: 2009-03-12.07:41:53
Only applies to 2.2
msg4828 (view) Author: Philip Jenvey (pjenvey) Date: 2009-06-21.21:37:11
Fixed in 2.5
History
Date User Action Args
2009-06-21 21:37:12pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg4828
2009-03-12 07:41:53zyasoftsetpriority: low
nosy: + zyasoft
messages: + msg4231
2008-12-14 17:17:12fwierzbickisetcomponents: + Core
versions: + 2.2.2
2008-11-22 23:57:44pjenveysetnosy: + pjenvey
messages: + msg3812
2008-11-20 14:44:22pekka.klarckcreate