[ python-Bugs-1179412 ] can't import thru cygwin symlink

SourceForge.net noreply at sourceforge.net
Fri Sep 30 07:36:03 CEST 2005


Bugs item #1179412, was opened at 2005-04-08 12:42
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1179412&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: steveward (steveward)
>Assigned to: Jason Tishler (jlt63)
Summary: can't import thru cygwin symlink

Initial Comment:
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
 

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2005-09-29 22:36

Message:
Logged In: YES 
user_id=33168

Jason, comments?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1179412&group_id=5470


More information about the Python-bugs-list mailing list