python / python/cpython

[Windows] scandir returns filenotfound for long paths but os.walk does not

未關閉
#90,242 20 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

3.9 (EOL) OS-windows tests topic-IO
主要語言
Python
星號
77.2k
分支
36k
平均合併
1 天 9 小時
30 天內合併 PR
558

描述

BPO 46084
Nosy @pfmoore, @tjguk, @jkloth, @zware, @serhiy-storchaka, @eryksun, @zooba
Files
  • test_dir_scan_dir.py: can be used to show filenotfound issue with long directory names. os_walk does not do the same thing.
  • test_os_walk.py: this script works just fine on the same directory structure.
  • test_dir_scan_dir.py: can be used to show filenotfound issue with long directory names. os_walk does not do the same thing.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2021-12-15.14:54:30.143>
    labels = ['expert-IO', 'tests', 'OS-windows', 'type-crash', '3.9']
    title = 'Python 3.9.6 scan_dir returns filenotfound on long paths, but os_walk does not'
    updated_at = <Date 2022-03-21.18:46:36.102>
    user = 'https://bugs.python.org/jschwar313'
    

    bugs.python.org fields:

    activity = <Date 2022-03-21.18:46:36.102>
    actor = 'jkloth'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests', 'Windows', 'IO']
    creation = <Date 2021-12-15.14:54:30.143>
    creator = 'jschwar313'
    dependencies = []
    files = ['50492', '50493', '50495']
    hgrepos = []
    issue_num = 46084
    keywords = ['patch']
    message_count = 13.0
    messages = ['408607', '408608', '408617', '408619', '408621', '408623', '408625', '408626', '408632', '408634', '408636', '408643', '408649']
    nosy_count = 8.0
    nosy_names = ['paul.moore', 'tim.golden', 'jkloth', 'zach.ware', 'serhiy.storchaka', 'eryksun', 'steve.dower', 'jschwar313']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue46084'
    versions = ['Python 3.9']
    

    貢獻指南

    開啟貢獻指南

    從這裡開始

    1. 先讀完整個 Issue,再讀專案的貢獻指南。
    2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
    3. Fork 儲存庫,在一個分支上完成修改。
    4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

    研究方向

    首先,在 Windows 上使用 issue 中描述的長目錄結構執行 test_dir_scan_dir.py,然後將其行為與 test_os_walk.py 進行比較。檢查與 scandir 相關的路徑處理,並驗證長路徑不再產生 FileNotFoundError,同時 os.walk 仍能正常運作。使用一個針對性的回歸測試確認此行為。

    由索引模型根據 Issue 內容生成。

    評估

    技術堆疊
    python
    領域
    operating-systems, testing-qa
    Issue 類型
    缺陷
    難度
    4/5
    預估耗時
    3-5 天
    活躍度
    停滯
    描述清晰度
    基本清楚
    新手友好度
    35/100

    把新 issue 寄到你的電子郵件信箱

    精選適合新手參與的 GitHub issue 摘要。