[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel
Change by Irit Katriel : -- components: +Library (Lib) resolution: fixed -> ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Jan Novak
Jan Novak added the comment: It is interesting that pathlib.Path works fine: >>> pathlib.Path('jpg').suffix '.jpg' >>> pathlib.Path('path/jpg').suffix '.jpg' -- ___ Python tracker __

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Jan Novak
Jan Novak 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

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel
Irit Katriel added the comment: New changeset 4a792ca95c1a994b07d18fe06e2104d5b1e0b796 by Miss Islington (bot) in branch '3.9': bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) (GH-30369) https://github.com/python/cpython/commit/4a792c

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel
Irit Katriel added the comment: New changeset 8184a613b93d54416b954e667951cdf3d069cc13 by Miss Islington (bot) in branch '3.10': bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) (GH-30368) https://github.com/python/cpython/commit/8184a

[issue34931] os.path.splitext with more dots

2022-01-03 Thread miss-islington
Change by miss-islington : -- pull_requests: +28582 pull_request: https://github.com/python/cpython/pull/30369 ___ Python tracker ___ __

[issue34931] os.path.splitext with more dots

2022-01-03 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +28581 pull_request: https://github.com/python/cpython/pull/30368 ___ Python tracker _

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel
Irit Katriel added the comment: New changeset 51700bf08b0dd4baf998440b2ebfaa488a2855ba by Irit Katriel in branch 'main': bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) https://github.com/python/cpython/commit/51700bf08b0dd4baf998440b

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Well, so we can keep term "extension". But I think it is worth to clarify that "leading periods" is related to the last component, not the whole path. It is related to the original issue. -- ___ Python tracker

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Eryk Sun
Eryk Sun added the comment: > On Windows the extension of "python.exe" is "exe", not ".exe". FWIW, a file extension in Windows includes the dot. Trailing dots are stripped from filenames, so a file can't be named "python." because it's the same as just "python". (It's possible to prevent st

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are other issues with the documentation of splitext(). 1. It uses term "extension" (it is even a part of function name), but it is vague and usually does not include a period. On Windows the extension of "python.exe" is "exe", not ".exe". On Unix ter

[issue34931] os.path.splitext with more dots

2022-01-02 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch nosy: +iritkatriel nosy_count: 5.0 -> 6.0 pull_requests: +28559 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30347 ___ Python tracker _

[issue34931] os.path.splitext with more dots

2020-05-28 Thread Malcolm Smith
Malcolm Smith added the comment: > 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")

[issue34931] os.path.splitext with more dots

2018-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Related issues: issue536120, issue1115886, issue1462106, issue1681842, issue19191. Python-Dev discussions: https://mail.python.org/pipermail/python-dev/2007-March/071557.html https://mail.python.org/pipermail/python-dev/2007-March/071935.html

[issue34931] os.path.splitext with more dots

2018-10-29 Thread Jan Novak
Jan Novak added the comment: Yes, dot behaviour is well documented. But splitext() is a function to split name and extension, not take care about hidden files. Hidden files starting with dot is Unix like system feature. https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory Hidden f

[issue34931] os.path.splitext with more dots

2018-10-28 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: IMHO this is not a bug. Every file starting with a dot is hidden by default, so this is somewhat correct behaviour. Since it is documented correctly I don't this something needs to change here. Yet again, could someone more experienced offer their opinio

[issue34931] os.path.splitext with more dots

2018-10-08 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue34931] os.path.splitext with more dots

2018-10-08 Thread Jan Novak
New submission from Jan Novak : 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