I have embedded a Python interpreter in a C program. Suppose the C program reads some bytes from a file into a char array and learns (somehow) that the bytes represent text
Try calling PyErr_Print() in the "if (!py_string)" clause. Perhaps the python exception will give you some more information.
if (!py_string)