This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.walk and other directory traversal does not handle recursive mounts on Windows
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.8
process
Status: closed Resolution: duplicate
Dependencies: Superseder: os.walk always follows Windows junctions
View: 23407
Assigned To: Nosy List: R0b0t1, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2021-05-02 04:54 by R0b0t1, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (1)
msg392666 - (view) Author: R0b0t1 (R0b0t1) Date: 2021-05-02 04:54
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:

```diskpart (enters shell)
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.
History
Date User Action Args
2022-04-11 14:59:45adminsetgithub: 88174
2021-05-02 08:31:34eryksunsetstatus: open -> closed
superseder: os.walk always follows Windows junctions
resolution: duplicate
stage: resolved
2021-05-02 04:54:09R0b0t1create