Gregory P. Smith <g...@krypto.org> added the comment: >>> os.environ['FOO'] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/UserDict.py", line 22, in __getitem__ raise KeyError(key) KeyError: 'FOO' >>> os.environ.get('FOO') >>> os.environ.get('FOO', 'bar') 'bar'
% export FOO= % python2.5 >>> import os >>> os.environ['FOO'] '' An environment variable set to '' is valid and is still considered set (thats how the environment works). ---------- nosy: +gregory.p.smith resolution: -> invalid status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5253> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com