[Python-Dev] sys.path in interactive session
Bob Ippolito
bob at redivi.com
Fri Jun 3 02:08:54 CEST 2005
On Jun 2, 2005, at 4:50 PM, Guido van Rossum wrote:
> On 6/2/05, Reinhold Birkenfeld <reinhold-birkenfeld-
> nospam at wolke7.net> wrote:
>
>> While looking at bug #779191, I saw that sys.path's first element
>> is '' in interactive sessions, but the current dir otherwise. Is this
>> intentional?
>>
>
> I've always liked it this way; using "" instead of "." means that if
> you os.path.join() it with a script name you don't get a spurious "./"
> prepended.
>
> I think that the "absolutizing" of sys.path entries is relatively new
> (seems to have started in 2.3).
>
> Also note that it's not really the current directory but the directory
> containing the script; that is definitely intentional.
The absolutizing of sys.path in site.py is misbehavior anyway.. it
spits in the face of path hooks, for example <http://mail.python.org/
pipermail/python-dev/2005-April/052885.html>.
I still haven't committed that patch, I haven't had a whole lot of
Python-time lately with co-founding a new company, preparing to move,
WWDC, etc... but nobody bothered to complain, so if someone wants to
commit <http://python.org/sf/1174614> before I get a chance, feel free!
-bob
More information about the Python-Dev
mailing list