[issue17432] PyUnicode_ functions not accessible in Limited API on Windows

2013-03-15 Thread Bill Dirks

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 
<http://bugs.python.org/issue17432>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17432] PyUnicode_ functions not accessible in Limited API on Windows

2013-03-15 Thread Bill Dirks

Bill Dirks added the comment:

A great number of PyUnicode functions are already added to the Limited API. 
That is, the declarations are outside of #ifndef Py_LIMITED_API guards in the 
header files, and the symbols are included in python3.lib and exported from 
python3.dll. (in 3.3.0)

Can't those functions link to the functions of the same name in python33.dll?

In other words, for example, PyUnicode_FromString in the python3.dll should 
link to PyUnicode_FromString in python33.dll, not PyUnicodeUCS2_FromString 
(which doesn't exist in python33.dll). Right?

--

___
Python tracker 
<http://bugs.python.org/issue17432>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com