Make the code that ensures that python internal encodings are not ASCII more robust