[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

"Martin v. Löwis" <report@bugs.python.org> at psf.upfronthosting.co.za "Martin v. Löwis" <report@bugs.python.org> at psf.upfronthosting.co.za
Fri May 22 21:58:12 CEST 2009


Martin v. Löwis <martin at v.loewis.de> added the comment:

> The first warning might be a problem.  I understand from the docs
> (http://msdn.microsoft.com/en-us/library/aa363866.aspx) that all I need
> to do is include windows.h, which is already included... but still the
> function prototype isn't present.  This might be because a preprocessor
> declaration of WINVER isn't set high enough... but since the same
> executable is built for all versions of Windows, how is this reconciled
> in the compiler?

Good point. Unfortunately, backwards compatibility requires this to
be hackish. We currently strive for compatibility with Windows 2000,
so we cannot statically reference these functions (unless we increase
the minimum required Windows version - but we surely have to support XP
for many years to come).

So, in essence, you need to GetProcAddress. See other examples in
posixmodule.c for how this is done, and raise an exception
(NotImplementedError? WindowsError with ERROR_CALL_NOT_IMPLEMENTED
?) if you can't find the function.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1578269>
_______________________________________


More information about the Python-bugs-list mailing list