Message277385
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. |
|
Date |
User |
Action |
Args |
2016-09-25 17:09:37 | craigh | set | recipients:
+ craigh, tim.golden, zach.ware, eryksun, steve.dower |
2016-09-25 17:09:37 | craigh | set | messageid: <1474823377.34.0.0839045579867.issue23407@psf.upfronthosting.co.za> |
2016-09-25 17:09:37 | craigh | link | issue23407 messages |
2016-09-25 17:09:37 | craigh | create | |
|