Antoine Pitrou added the comment: I don't really understand your algorithm. Why do you need a stack? It should be simply iterative: - if the symlink is relative, prepend the symlink target to the rest - if the symlink is absolute, discard the current path and prepend the symlink target to the rest
Here is how pathlib does it: https://bitbucket.org/pitrou/pathlib/src/67a2524b057f1af5b3cba26370b1353e73cdda16/pathlib.py?at=default#cl-227 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6975> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com