def _get_thintar_prefix(tarname):
    '''
    Make sure thintar temporary name is concurrent and secure.

    :param tarname: name of the chosen tarball
    :return: prefixed tarname
    '''
    tfd, tmp_tarname = tempfile.mkstemp(dir=os.path.dirname(tarname), prefix=".thin-",
                                        suffix="." + os.path.basename(tarname).split(".", 1)[-1])
    os.close(tfd)

    return tmp_tarname
Make sure thintar temporary name is concurrent and secure.

    :param tarname: name of the chosen tarball
    :return: prefixed tarname