def _tf():
 if six.PY3:
  return tempfile.TemporaryFile(mode='w', encoding='UTF-8')
 return tempfile.TemporaryFile(mode='w')

def _tf ( ) : if six . PY3 : return tempfile . TemporaryFile ( mode = 'w' , encoding = 'UTF-8' ) return tempfile . TemporaryFile ( mode = 'w' )
open a temp file that looks a bunch like stdout .