[Python-Dev] Case sensitive import.

Guido van Rossum guido@digicool.com
Mon, 12 Feb 2001 17:23:21 -0500


> [Sorry for letting this thread hang, but I'm back from paternity leave
> so I will be more responsive now.  Well, at least between normal business
> hours that is.]
> 
> On Mon, Feb 05, 2001 at 04:01:49PM -0500, Tim Peters wrote:
> > Basic sanity requires that Python do the same
> > thing on *all* case-insensitive case-preserving filesystems, to the fullest
> > extent possible.  Python's DOS/Windows behavior has priority by a decade.
> > I'm deadly opposed to making a special wart for Cygwin (or the Mac), but am
> > in favor of changing it on Windows too.
> 
> May be if we can agree on how import should behave, then we will have
> a better chance of determining the best way to implement it sans warts?
> So, along these lines I propose that import from a file behave the same
> on both case-sensitive and case-insensitive/case-preserving filesystems.
> This will help to maximize portability between platforms like UNIX,
> Windows, and Mac.  Unfortunately, something like the PYTHONCASEOK
> caveat still needs to be preserved for case-destroying filesystems.
> 
> Any feedback is appreciated -- I'm just trying to help get closure on
> this issue by Beta 1.

Tim has convinced me that the proper rules are simple:

- If PYTHONCASEOK is set, use the first file found with a
  case-insensitive match.

- If PYTHONCASEOK is not set, and the file system is case-preserving,
  ignore (rather than bail out at) files that don't have the proper
  case.

Tim is in charge of cleaning up the code, but he'll need help for the
Cygwin and MacOSX parts.

--Guido van Rossum (home page: http://www.python.org/~guido/)