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

--HG--
extra : transplant_source : %EA%EF%E4LP%E2%A7%D6%1C%D5%05%40%EFY%5E%FE%0B%8B.o