os.lstat doesn't properly set st_reparse_tag for junction on a remote NetApp share
Open
Nobody has claimed this yet.
OS-windows
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Bug report
\\192.168.10.198\vol1\sub is a junction on NetApp share, but in Python 3.10.4 st_reparse_tag is set to 0:
>>> path = "\\\\192.168.10.198\\vol1\\sub"
>>> os.lstat(path).st_reparse_tag
0
>fsutil reparsepoint query \\192.168.10.198\vol1\sub
Reparse Tag Value : 0xa0000003
Tag value: Microsoft
Tag value: Name Surrogate
Tag value: Mount Point
Substitue Name offset: 0
Substitue Name length: 98
Print Name offset: 100
Print Name Length: 98
Substitute Name: \??\Volume{804BBB02-0000-0000-6270-052200000040}\
Print Name: \??\Volume{804BBB02-0000-0000-6270-052200000040}\
I checked in the Python code that:
os.lstatusesGetFileInformationByHandleExcall withFileAttributeTagInfoto get the value of the reparse tagDeviceIoControlwithFSCTL_GET_REPARSE_POINT, which is also used in Python source code, works fine- the problem doesn't affect regular remote Windows shares (NTFS filesystem)
Your environment
- CPython versions tested on: 3.10.4
- Operating system and architecture: Windows 2019, NetApp share
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the Windows implementation behind os.lstat, especially its GetFileInformationByHandleEx call with FileAttributeTagInfo. Reproduce the case against the NetApp junction and compare it with DeviceIoControl using FSCTL_GET_REPARSE_POINT. Done means st_reparse_tag reports the remote junction's reparse tag while preserving behavior for regular Windows shares.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100