import statement is case sensitive

Alex Martelli aleaxit at
Thu Feb 22 09:56:06 CET 2001

"Costas Menico" <costas at> wrote in message
news:3a947ac4.802440 at News.CIS.DFN.DE...
> "Lyle Johnson" <ljohnson at> wrote:
> >> Also what is the purpose of even having it case sensitive. I've yet to
> >> see a file system that has case sensitive filenames....
> >
> >There is an operating system called "Unix" that has case-sensitive file
> >names. There is a slight chance that others on this newsgroup have also
> >heard of this obscure operating system.
> Well given the fact that Linux and Windows is beating it to death I
> can see why Unix is becoming obscure :)

Linux is identical to Unix in this respect (and in most others; it
IS a version of Unix in all respects except trademarks &c).

> Actually I would consider this a shortcoming of Unix. Shipping a
> product that depends on the directory names and files being in the
> right case must cause all sorts of headaches.

Debatable, although I would tend to agree.  Internationalization
issues make "case-insensitive" a big problem, though -- the uppercase
equivalent of, say, "e with an acute accent", depends so much
on the character-encoding in use.

I consider it a similar bug (and Windows and Mac share it with
Unix) to allow spaces, tabs, and other whitespace characters in
filenames, by the way.  The driving idea behind all such things
is, I guess, to make it possible for the user to name his or
her file as he/she wants, with entire sentences, etc; I do NOT
like this, I'd rather see filenames as "identifiers" for the
files.  But I guess this marks me as a dinosaur, once again.

> And renaming directories and files is not an easy option.. But anyway,
> this is should automatically be handled in Python depending on the OS.

In Windows, you cannot _directly_ rename a file or directory
to change its case (a Windows bug, I'd say); you have to
    rename Foo tempname
    rename tempname foo
because trying to directly do
    rename Foo foo
will fail.

It _would_ definitely be easier for the user if Python 'knew'
a given filesystem is case-insensitive and compensated for that.

> Why would asnyone make the same filenames with different cases? Is
> there a good use?

There are a few uses (e.g., some C++ compilers take xx.c as a file
in the C languace, xx.C as one in the C++ language) but I would not,
personally, call them "good".


More information about the Python-list mailing list