Yes. I *know* that it must be a valid string. The problem is what happens if it is not. The Python exception that's raised in this case is accomoanied by your C code not returning NULL, and that's simply wrong according to the Python C interface documentation.