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.

Title: os.path.islink() works with cygwin installation but not
Type: behavior Stage: resolved
Components: Versions: Python 2.7
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: bward, iritkatriel, pmpp
Priority: normal Keywords:

Created on 2018-12-14 21:16 by bward, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg331871 - (view) Author: Benjamin Ward (bward) Date: 2018-12-14 21:16
I have's Python27 installed on my laptop.  In my Documnets/tmp folder/directory I created three "directories" (see below) and performed os.path.islink() on all three.

in cmd window: (not dir output and prompt have be been shortened)

 Volume in drive C is OS
 Volume Serial Number is B2BB-F7DA

 Directory of *\Documents\tmp
12/14/2018  12:37 PM    <DIR>          isDir
12/14/2018  12:37 PM    <JUNCTION>     isDirJunction [C:\Users\benjward\Documents\tmp\isDir]
12/14/2018  12:39 PM    <SYMLINKD>     isDirSymbolicLink [isDir]

*** using system installed python 2.7
*\Documents\tmp>where python

Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.islink('isDir')
>>> os.path.islink('isDirJunction')
>>> os.path.islink('isDirSymlink')

*** but ..., using cygwin64 installation of python 2.7
Python 2.7.14 (default, Oct 31 2017, 21:12:13)
[GCC 6.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.islink('isDir')
>>> os.path.islink('isDirJunction')
>>> os.path.islink('isDirSymlink')

The latter result is what I was expecting.  Granted, my cygwin python is 2.7.14 and system installation is 2.7.15, but is it likely that a capability was lost?
msg331872 - (view) Author: pmp-p (pmpp) * Date: 2018-12-14 21:27
afaik only cygwin and msys2 python flavours can handle *various* links and junctions. ( usefull tool )

and testing symlinks is may be disabled in MSVCRT paths as some comment suggest.
msg404438 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-10-20 12:22
2.7 is no longer maintained. Please create a new issue if you have this problem with a current python version (3.9+).
Date User Action Args
2022-04-11 14:59:09adminsetgithub: 79684
2021-10-20 12:22:50iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg404438

resolution: out of date
stage: resolved
2018-12-14 21:27:50pmppsetnosy: + pmpp
messages: + msg331872
2018-12-14 21:16:22bwardcreate