[ python-Bugs-929316 ] many os.path functions bahave inconsistently

SourceForge.net noreply at sourceforge.net
Sun Apr 4 14:45:23 EDT 2004


Bugs item #929316, was opened at 2004-04-04 20:45
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=929316&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Simon Percivall (percivall)
Assigned to: Nobody/Anonymous (nobody)
Summary: many os.path functions bahave inconsistently

Initial Comment:
Many os.path functions return different paths before and after 
applying os.path.normpath/os.path.realpath/os.path.abspath, etc. 
Functions such as os.path.basename and os.path.dirname will not 
handle a trailing slash "correctly".

>>> dirs = '/usr/local/'
>>> os.path.dirname(dirs)
'/usr/local'
>>> os.path.basename(dirs)
''
>>>
>>> dirs = os.path.normpath(dirs)
>>> os.path.dirname(dirs)
'/usr'
>>> os.path.basename(dirs)
'local'
>>>

This should be wrong since normpath/realpath/abspath shouldn't 
have such an effect on other os.path functions.

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

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



More information about the Python-bugs-list mailing list