This is the mail archive of the
mailing list for the Cygwin project.
Re: Symlinks don't work in python???
Thanks for all the good work. The PYTHONCASEOK workaround
indeed seems to solve the problem. From your description,
it seems that the trouble is that the real name (the name
of the symlink target) is used rather than the name of the
symlink; I should be able to circumvent naming problems,
including case problems on Windows, via appropriately-named
symlinks. It seems that this should be a straightforward
fix to the case-insensitive code hack ... but, of course,
I haven't looked at that code.
Again, thanks for the insight!
Date: Tue, 19 Apr 2005 08:48:16 -0400
From: Jason Tishler <email@example.com>
Mail-Followup-To: firstname.lastname@example.org, email@example.com
X-Scanned-By: MIMEDefang 2.42
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on k2.csail.mit.edu
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS
On Fri, Apr 15, 2005 at 10:12:56PM -0400, Jason Tishler wrote:
> On Fri, Apr 15, 2005 at 03:54:37PM -0400, Steve Ward wrote:
> > Can you try my failing experiment (symlink bar.py to file foo.py in
> > same directory)?
> I was able reproduce your problem on my way out of work today.
> > It seems using a different name for the symlink may cause the
> > trouble... I have no idea why.
> Can you strace the issue and report back to the list? If not, then I
> will try when I'm back at work on Monday.
AFAICT, symlinking bar.py to foo.py never worked or at least since
case-insensitive file system support was added to Python in 2/2001:
The problem is Cygwin specific code is invoked during imports to make
sure one imports a module using the same case as the file stored in the
file system. For example, "foo" will match "foo.py" but not "FoO.py",
etc. When you import bar (i.e., bar.py) which is symlinked to foo.py
the case checking code fails (because "bar" != "foo") and the module is
You can workaround the problem by defining PYTHONCASEOK:
$ PYTHONCASEOK= python -c 'import bar'
I will work with the Python developers to try to come up with a better
long term solution.
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html