[Python-Dev] Case sensitive import.

Jeremy Hylton jeremy@alum.mit.edu
Fri, 2 Feb 2001 12:07:55 -0500 (EST)


>>>>> "SDM" == Steven D Majewski <sdm7g@virginia.edu> writes:

  SDM> I see from one of the comments on my patch #103459 that there
  SDM> is a history to this issue (patch #103154)

  SDM> I had assumed that renaming modules and possibly breaking
  SDM> existing code was not an option, but this seems to have been
  SDM> considered in the discussion on that earlier patch.

  SDM> Is there any consensus on how to deal with this ?

  SDM> I would *really* like to get SOME fix -- either my patch, or a
  SDM> renaming of FCNTL, TERMIOS, SOCKET, into the next release.

Our plan is to remove all of these modules and move the constants they
define into the modules that provide the interface.  Fred has already
removed SOCKET, since all the constants are defined in socket.  I
don't think we'll get to the others in time for 2.1a2.

  SDM> It's not clear to me whether the issues on other systems are
  SDM> the same.  On mac-osx, the OS is BSD unix based and when using
  SDM> a unix file system, it's case sensitive. But the standard
  SDM> filesystem is Apple's HFS+, which is case preserving but case
  SDM> insensitive. ( That means that opening "abc" will succeed if
  SDM> there is a file named "abc", "ABC", "Abc" , "aBc" ... , but a
  SDM> directory listing will show "abc" )

  SDM> I had guessed that the CHECK_IMPORT_CASE ifdefs and the
  SDM> corresponding configure switch were there for this sort of
  SDM> problem, and all I had to do was add a macosx implementation of
  SDM> check_case(), but returning false from check_case causes the
  SDM> search to fail -- it does not continue until it find a matching
  SDM> module.

Guido is strongly opposed to continuing after check_case returns
false.  His explanation is that imports ought to work whether all the
there are multiple directories on sys.path or all the files are copied
into a single directory.  Obviously on file systems like HFS+, it
would be impossible to have FCNTL.py and fcntl.py be in the same
directory. 

Jeremy