'Create a temporary directory and assign it into `self.temp_dir`.
Call `remove_temp_dir` later to delete it.'

def create_temp_dir(self):

    path = tempfile.mkdtemp()
    if (not isinstance(path, bytes)):
        path = path.encode('utf8')
    self.temp_dir = path
