Craig Holmquist added the comment: The attached patch changes _Py_attribute_data_to_stat to set S_IFLNK for both symlinks and junctions, and changes win_readlink to return the target path for junctions (IO_REPARSE_TAG_MOUNT_POINT) as well as symlinks.
I'm not sure what to do as far as adding a test--either Python needs a way to create junctions or the test needs to rely on the ones Windows creates by default. Incidentally, the existing win_readlink doesn't always work correctly with symbolic links, either (this is from 3.5.2): >>> import os >>> os.readlink(r'C:\Users\All Users') '\x00\x00f\x00\u0201\x00\x02\x00\x00\x00f\x00\x00\x00' The problem is that PrintNameOffset is an offset in bytes, so it needs to be divided by sizeof(WCHAR) if you're going to add it to a WCHAR pointer (https://msdn.microsoft.com/en-us/library/windows/hardware/ff552012(v=vs.85).aspx). Some links still seem to work correctly because PrintNameOffset is 0. The attached patch fixes this problem also--I wasn't sure if I should open a separate issue for it. ---------- keywords: +patch Added file: http://bugs.python.org/file44823/issue23407.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23407> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com