(original) (raw)
> Date: Tue, 11 Oct 2005 09:51:06 -0400
> From: Tim Peters
> Subject: Re: \[Python-Dev\] PythonCore\\CurrentVersion
> To: Martin v. L?wis
> Cc: python-dev@python.org
> Message-ID:
> <1f7befae0510110651o504958det5d2409b3f724070e@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> \[Tim Peters\]
> >>> never before this year -- maybe sys.path \_used\_ to contain the current
> >>> directory on Linux?).
>
> \[Fred L. Drake, Jr.\]
> >> It's been a long time since this was the case on Unix of any variety; I
> >> \*think\* this changed to the current state back before 2.0\.
>
> \[Martin v. L?wis\]
> > Please check again:
> >
> > \[GCC 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)\] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import sys
> > >>> sys.path
> > \['', '/usr/lib/python23.zip', '/usr/lib/python2.3',
> > '/usr/lib/python2.3/plat-linux2', '/usr/lib/python2.3/lib-tk',
> > '/usr/lib/python2.3/lib-dynload',
> > '/usr/local/lib/python2.3/site-packages',
> > '/usr/lib/python2.3/site-packages',
> > '/usr/lib/python2.3/site-packages/Numeric',
> > '/usr/lib/python2.3/site-packages/gtk-2.0', '/usr/lib/site-python'\]
> >
> > We still have the empty string in sys.path, and it still
> > denotes the current directory.
>
> Well, that's in interactive mode, and I see sys.path\[0\] == "" on both
> Windows and Linux then. I don't see "" in sys.path on either box in
> batch mode, although I do see the absolutized path to the current
> directory in sys.path in batch mode on Windows but not on Linux -- but
> Mark Hammond says he doesn't see (any form of) the current directory
> in sys.path in batch mode on Windows.
>
> It's a bit confusing ;-)
>
Been bit by this in the past. On windows, it's a relative path in interactive mode and absolute path in non-interactive mode.
> From: Tim Peters
> Subject: Re: \[Python-Dev\] PythonCore\\CurrentVersion
> To: Martin v. L?wis
> Cc: python-dev@python.org
> Message-ID:
> <1f7befae0510110651o504958det5d2409b3f724070e@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> \[Tim Peters\]
> >>> never before this year -- maybe sys.path \_used\_ to contain the current
> >>> directory on Linux?).
>
> \[Fred L. Drake, Jr.\]
> >> It's been a long time since this was the case on Unix of any variety; I
> >> \*think\* this changed to the current state back before 2.0\.
>
> \[Martin v. L?wis\]
> > Please check again:
> >
> > \[GCC 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)\] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import sys
> > >>> sys.path
> > \['', '/usr/lib/python23.zip', '/usr/lib/python2.3',
> > '/usr/lib/python2.3/plat-linux2', '/usr/lib/python2.3/lib-tk',
> > '/usr/lib/python2.3/lib-dynload',
> > '/usr/local/lib/python2.3/site-packages',
> > '/usr/lib/python2.3/site-packages',
> > '/usr/lib/python2.3/site-packages/Numeric',
> > '/usr/lib/python2.3/site-packages/gtk-2.0', '/usr/lib/site-python'\]
> >
> > We still have the empty string in sys.path, and it still
> > denotes the current directory.
>
> Well, that's in interactive mode, and I see sys.path\[0\] == "" on both
> Windows and Linux then. I don't see "" in sys.path on either box in
> batch mode, although I do see the absolutized path to the current
> directory in sys.path in batch mode on Windows but not on Linux -- but
> Mark Hammond says he doesn't see (any form of) the current directory
> in sys.path in batch mode on Windows.
>
> It's a bit confusing ;-)
>
Been bit by this in the past. On windows, it's a relative path in interactive mode and absolute path in non-interactive mode.