[New-bugs-announce] [issue17432] PyUnicode_ functions not accessible in Limited API on Windows
Bill Dirks
report at bugs.python.org
Fri Mar 15 23:18:04 CET 2013
New submission from Bill Dirks:
This issue was discovered in 3.3.0 on Windows. Haven't looked at other versions.
Using the Limited API, the PyUnicode_Xxxx() functions are not accessible. A simple demonstration of the problem:
HMODULE p3 = ::LoadLibraryA("C:\\Python33\\DLLs\\python3.dll");
FARPROC f;
f = GetProcAddress(p3, "Py_IsInitialized"); // works
f = GetProcAddress(p3, "PyImport_AppendInittab"); // works, and so on
f = GetProcAddress(p3, "PyUnicode_FromString"); // fails
f = GetProcAddress(p3, "PyUnicode_FromFormat"); // fails
f = GetProcAddress(p3, "PyUnicode_FromStringAndSize"); // fails, and so on
::FreeLibrary(p3);
After some digging I found that python3.dll refers all of its exports on to python33.dll, and the problem exports all have the form:
PyUnicode_Xxxx -> python33.PyUnicodeUCS2_Xxxx
but python33.dll does not export any PyUnicodeUCS2_ symbols, confirmed by the Dependency Walker tool.
Any Limited API extension using PyUnicode_ functions will compile and link, but fail at runtime. If I understand the problem, the fix is just to correct the .def file.
----------
components: Windows
messages: 184268
nosy: bdirks
priority: normal
severity: normal
status: open
title: PyUnicode_ functions not accessible in Limited API on Windows
type: behavior
versions: Python 3.3
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17432>
_______________________________________
More information about the New-bugs-announce
mailing list