Re: Q on module names.

Hammond, Mark ((@)
Sat, 27 Aug 94 11:10:00 PDT

Thanks for the reply...
>Translating relative pathnames into absolute pathnames is a tricky and
>very non-portable business which I'd rather avoid -- especially on
>UNIX sites that use automount facilities, since there the absolute
>pathname will not have a permanent meaning.
>
>A better solution is to avoid having relative pathnames in sys.path.
>The moment this matters most is when the .pyc file is created, e.g. by
>doing "import importall" after the library is installed. (BTW an
>improved version of that hack will be in 1.1.)

Although I agree in principle with trying to keep to absolute path names on
sys.path, '.' and a couple of others are sort-of special cases.

But anyway, problem is, Python goes and sticks '.' and "..\lib" on the path
for you when it starts up. I could remove this from the NT implementation,
but I dont think that is sensible.

I can see your point about the difficulties with resolving absolute paths.

A possible fairly easy solution would be to store the cwd of the process
with the code object when loaded. Then, if a program really needed to know
the absolute file name, it could attempt reconstruction given this.

Most paths can use absolute, but '.' seems to be a problem, and also fairly
necessary, as I _want_ to be able to change directories, and load modules
from there (even though it wont be on the path)

Mark.