Issue1718450

classification
Title: Patch for os.path.islink bug 1717491
Type: Severity: normal
Components: Library Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, pekka.klarck, pjenvey
Priority: normal Keywords: patch

Created on 2007-05-14.07:26:20 by pekka.klarck, last changed 2008-02-24.04:21:33 by pjenvey.

Files
File name Uploaded Description Edit Remove
islink.patch pekka.klarck, 2007-05-14.07:26:20
Messages
msg2718 (view) Author: Pekka Klärck (pekka.klarck) Date: 2007-05-14.07:26:20
Attached
msg2719 (view) Author: Charlie Groves (cgroves) Date: 2007-05-20.05:22:21
This doesn't quite work under windows.  _abspath returns paths on my C: drive starting with a lowercase c whereas _realpath returns paths starting with an uppercase c.  This means islink returns true for everything.  We could try to special-case this for Windows, but it might just be better to wait for hsk's platform specific path modules patch on jython-2.3.  ntpath.py returns false for everything for islink.
msg2720 (view) Author: Pekka Klärck (pekka.klarck) Date: 2007-05-20.09:20:34
My bad. Should have a) written a test for this and b) tested it also on Windows. I had actually noticed that gatCanonicalPath and getAbsolutePath (used by realpath and abspath, respectively) behave differently in Windows so that one of them normalizes the path and the other doesn't. Of course I didn't remember that when writing the patch...

Assuming that normpath is fixed this can simply be fixed by changing the return statement to following

    return _normpath(_abspath(path)) != _normpath(_realpath(path))

Leaving this open for 2.2 is totally ok too because this is such a small issue anyway. I'm also looking forward to those platform specific os.path modules.
msg3046 (view) Author: Philip Jenvey (pjenvey) Date: 2008-02-24.04:21:33
fixed in r4171: we now use posixpath which includes islink. islink is 
actually able to work because os.lstat was added in r4014
History
Date User Action Args
2008-02-24 04:21:33pjenveysetstatus: open -> closed
nosy: + pjenvey
resolution: fixed
messages: + msg3046
components: + Library, - None
2007-05-14 07:26:20pekka.klarckcreate