[issue19191] os.path.splitext in windows , a little question
New submission from xiaowei: >>> 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 os.path.splitext('...ext') Anyway, thank you , for your work, even you donot think so -- components: Windows files: fileext.JPG messages: 199208 nosy: xiaowei.py priority: normal severity: normal status: open title: os.path.splitext in windows , a little question type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file31999/fileext.JPG ___ Python tracker <http://bugs.python.org/issue19191> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17320] os.path.abspath in window7, return error
New submission from xiaowei: assert os.path.split( os.path.abspath('\xe7\x8e\xb0' ) )[-1] == '\xe7\x8e\xb0' # it should be true(no error) but py2.7 in window it's false # and when linux it's ok # os.path.split( os.path.abspath('\xe7\x8e\xb0' ) )[-1] == '\xe7\x8e' # i guess it's a real bug , hope some one can resolve it # i donot try py3.* , i donot know if it exists in 3.* -- components: Windows messages: 183212 nosy: xiaowei.py priority: normal severity: normal status: open title: os.path.abspath in window7, return error type: behavior versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue17320> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17320] os.path.abspath in window7, return error
xiaowei added the comment: thank you os: win7 bit64 python: 2.7.3 >>> import sys,locale >>> print(locale.getdefaultlocale()) ('zh_CN', 'cp936') >>> print(sys.getdefaultencoding()) ascii >>> 祝愉快! 肖微 2013年 月 日 2013/3/18 Amaury Forgeot d'Arc > > Amaury Forgeot d'Arc added the comment: > > There may be an issue with the GetFullPathName system call. > Could you copy the result of these functions: > > import sys, locale > print(locale.getdefaultlocale()) > print(sys.getdefaultencoding()) > > -- > nosy: +amaury.forgeotdarc > > ___ > Python tracker > <http://bugs.python.org/issue17320> > ___ > -- ___ Python tracker <http://bugs.python.org/issue17320> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17320] os.path.abspath in window7, return error
Changes by xiaowei : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue17320> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com