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.

Title: os.path.splitext in windows , a little question
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.3
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: tim.golden,
Priority: normal Keywords:

Created on 2013-10-08 15:25 by, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
fileext.JPG, 2013-10-08 15:25
Messages (2)
msg199208 - (view) Author: xiaowei ( Date: 2013-10-08 15:25
>>> print( os.path.splitext.__doc__ )
Split the extension from a pathname.

    Extension is everything from the last dot to the end, ignoring
    leading dots.  Returns "(root, ext)"; ext may be empty.
>>> os.path.splitext('.txt')
('.txt', '')

I think, in windows it should be ('','.txt'), because the first dot doesnot mean hiding. Actually, in windows file explorer , it will show a empty file name and hide the extension if the extension has been related a program except shell32.dll,just like the attachment show. So, in windows, the last dot , even it's the first character of the file name, it still means the start of the file extension name.

In this case, windows doesnot like linux, we donot have to make them same. 

If you agree, then
why we can talk ignoring leading dots or not ......
i mean

Anyway, thank you , for your work, even you donot think so
msg199209 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2013-10-08 15:31
This was implemented after discussion in issue1115886:

and python-dev:

In short, it could have gone either way and it went this way.
Date User Action Args
2022-04-11 14:57:51adminsetgithub: 63390
2013-10-12 00:03:26terry.reedysetstatus: open -> closed
2013-10-08 15:32:22tim.goldensetresolution: wont fix
stage: resolved
2013-10-08 15:31:43tim.goldensetnosy: + tim.golden
messages: + msg199209
2013-10-08 15:25:06xiaowei.pycreate