Skip to content

os.walk and other directory traversal does not handle recursive mounts on Windows #88174

Closed

Description

@R030t1
mannequin
BPO 44008
Nosy @pfmoore, @tjguk, @zware, @zooba, @R030t1
Superseder
  • bpo-23407: os.walk always follows Windows junctions
  • 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 = <Date 2021-05-02.08:31:34.208>
    created_at = <Date 2021-05-02.04:54:09.125>
    labels = ['type-bug', '3.8', 'OS-windows']
    title = 'os.walk and other directory traversal does not handle recursive mounts on Windows'
    updated_at = <Date 2021-05-02.08:31:34.207>
    user = 'https://github.com/R030t1'

    bugs.python.org fields:

    activity = <Date 2021-05-02.08:31:34.207>
    actor = 'eryksun'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-05-02.08:31:34.208>
    closer = 'eryksun'
    components = ['Windows']
    creation = <Date 2021-05-02.04:54:09.125>
    creator = 'R0b0t1'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44008
    keywords = []
    message_count = 1.0
    messages = ['392666']
    nosy_count = 5.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'steve.dower', 'R0b0t1']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '23407'
    type = 'behavior'
    url = 'https://bugs.python.org/issue44008'
    versions = ['Python 3.8']

    Activity

    1. R030t1 commented on May 2, 2021

      R030t1mannequin
      MannequinAuthor

      Using os.walk to traverse a filesystem on Windows does not terminate in the case of a recursive mountpoint existing somewhere in the path.

      In my case C:\circlemount is linked to C:\, producing paths such as C:\circlemount\circlemount\circlemount\circlemount\...

      A drive mount point may be set up as follows:

      list volume`
      select volume ${#}`
      assign mount=${path}
      

      Notably this only happens for Win32 python. Cygwin and MSYS2 pythons as well as the pythons distributed with some packages like Inkscape behave properly.

    2. added
      3.8 (EOL)
      type-bug
      on May 2, 2021
    3. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)OS-windowstype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions