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: can't import thru cygwin symlink
Type: Stage:
Components: Windows Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jlt63 Nosy List: jlt63, nnorwitz, steveward
Priority: normal Keywords:

Created on 2005-04-08 19:42 by steveward, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg24968 - (view) Author: steveward (steveward) Date: 2005-04-08 19:42
This may be a cygwin-specific problem: given foo.py:

> ln -s foo.py bar.py
> python
Python 2.4 (#1, Dec  4 2004, 20:10:33)
[GCC 3.3.3 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import foo
This is file foo.py.
>>> import bar
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named bar

Despite the problem with imports,  most os.path utilities 
(exists, isfile, islink, isdir) work on cygwin symlinks.   
An exception is reailpath: realpath("bar.py") returns a 
path to the symlink, not to the real file.

Suspecting this as a key to the import problem, I tried 
several recent python/cygwin release versions (all 
installed via cygwin's setup.exe).  
FIndings:                                                                     
                            
     Cygwin   Python   realpath  Import
      1.5.xx:      2.yy:   Works?  Works?
      ---------  --------------  -----------  ----------
     1.5.14             2.4        NO      NO
     1.5.13           2.3.4     YES      NO
     1.5.14           2.3.4     YES      NO
     1.5.12             2.4        NO    YES

Neither bug shows up under Linux.

The two problems seem uncorrelated, although it may 
be that each is due to some assumpion about symlink 
semantics that isn't true of the Cygwin implementation.

Apologies if these problems have been previously 
submitted in a form my quick scan didn't identify.  A 
corresponding note has been submitted to the cygwin 
mailing list.

- Steve
 
msg24969 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-09-30 05:36
Logged In: YES 
user_id=33168

Jason, comments?
msg24970 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2005-10-03 12:16
Logged In: YES 
user_id=86216

This is a duplicate of patch #1197318.

Note Cygwin Python 2.4.1 has this patch applied.
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41829
2005-04-08 19:42:46stevewardcreate