This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Cygwin case-sensitive import patch
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: jlt63 Nosy List: jlt63, zseil
Priority: normal Keywords: patch

Created on 2005-05-07 15:56 by jlt63, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
import.c.diff jlt63, 2005-05-07 15:56
Messages (3)
msg48321 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2005-05-07 15:56
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 attached patch fixes this problem. All that it
does it make Cygwin use the Mac OS X case_ok()
instead of a modified Window's version. Is this OK to
apply? Or, would someone like to make sure I didn't
break the Windows and Mac builds first? AFAICT, I
didn't, but you never know... :,)

Additionally, can I apply this patch to the 2.4 maintence
branch? If so, is "release24-maint" the correct CVS tag
to use?

Thanks.
msg48322 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2005-05-20 01:06
Logged In: YES 
user_id=86216

Commited onto HEAD as Python/import.c 2.241, so I'm in
forgiveness mode for this change... :,)

However, I won't commit onto the maintence branch without
explicit permission, so I'm still in permission mode for this
one... :,)
msg48323 - (view) Author: Ziga Seilnacht (zseil) * (Python committer) Date: 2007-04-02 09:54
The 2.4 branch is not maintained anymore, so this
patch can be closed.  The patch is included in
Python 2.5.
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 41962
2005-05-07 15:56:49jlt63create