pythonwindowssua

Python OS-dependent libraries: Windows 7 SUA


When reading the Python docs, many libraries/functions indicate they work differently, or not at all, depending on the operating system.

Most of the libraries depend on whether the OS is POSIX compliant, or Win32.

If so; Fully? Partially? Indeterminant/Untested?

If yes to any of the three previous cases, does python adopt the new posix-os behavior automatically, or does it assume standard win32-os (meaning it must be configured, or perhaps even compiled, to enable the Posix modes)?


Notes


Solution

  • No, installing Subsystem for Unix-based Applications (Windows Services for Unix) doesn't change the behaviour of a binary distribution of Python in any way. The version of Python you're trying to use would have to be specifically built to support the Windows POSIX subsystem in order to take any advantage of it.

    Microsoft's POSIX subsystem is no different than Cygwin in this respect. If you download and install the standard Windows binary distribution of CPython, its behaviour won't change if you later install Cygwin. You'd have to download install the Cygwin version of CPython if you want your Python program to take advantage of Cygwin's Unix emulation environment. Note also that Cygwin version of Python loses much, if not all, of the Windows specific functionality of standard Windows version of CPython.

    You should also be aware that many popular third party Python modules are dependent on C extension modules. These modules have to be built for the specific version of Python you're using. While many of these modules support the standard Windows CPython distributions, and few support Cygwin, you'd need to compile these yourself for the POSIX subsystem.