<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 22 February 2016 at 16:37, Aníbal Limón <span dir="ltr">&lt;<a href="mailto:anibal.limon@linux.intel.com" target="_blank">anibal.limon@linux.intel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="overflow:hidden">I agree with you to modify avoid_paths_in_environ for return the new<br>
PATH variable is better than only modify it internally but for<br>
simplicity i will maintain the os.environ[&#39;PATH&#39;] set/restore instead of<br>
generate the environment line.<br>
<div></div></div></blockquote></div><br>Totally agree with Randy here for what it&#39;s worth.  The environment-munging code in avoid_paths... should return the strings instead of manipulating the current environment so the caller has the choice whether to modify the current environment or pass a new environment to subprocess.  And in general I&#39;d say that passing modified environments to subprocess is a cleaner solution as it means that there&#39;s no way cleanup can fail to happen.  Whilst that&#39;s just a try/except now, the code could get copied and extended and end up with codepaths that don&#39;t hit the right cleanup.  By having an explicit environment passed in, this isn&#39;t possible.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Ross</div></div>