def temp_file_for(path):
 ext = os.path.splitext(path)[1]
 with NamedTemporaryFile(suffix=util.py3_path(ext), delete=False) as f:
  return util.bytestring_path(f.name)

def temp_file_for ( path ) : ext = os . path . splitext ( path ) [ 1 ] with NamedTemporaryFile ( suffix = util . py3_path ( ext ) , delete = False ) as f : return util . bytestring_path ( f . name )
return an unused filename with the same extension as the specified path .