Mike Castle reported:
gtest_output_test.py has this bit of code:
# Spawns cmd in a sub-process, and gets its standard I/O file objects.
# Set and save the environment properly.
old_env_vars = dict(os.environ)
os.environ.update(env_cmd[0])
stdin_file, stdout_file = os.popen2(env_cmd[1], 'b')
os.environ.clear()
os.environ.update(old_env_vars)
Unfortunately, that actually doesn't save the environment properly.
If another uses the same function, it will get a dubious error.
The os.environ.clear() stuff doesn't work with 2.4 like one would
expect. Sure, it resets the content of os.environ, but it doesn't
update the stuff on the C side like it should. That wasn't added
until Python 2.6.
That line should instead read:
for key in os.environ.keys(): del os.environ[key]
Original issue reported on code.google.com by zhanyong...@gmail.com on 15 Jun 2009 at 8:44
Original issue reported on code.google.com by
zhanyong...@gmail.com
on 15 Jun 2009 at 8:44