<br><br><div class="gmail_quote">On Sat, Apr 28, 2012 at 04:08, Nick Coghlan <span dir="ltr">&lt;<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.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 class="im">On Sat, Apr 28, 2012 at 6:00 AM, Brett Cannon &lt;<a href="mailto:brett@python.org">brett@python.org</a>&gt; wrote:<br>
&gt; I&#39;m personally in favour of changing the insertion of &#39;&#39; to sys.path to<br>
&gt; inserting the cwd when the interpreter is launched.<br>
<br>
</div>I&#39;m not, because it breaks importing from the interactive prompt if<br>
you change directory after starting the session.<br>
<br></blockquote><div><br></div><div>Who does that? I mean what possible need do you have to start the interpreter in one directory, but then need to chdir somewhere else where you are doing your actual importing from, and in a way where you can&#39;t simply attach the directory you want to use into sys.path?</div>

<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The existing workaround for applications is pretty trivial:<br>
<br>
  # Somewhere in your initialisation code<br>
  for i, entry in enumerate(sys.path):<br>
      sys.path[i] = os.path.abspath(i)<br>
<br>
The fix for the import system is similarly trivial: call<br>
os.path.abspath when calculating __file__ (just as runpy now does and<br>
the import emulation in pkgutil always has).<br></blockquote><div><br></div><div>You say trivial, I say a pain as that means porting over os.path.abspath() into importlib._bootstrap that works for all platforms.</div><div>

<br></div><div>-Brett</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
Cheers,<br>
Nick.<br>
<br>
--<br>
Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>   |   Brisbane, Australia<br>
</div></div></blockquote></div><br>