Bugs item #768419, was opened at 2003-07-09 14:38 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=768419&group_id=5470
Category: Python Library Group: Platform-specific >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Erik Demaine (edemaine) Assigned to: Nobody/Anonymous (nobody) Summary: Subtle bug in os.path.realpath on Cygwin Initial Comment: Cygwin allows mounting directories within other mount points. This can cause os.path.realpath to expand some symlinks that it shouldn't. For example: $ cd / $ mkdir X $ mkdir X/Y $ ln -s X Z $ mount C:/ /Z/Y $ ls Z/Y [...contents of C:\...] $ ls X/Y [empty directory] $ python -c "import os; print os.path.realpath('Z/Y')" /X/Y [bad because /X/Y is empty yet the original Z/Y has files] In Cygwin, the correct answer would be either 'C:\' or '/cygdrive/c/'. Conceivably this problem can happen in UNIces other than Cygwin. It would be rather annoying to fix, because it would require looking at the mount table. But I thought I would mention it anyway... ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2005-03-03 10:52 Message: Logged In: YES user_id=21627 Closing as suggested. ---------------------------------------------------------------------- Comment By: Tony Meyer (anadelonbrin) Date: 2005-01-31 00:57 Message: Logged In: YES user_id=552329 I agree with Sjoerd - this is a Cygwin bug, not a Python one. ---------------------------------------------------------------------- Comment By: Sjoerd Mullender (sjoerd) Date: 2003-07-09 15:33 Message: Logged In: YES user_id=43607 I'd think this is rather a Cygwin bug than a Python bug. Before the mount, /X/Y and /Z/Y refer to the same directory, and on Unix they have the same device/inode combination. And that combination is the all-important factor when doing a mount on that directory. If you do this on Unix (I used an NFS mount instead of the mount shown in the report), both /X/Y and /Z/Y contain the mounted directory. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=768419&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com