[Python-Dev] Why does python use relative instead of absolute path when calling LoadLibrary*

Wes Turner wes.turner at gmail.com
Thu Mar 12 03:41:37 CET 2015


On Mar 11, 2015 3:36 PM, "David Cournapeau" <cournape at gmail.com> wrote:
>
> Hi,
>
> While looking at the import code of python for C extensions, I was
wondering why we pass a relative path instead of an absolute path to
LoadLibraryEx (see bottom for some context).
>
> In python 2.7, the full path existence was even checked before calling
into LoadLibraryEx (
https://github.com/python/cpython/blob/2.7/Python/dynload_win.c#L189), but
it looks like this check was removed in python 3.x branch.
>
> Is there any defined behaviour that depends on this path to be relative ?

Just a guess: does it have to do with resolving symlinks (w/ POSIX
filesystems)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150311/96493110/attachment.html>


More information about the Python-Dev mailing list