Tests tempfile
Uses surrogateescape on Python 3