[Python-ideas] Small enhancement to os.path.splitext

Tarek Ziadé ziade.tarek at gmail.com
Tue Apr 20 17:48:01 CEST 2010


On Tue, Apr 20, 2010 at 5:44 PM, M.-A. Lemburg <mal at egenix.com> wrote:
[..]
>
> They typically use the 'longest match wins' strategy and then
> use the match extension as file extension.

A split from the first right dot is also fine with me:

>>> os.path.splitext('file.tar.gz', longest_match=True)
('file', '.tar.gz')

Tarek



More information about the Python-ideas mailing list