If PyUnicodeWriter_WriteUTF8() or PyUnicodeWriter_Format() fails, the writer should remain valid and usable for further writes. These functions can change the buffer kind to support write larger character. But if these functions fail, PyUnicodeWriter_Finish() may need to change the buffer kind to use the most efficient storage for the final string.
Linked PRs
If PyUnicodeWriter_WriteUTF8() or PyUnicodeWriter_Format() fails, the writer should remain valid and usable for further writes. These functions can change the buffer kind to support write larger character. But if these functions fail, PyUnicodeWriter_Finish() may need to change the buffer kind to use the most efficient storage for the final string.
Linked PRs