[Cython] PyErr_Format, bare "%s" format specifier, and Py_TYPE(o)->tp_name

Stefan Behnel stefan_ml at behnel.de
Sun Mar 8 07:53:32 CET 2009


Robert Bradshaw wrote:
> On Mar 2, 2009, at 1:08 PM, Lisandro Dalcin wrote:
> 
>> After a fast view to Stefan's fix for #227, I noticed that Cython uses
>> bare "%s" format specifiers when using PyErr_Format() to print
>> Py_TYPE(o)->tp_name.
>>
>> Perhaps we should follow core CPython convention of using "%.200s" ??
>> . Anyway, core CPython does not follow this rule at all places ;-)
>
> I'm not opposed to this, though the only place I could see it being
> very useful is in case Py_TYPE(o)->tp_name doesn't really point to a
> string because something really got messed up.

Fine with me, too.

Stefan


More information about the Cython-dev mailing list