]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Patch #1197318: Cygwin case-sensitive import patch
authorJason Tishler <jason@tishler.net>
Fri, 20 May 2005 00:56:54 +0000 (00:56 +0000)
committerJason Tishler <jason@tishler.net>
Fri, 20 May 2005 00:56:54 +0000 (00:56 +0000)
commit7961aa6135e5a26c1cc14bbcaa2668d2ec98b0b9
tree1f8b701a995fa4fee5ba89b4deb07f9be0af47d1
parentfffc4b7b3ac1f190bd256181b771e495495e296e
Patch #1197318: Cygwin case-sensitive import patch

A problem regarding importing symlinked modules was recently reported on the
Cygwin mailing list:

    http://cygwin.com/ml/cygwin/2005-04/msg00257.html

The following test case demonstrates the problem:

$ ls -l
total 1
lrwxrwxrwx    1 jt       None            6 Apr 23 13:32 bar.py -> foo.py
-rw-r--r--    1 jt       None           24 Apr 18 20:13 foo.py

$ python -c 'import bar'
Traceback (most recent call last):
File "<string>", line 1, in ?
ImportError: No module named bar

Since Cygwin's case_ok() uses a modified version of the Windows's version, the
symlinked bar module actually resolves to file foo.py instead of bar.py. This
obviously causes the matching code to fail (regardless of case).

The patch fixes this problem by making Cygwin use the Mac OS X case_ok()
instead of a modified Window's version.
Python/import.c