Calling the source command from subprocess.popen to update the os.environ.

Hongyi Zhao hongyi.zhao at gmail.com
Sun Mar 27 19:40:31 EDT 2016


On Sun, 27 Mar 2016 13:24:05 +0000, Hongyi Zhao wrote:

> # replace env 
> os.environ.clear()

I find another method which can solve this issue, ie., changing the above 
code into the follows:

# ref : http://unix.stackexchange.com/questions/178522/unsetting-
environment-variable-with-an-empty-name
if "" in os.environ.data: del os.environ.data[""]
os.environ.clear()

Regards
-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.



More information about the Python-list mailing list