TST: open the TemporaryFile in ASCII mode

This should fix gh-3165.