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: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: laukpe, pjenvey
Priority: Keywords:

Created on 2008-11-20.14:44:22 by laukpe, last changed 2008-12-14.17:17:12 by fwierzbicki.

Messages
msg3792 (view) Author: Pekka Laukkanen (laukpe) 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
History
Date User Action Args
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:22laukpecreate