[Python-Dev] RE: Case-sensitive import

Tim Peters tim.one@home.com
Tue, 27 Feb 2001 23:29:33 -0500


[Tim]
>> Jason, I *assume* that the existing "#if defined(MS_WIN32) ||
>> defined(__CYGWIN__)" version of check_case works already for
>> you.  Scream if that's wrong.

[Jason]
> I guess it depends on what you mean by "works."

I meant that independent of errors you don't want to see, and independent of
the allcaps8x3 silliness, check_case returns 1 if there's a case-sensitive
match and 0 if not.

> When I submitted my patch to enable case-sensitive imports for Cygwin,
> I mistakenly thought that I was solving import problems such as "import
> TERMIOS, termios".  Unfortunately, I was only enabling the (old) Win32
> "Case mismatch for module name foo" code for Cygwin too.

Then if you succeeded in enabling that, "it works" in the sense I meant.  My
intent is to stop the errors, take away the allcaps8x3 stuff, and change the
*calling* code to just keep going when check_case returns 0.

> Subsequently, there have been changes to Cygwin gcc that may make it
> difficult (i.e., require non-standard -I options) to find Win32 header
> files like "windows.h".  So from an ease of building point of view, it
> would be better to stick with POSIX calls and avoid direct Win32 ones.
> Unfortunately, from an efficiency point of view, it sounds like this is
> unavoidable.
>
> I would like to test your patch with both Cygwin gcc 2.95.2-6 (i.e.,
> Win32 friendly) and 2.95.2-7 (i.e., Unix bigot).  Please let me know
> when it's ready.

Not terribly long after I get to stop writing email <0.9 wink>.  But since
the only platform I can test here is plain Windows, and Cygwin and sundry Mac
variations appear to be moving targets, once it works on Windows I'm just
going to check it in.  You and Steven will then have to figure out what you
need to do on your platforms.

OK by me if you two recreate the HAVE_DIRENT_H stuff, but (a) not if Linux
takes that path too; and, (b) if Cygwin ends up using that, please get rid of
the Cygwin-specific tricks in the plain Windows case (this module is already
one of the hardest to maintain, and having random pieces of #ifdef'ed code in
it that will never be used hurts).