[issue13772] listdir() doesn't work with non-trivial symlinks

Antoine Pitrou report at bugs.python.org
Thu Jan 12 07:42:59 CET 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> > As such, the documentation for symlink where it states the optional
> > `target_is_directory=False` argument should be automatically detect
> > whether the source is a file or directory does not hold true.
> 
> I don't know if auto-detection is a good idea. Of a course, from a Unix
> user's perspective, Windows' behaviour doesn't make a lot of sense.
> Especially when functions other than listdir() work fine anyway.

Ah, sorry, I had misunderstood your comment. Indeed, os.symlink
*already* tries to autodetect the target's file type, but the detection
is broken with relative symlinks: it doesn't try to join them with the
link's directory and so it thinks the target doesn't exist.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13772>
_______________________________________


More information about the Python-bugs-list mailing list