import posixpath


def split_entry_ext(path):
    """Like os.path.splitext, but take off .tar too.

    Taken from `pip._internal.utils.misc.splitext`.
    """
    base, ext = posixpath.splitext(path)
    if base.lower().endswith('.tar'):
        ext = base[-4:] + ext
        base = base[:-4]
    return base, ext