[Bug 44728] New: Bad windows version detection with python module " platform"

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Mar 13 15:45:04 CDT 2018


https://bugs.winehq.org/show_bug.cgi?id=44728

            Bug ID: 44728
           Summary: Bad windows version detection with python module
                    "platform"
           Product: Wine
           Version: 3.3
          Hardware: x86-64
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
          Assignee: wine-bugs at winehq.org
          Reporter: gillg02 at hotmail.com
      Distribution: ---

If you use a python script (for exemple built-in into an installer) wich use
native module "platform" to detect OS platform and version, you could have a
bad version number regarding your wine config.

Here, an extract of native "platform.py" file (python 3.5), and the line wich
cause this issue + a test to patch it temporarly.


def win32_ver(release='', version='', csd='', ptype=''):
    try:
        from sys import getwindowsversion
    except ImportError:
        return release, version, csd, ptype
    try:
        from winreg import OpenKeyEx, QueryValueEx, CloseKey,
HKEY_LOCAL_MACHINE
    except ImportError:
        from _winreg import OpenKeyEx, QueryValueEx, CloseKey,
HKEY_LOCAL_MACHINE

    winver = getwindowsversion()
    maj, min, build = winver._platform_version or winver[:3]

    ########## Begin PATCH for WineHQ ############
    maj, min, build = winver[:3]
    ########## End PATCH for WineHQ ############

    version = '{0}.{1}.{2}'.format(maj, min, build)

    release = (_WIN32_CLIENT_RELEASES.get((maj, min)) or
               _WIN32_CLIENT_RELEASES.get((maj, None)) or
               release)


For a win10 configured, see dumps below :

winver._platform_version => (5, 1, 2600)
winver[:3] => (10, 0, 15063)

I don't know exactly why, but somwhere in windows confs or dlls something is
wrong.

For information, getwindowsversion() seems to be a wrapper of Win function
GetVersionEx()

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list