[PATCH 1 of 3] Add a new function, filesystem_case

Paul Moore p.f.moore at gmail.com
Wed Apr 23 03:53:15 CDT 2008


On 23/04/2008, Adrian Buehlmann <adrian at cadifra.com> wrote:
>
> Not that I would urge to do so, but what is the reasoning here for not
> using os.path.normcase(leaf) instead of leaf.lower()?
>
> http://docs.python.org/lib/module-os.path.html

That's possible, but there were a couple of discussions recently which
made me a little unsure of how reliable it would be in practice. Also,
using .lower() is a bit more explicit that all I'm doing is case
conversion (and not any Unicode fanciness).

I'm happy to change it if people think using normcase is better.

One advantage of using normcase is that then there's nothing
OS-specific about the code, so it could be made to apply everywhere.
Disadvantages would be (1) it's more expensive, which may not be
acceptable on Unix, and (2) its behaviour depends on normcase, which
may not be approp[riate for (e.g., Mac OS, or Unix on a case
insensitive FS).

Paul.


More information about the Mercurial-devel mailing list