Bug 975550 Handle python 2.6 when preventing invalid utf-8 being writting to test files. r=ted