.pth in current directory: Why doesn't it work as the documentation says?

Philipp Hagemeister phihag at phihag.de
Mon May 18 08:34:33 EDT 2009


David Lyon wrote:
> (...)
>> 1&2 => 3) A file test.pth with the content "/example/" should result in
>> sys.path containing "/example/".
> 
> No. Python, once finding the .pth will process it. 

Yes, but that processing will add /example/ to sys.path, right?

>> 4) "" (the current directory) is the first element of my sys.path
> 
> Not always - but maybe it is. Let's not assume anything.

Of *my* sys.path. And by default, I think it is.

> (...)
>> I think I misinterpreted the documentation, but what exactly is wrong
> here?
> 
> What are you expecting? and maybe we can tell you why you aren't getting
> it...
> 
> David

I'm expecting .pth files in the current directory to be be processed,
according to docs/install/. Christian Heimes already pointed out this is
not the case; so I'm wondering whether this is a mistake in the
documentation or just my faulty logic.

Cheers,

Philipp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20090518/d8bca3ea/attachment.sig>


More information about the Python-list mailing list