[Patches] [ python-Patches-536120 ] splitext and leading point of hidden files

noreply@sourceforge.net noreply@sourceforge.net
Thu, 28 Mar 2002 00:02:48 -0800


Patches item #536120, was opened at 2002-03-28 02:28
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=536120&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Sebastien Keim (s_keim)
Assigned to: Nobody/Anonymous (nobody)
Summary: splitext and leading point of hidden files

Initial Comment:
The posixpath.splitext function doesn't do the right thing with leading point of hidden files. For sample: splitext('.emacs')==('','.emacs').
The patch is intended to leave the leading point as part of the name.

Existing code will possibly break, so this patch
is probably quite controversial. If the behaviour change is rejected, the patch could be modified to improve performances without behaviour changes.


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-03-28 03:02

Message:
Logged In: YES 
user_id=31435

I expect this change has scant chance of being accepted.

The idea that leading dot means "hidden" is an arbitrary 
convention of the ls utility, and your desire to call 
a .name file "pure name" instead of "pure extension" seems  
arbitrary too.  The behavior of splitext is perfectly 
predictable as-is across platforms now (note the 
implication:  if you intend to change the semantics for 
posixpath, you'll also have to sell that it should be 
changed for dospath.py, ntpath.py, macpath.py, 
os2emxpath.py, and riscospath.py).

Note that the patched function splits, e.g.,

'/usr/local/tim.one/seven'

into

'/usr/local/tim'

and

'.one/seven'

I assume that's not the result you intended.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=536120&group_id=5470