[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds
Daniel Stutzbach
report at bugs.python.org
Sat May 8 17:48:40 CEST 2010
Daniel Stutzbach <daniel at stutzbachenterprises.com> added the comment:
On Sat, May 8, 2010 at 10:16 AM, Marc-Andre Lemburg
<report at bugs.python.org> wrote:
> Are you sure this doesn't get optimized away in practice ?
I'm sure it doesn't get optimized away by gcc 4.3, where I tested it. :)
> Sure, though, I don't see how this relates to C code relying
> on these details, e.g. a C extension will probably use different
> conversion code depending on whether UCS2 or UCS4 is compatible
> with some external library, etc.
Can you give an example?
All of the examples I can think of either:
- poke into PyUnicodeObject's internals,
- call a Python function that exposes Py_UNICODE or PyUnicodeObject
I'm explicitly trying to protect those two cases. It's quite possible
that I'm missing something, but I can't think of any other unsafe way
for a C extension to convert a Python Unicode object to a byte string.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8654>
_______________________________________
More information about the Python-bugs-list
mailing list