On 28 Jun., 08:54, [EMAIL PROTECTED] wrote: > For one thing, the expression 'os.environ.keys' will yield a method > object (not a list, as you're probably expecting), but iterating over > a method as you did should produce an exception. If you want to get > the list of environment vars, you have to call the method, like > 'os.environ.keys()'.
You are right but it's just a typo in this message, sorry. My real code is correct. > Also, aren't changes to environment vars supposed to be visible to > child processes anyway? Yes. Both the clear method and the del method change os.environ. os.environ IS the environment in a python program. > Which one are you suggesting that behaves the > wrong way, 'os.environ.clear()' or 'del os.environ[key]'? The former. If a key is not in os.environ, it shouldn't exist for child processes. -- http://mail.python.org/mailman/listinfo/python-list