Does anyone else see this as a good idea?
Well if you don't know the extension you have
the more powerful os.path.splitext().
If you do know the extension then just
use the standard python functionality:
f='file.tar.gz'
if f.endswidth('.tar.gz'):
f=f[:-len('.tar.gz')
It's better not to duplicate the logic I think.
Pádraig.