[Python-ideas] PEP 428 - object-oriented filesystem paths
p.f.moore at gmail.com
Wed Oct 10 11:54:58 CEST 2012
On 10 October 2012 09:16, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
>> But how important is all this anyway? I'm trying to think of
>> occasions when I've wanted to compare two entire paths for
>> equality, and I can't think of *any*.
> AFAIK the only place I care about case sensitivity in my code is when I'm basicly using glob or fnmatch.
Mercurial had to consider this issue when dealing with repositories
built on Unix and being used on Windows. Specifically, it needed to
know, if the repository contains files README and ReadMe, could it
safely write both of these files without one overwriting the other.
Actually, something as simple as an unzip utility could hit the same
issue (it's just that it's not as critical to be careful with unzip as
with a DVCS system... :-))
I don't know how Mercurial fixed the problem in the end - I believe
the in-repo format encodes filenames to preserve case even on case
insensitive systems, and I *think* it detects case insensitive
filesystems for writing by writing a test file and reading it back in
a different case. But that may have changed.
More information about the Python-ideas