mhammond / pywin32

Python for Windows (pywin32) Extensions
4.91k stars 783 forks source link

NanoServer Support #1146

Open dhirschfeld opened 6 years ago

dhirschfeld commented 6 years ago

Although this has been discussed on grokbase I can't see an existing issue so I'm opening this here/now so it doesn't get lost.

As discussed in the linked grokbase issue pywin32 will throw DLL load errors on import due to missing APIs on NanoServer.

In that issue @alexpilotti linked to his PoC patch for NanoServer.

In case it's useful a list of supported APIs on NanoServer is available at: https://msdn.microsoft.com/en-us/library/mt588480(v=vs.85).aspx

dhirschfeld commented 6 years ago

For my part, I'd be happy for the missing APIs to simply be not-available on NanoServer so long as pywin32 could still be imported and use what APIs are available.

Failing on import means that any package which uses pywin32 breaks whether or not they use the unsupported APIs

dhirschfeld commented 6 years ago

xref: ContinuumIO/anaconda-issues#2387

mhammond commented 6 years ago

The referenced patch introduces new #ifdef statements, which means new builds will be necessary specifically for NanoServer - which doesn't really worry me from the perspective of the source code, but I'm unlikely to build twice as many binaries for each release, meaning I'm concerned it will still not end up being useful in practice. There may be other approaches that could be used, such as doing LoadLibrary on the functions used, or even moving some of the problematic functions into a new .pyd file.

Either way, this isn't really actionable for me at the moment.

dhirschfeld commented 6 years ago

That's fine. I guess it can be kept open as a feature request and to collect any discussion around what is required.

adiroiban commented 5 months ago

Does anyone has a copy of the patch ?

I am looking at the following links and they are no longer available and I can't find them on Wayback Machine :(

http://grokbase.com/t/python/python-win32/1596wzvvmr/pywin32-on-nano-server https://bitbucket.org/cloudbase/pywin32/commits/cae1b44e00195847312a4521ae6c5cca3bb5b195