os.lstat doesn't properly set st_reparse_tag for junction on a remote NetApp share
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
调研方向
首先检查 os.lstat 背后的 Windows 实现,尤其是使用 FileAttributeTagInfo 调用 GetFileInformationByHandleEx 的部分。针对 NetApp junction 重现该情况,并将其与使用 FSCTL_GET_REPARSE_POINT 的 DeviceIoControl 进行比较。完成的标准是 st_reparse_tag 报告远程 junction 的 reparse tag,同时保持对普通 Windows 共享的行为不变。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 36k
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 558
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python/cpython 的其他 Issue
-
docs pending
难度 2/5 1-3 小时 新手友好度 78/100
-
stdlib type-feature
难度 2/5 1-3 小时 新手友好度 78/100
-
stdlib type-feature
难度 2/5 1-3 小时 新手友好度 72/100
-
build type-bug
难度 2/5 1-3 小时 新手友好度 76/100
-
stdlib topic-email type-feature
难度 2/5 1-3 小时 新手友好度 70/100
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
难度 2/5 1-3 小时 新手友好度 88/100
NousResearch/hermes-agent#117848 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
zilliztech/memsearch#759 ·