[capi-sig] Garbage output from warnings with embedded python

Campbell Barton ideasman42 at gmail.com
Fri Feb 20 04:24:27 CET 2009

Recently I wanted to deprecate some functions in our the C api, and
found that warnings give weired output when running through through
our C api.

A simple test is to do this...

print range(1.5)

When I run this from python I get good output..
test.py:1: DeprecationWarning: integer argument expected, got float
print range(1.5)

But when running from our C api I get

DeprecationWarning: integer argument expected, got float
  ELF�p40�"4()&44�4�44�4�����F��F��F�K	�K	ğ<@G�K	�K	xxHH�H�
 P�td�2?��C	��C	L,L,Q�td/lib/ld-linux.so.2GNU����8�1LQ
                                              �U�N�.yH	{��d

I thought this was todo with running a compiled string so I tried
PyRun_String() on the text buffer instead of PyEval_EvalCode() but the
same problem.
Id be interested to know if anyones embedded python gives proper warnings.
On Linux testing with python 2.6 here.

- Campbell

More information about the capi-sig mailing list