gh-127691: add type checks when using PyUnicodeError objects
#127694
+157
−68
Merged