This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: many os.path functions bahave inconsistently
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: akuchling, jlgijsbers, simon.percivall
Priority: normal Keywords:

Created on 2004-04-04 18:45 by simon.percivall, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg20425 - (view) Author: Simon Percivall (simon.percivall) Date: 2004-04-04 18:45
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.
msg20426 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2004-06-05 16:18
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). 
msg20427 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2004-06-05 16:33
Logged In: YES 
user_id=11375

Closing.
History
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 40120
2004-04-04 18:45:22simon.percivallcreate