Jan Novak <xnov...@seznam.cz> added the comment:

Thank you all for discussion and partial solution in latest Python versions and 
extending documentation.

For the future development of Python the initial question remains.
How to easy detect extensions for each file with standard python library 
function. Without programing own function to fix it.

Filenames with more dots could exist both in Unix and Windows worlds.
Nobody can't say (for example web app users). Please not use those files.

Python 3.10.1
Works fine:
>>> os.path.splitext('.some.jpg')
('.some', '.jpg')
>>> os.path.splitext('..some.jpg')
('..some', '.jpg')

Not usable:
>>> os.path.splitext('....jpg')
('....jpg', '')

There are some possible ways:
- new parametr
- new function
- change backward compatibility
- stay buggy forever

Thank you

----------
status: closed -> open
versions: +Python 3.10

_______________________________________
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

Reply via email to