def __init__(self, prefix='<STR_LIT>'):
self._compression = None<EOL>self._orig_file = None<EOL>temp_dir = securesystemslib.settings.temporary_directory<EOL>if temp_dir is not None and securesystemslib.formats.PATH_SCHEMA.matches(temp_dir):<EOL><INDENT>try:<EOL><INDENT>self.temporary_file = tempfile.NamedTemporaryFile(prefix=prefix,<EOL>dir=temp_dir)<EOL><DEDENT>except OSError as err:<EOL><INDENT>logger.error('<STR_LIT>' + temp_dir + '<STR_LIT>' +repr(err))<EOL>logger.error('<STR_LIT>')<EOL>self._default_temporary_directory(prefix)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._default_temporary_directory(prefix)<EOL><DEDENT>
<Purpose>
  Initializes TempFile.

<Arguments>
  prefix:
    A string argument to be used with tempfile.NamedTemporaryFile function.

<Exceptions>
  securesystemslib.exceptions.Error on failure to load temp dir.

<Return>
  None.