[ python-Bugs-1115886 ] os.path.splitext don't handle unix hidden file correctly

SourceForge.net noreply at sourceforge.net
Mon Jun 13 16:12:36 CEST 2005


Bugs item #1115886, was opened at 2005-02-04 02:27
Message generated for change (Comment added) made by grubert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1115886&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeong-Min Lee (falsetru)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.path.splitext don't handle unix hidden file correctly

Initial Comment:
I expected this.
>>> os.path.splitext('/path/to/.Hiddenfile')
('/path/to/.Hiddenfile', '')

but got this.
>>> os.path.splitext('/path/to/.Hiddenfile')
('/path/to/', '.Hiddenfile')



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

Comment By: engelbert gruber (grubert)
Date: 2005-06-13 16:12

Message:
Logged In: YES 
user_id=147070

from test_posixpath.py ::

  self.assertEqual(posixpath.splitext(".ext"), ("", ".ext"))
  
IMHO should then return (".ext",""). if this is desired ::

  if i<=p.rfind('/'):                                                                                   
          return p, ''                                                                                  
  else:                                                                                                
          return p[:i], p[i:]                                                                          

should do


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1115886&group_id=5470


More information about the Python-bugs-list mailing list