[ python-Bugs-929316 ] many os.path functions bahave inconsistently
SourceForge.net
noreply at sourceforge.net
Sat Jun 5 12:18:19 EDT 2004
Bugs item #929316, was opened at 2004-04-04 20:45
Message generated for change (Comment added) made by jlgijsbers
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.
----------------------------------------------------------------------
Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-06-05 18:18
Message:
Logged In: YES
user_id=469548
Though this may arguably be wrong, it is the explicitly
documented behavior and has been for a long time (see bug
#219485).
----------------------------------------------------------------------
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