New submission from Jan Novak <xnov...@users.sourceforge.net>:
There are some old tickets about changing splitext() in 2007: https://bugs.python.org/issue1115886 https://bugs.python.org/issue1681842 Present python documentation: Leading periods on the basename are ignored; splitext('.cshrc') returns ('.cshrc', ''). Changed in version 2.6: Earlier versions could produce an empty root when the only period was the first character. But nobody take care about more than one dots: For example this possible corect filenames: >>> os.path.splitext('....jpg') ('....jpg', '') So present function is insuficient (buggy) to use to detect right extension. Maybe new parameter would be helpfull for that? Like parameter "preserve_dotfiles" discussed in 2007. And what to do with the wrong '.', '..', '...', ... filenames? ---------- messages: 327346 nosy: xnovakj priority: normal severity: normal status: open title: os.path.splitext with more dots type: behavior _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34931> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com