import statement is case sensitive

Chris Gonnerman chris.gonnerman at usa.net
Thu Feb 22 08:49:58 EST 2001


----- Original Message -----
From: "Costas Menico" <costas at meezon.com>
Subject: Re: import statement is case sensitive
> 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.

Not really.  You are forgetting that the difficulty in getting file and
directory names in the right case in Windows simply doesn't trouble
Unixoid OS's.

> I am trying to run an an application under Windows and now I have to
> worry if my directory name is in the correct case. I use PythonWin (a
> fantastic product) to run and test it. There is no option for telling
> it to ignore the case of the import filenames that I could see.

When you save files in PythonWin it understands it must get the case
right, so I'd be surprised if you type them right if it doesn't save them
right.

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

I use MinGW32 tools on my computer; others like CygWin.  Both provide
Unix-like commands for the Windows environment, and either will make
your problems easier to handle.

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

I don't know if it is a GOOD use, but the Python GTK bindings do that with
a module named gtk.py and one named GTK.py (the first is the binding module,
the second is it's constants) and this causes problems on Windows.  The most
common port of this code to Windows renames the second file GTKconst.py,
to avoid the name collision.

Anyway, many of the standard modules are named in mixed case.  Windows may
be the most popular desktop OS in the world, but in the realm of open-source
development it's often considered a (broken) niche environment.







More information about the Python-list mailing list