[Python-Dev] Re: Change to sys.path[0] for Python 2.3

Martin v. Loewis martin@v.loewis.de
Wed, 21 Nov 2001 22:02:21 +0100


> This insertion occurs after a number of imports have already
> occurred.  Specifically, it occurs after the import of site, os, and
> sitecustomize.  This is confusing.  It is clear that sys.path should
> not change unless the user changes it.

I disagree. It is clear that sys.path will change during "bootstrap",
e.g. as the result of processing .pth files.

> If we want the directory of the script to be sys.path[0], then an
> absolute path should be inserted.

I think this would be unimplementable in the general case.

> If everyone agrees, I will create a patch.

It's not clear to me what this patch would do, so I disagree.

Regards,
Martin