def get_fileobject(self, dir=None, **kwargs):
if dir is None:<EOL><INDENT>dir = os.path.normpath(os.path.dirname(self._path))<EOL><DEDENT>descriptor, name = tempfile.mkstemp(dir=dir)<EOL>os.close(descriptor)<EOL>kwargs['<STR_LIT>'] = self._mode<EOL>kwargs['<STR_LIT:file>'] = name<EOL>return io.open(**kwargs)<EOL>
Return the temporary file to use.