def splitext(path):
    'Like os.path.splitext, but take off .tar too'
    (base, ext) = posixpath.splitext(path)
    if base.lower().endswith('.tar'):
        ext = (base[(- 4):] + ext)
        base = base[:(- 4)]
    return (base, ext)
Like os.path.splitext, but take off .tar too
def splitext(path):
    
    (base, ext) = posixpath.splitext(path)
    if base.lower().endswith('.tar'):
        ext = (base[(- 4):] + ext)
        base = base[:(- 4)]
    return (base, ext)