(In numpy headers, PyString_AsString is aliased to PyBytes_AsString.) Besides the reference leaks, this function will fail when given the unicode string returned by PyObject_Str (), and sprintf ...