On Sat, Apr 28, 2012 at 09:35, Benjamin Peterson <benja...@python.org>wrote:

> 2012/4/28 Nick Coghlan <ncogh...@gmail.com>:
> > On Sat, Apr 28, 2012 at 6:00 AM, Brett Cannon <br...@python.org> wrote:
> >> I'm personally in favour of changing the insertion of '' to sys.path to
> >> inserting the cwd when the interpreter is launched.
> >
> > I'm not, because it breaks importing from the interactive prompt if
> > you change directory after starting the session.
> >
> > The existing workaround for applications is pretty trivial:
> >
> >  # Somewhere in your initialisation code
> >  for i, entry in enumerate(sys.path):
> >      sys.path[i] = os.path.abspath(i)
> >
> > The fix for the import system is similarly trivial: call
> > os.path.abspath when calculating __file__ (just as runpy now does and
> > the import emulation in pkgutil always has).
>
> I thought __file__ was required to be absolute in Python 3.
>

Not that I'm specifically aware of. Since site makes all entries in
sys.path absolute it is really only an issue if you launch without site or
the '' entry in sys.path.

-Brett


>
>
>
> --
> Regards,
> Benjamin
>
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to