[Python-Dev] os.path.normcase rationale? (original) (raw)
Chris Withers chris at simplistix.co.uk
Tue Oct 5 10:21:15 CEST 2010
- Previous message: [Python-Dev] API for binary operations on Sets
- Next message: [Python-Dev] os.path.normcase rationale?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 25/09/2010 04:25, Steven D'Aprano wrote:
1. Return the case of a filename in some canonical form which depends on the file system? 2. Return the case of a filename as it is actually stored on disk?
How do 1 and 2 differ? FWIW, the use case that setuptools has (and for which it currently incorrectly uses normpath) is number 2.
4. Return the case of a filename in some arbitrarily-chosen canonical form which does not depend on the file system?
This is what normpath does, but only if you're on Windows ;-) I still don't really get the use case of normpath in its current form, at all...
Various people have posted links to recipes that solve case #2. Note though that this necessarily demands that if the file doesn't exist, it should raise an exception.
Fine by me, shame it seems to require iteration to find an answer though :-S
The very concept of canonical form for file names is troublesome.
I would have thought "whatever is shown when doing an ls/dir/etc" (and don't be smart and think about mentioning that oyu can get dir to output 8.3 as well as the full path ;-) )
Chris
-- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
- Previous message: [Python-Dev] API for binary operations on Sets
- Next message: [Python-Dev] os.path.normcase rationale?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]