This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Malcolm Smith
Recipients Malcolm Smith, lys.nikolaou, serhiy.storchaka, xnovakj, xtreak
Date 2020-05-28.18:59:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590692345.8.0.214972469978.issue34931@roundup.psfhosted.org>
In-reply-to
Content
> Try for example create/rename .somename.jpg file in Ubuntu.
> It is normal image with .jpg extension. You could open it etc.
>
> You can't use standard python splitext() function to detect extension.

Yes you can (Python 3.8.2):

>>> splitext(".somename.jpg")
('.somename', '.jpg')

Only leading dots are treated specially. If there are non-leading dots later in the name, then the filename will be split at the last one.

So the only remaining question is weird filenames like ".....jpg". There's no way to know whether that's supposed to be a name with an extension, or a dot-file with multiple leading dots. Either choice would be reasonable, but we've already gone with the second one. 

Maybe sometimes you might prefer the other way, but such filenames are so rare that I can't imagine we'd ever add an option for this. So I think this issue can be closed.
History
Date User Action Args
2020-05-28 18:59:05Malcolm Smithsetrecipients: + Malcolm Smith, xnovakj, serhiy.storchaka, lys.nikolaou, xtreak
2020-05-28 18:59:05Malcolm Smithsetmessageid: <1590692345.8.0.214972469978.issue34931@roundup.psfhosted.org>
2020-05-28 18:59:05Malcolm Smithlinkissue34931 messages
2020-05-28 18:59:05Malcolm Smithcreate