On Sat, Sep 18, 2010 at 2:39 PM, Chris Withers <chris at simplistix.co.uk> wrote: > I'm curious as to why, with a file called "Foo.txt" on a case descriminating > but case insensitive filesystem, os.path.normcase('FoO.txt') will return > "foo.txt" rather than "Foo.txt"? > > Yes, I know the behaviour is documented, but I'm wondering if anyone can > remember the rationale for that behaviour? Because normcase() and friends never look at the filesystem. Of course, exists() and isdir() etc. do, and so does realpath(), but the pure parsing functions don't. They can be used without a working filesystem even. (E.g. you can import ntpath on a Unix box and happily parse Windows paths.) -- --Guido van Rossum (python.org/~guido)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4