[issue25824] 32-bit 2.7.11 installer creates registry keys that are incompatible with the installed python27.dll

Arnaud Diederen report at bugs.python.org
Tue Dec 8 09:16:40 EST 2015


New submission from Arnaud Diederen:

[First of all let me say I'm not all that familiar with Windows, so please let me know if the wording in my analysis below is not clear and/or misleading.]

It would appear the 32-bit installer for Python 2.7.11 creates the registry key:
---
HKLM\Software\Wow6432Node\Python\PythonCore\2.7\PythonPath
---
(...just like previous 2.7 versions did.)

However, registry accesses (PC/getpathp.c's getpythonpath()) are done like so:
---
    (...)
    keyBuf = keyBufPtr = PyMem_RawMalloc(keyBufLen);
    if (keyBuf==NULL) goto done;

    memcpy_s(keyBufPtr, keyBufLen, keyPrefix, sizeof(keyPrefix)-sizeof(WCHAR));
    keyBufPtr += Py_ARRAY_LENGTH(keyPrefix) - 1;
    mbstowcs(keyBufPtr, PyWin_DLLVersionString, versionLen);
    (...)
---
where 'PyWin_DLLVersionString' now is "2.7-32":
---
.rsrc:1E2760FA                 unicode 0, <2.7-32>,0
---
(it used to be "2.7" in previous versions) 


Thus, the key that python27.dll builds is:
 HKLM\Software\Wow6432Node\Python\PythonCore\2.7-32\PythonPath
and not
 HKLM\Software\Wow6432Node\Python\PythonCore\2.7\PythonPath

and consequently the runtime cannot build a proper sys.path, which causes embedded interpreters to fail loading core modules.

As a workaround, it seems renaming the registry key to its "-32"-suffixed name, does help.

----------
components: Installation
messages: 256113
nosy: aundro
priority: normal
severity: normal
status: open
title: 32-bit 2.7.11 installer creates registry keys that are incompatible with the installed python27.dll
type: behavior
versions: Python 2.7

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


More information about the Python-bugs-list mailing list