Skip to content

[3.14] gh-156707: Do not follow junctions in os_helper.rmtree() on Windows (GH-156710) - #156715

Merged
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-d87ee27-3.14
Aug 31, 2026
Merged

[3.14] gh-156707: Do not follow junctions in os_helper.rmtree() on Windows (GH-156710)#156715
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-d87ee27-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

os.lstat() reports a junction as a directory, so the junction was followed
and files in the directory it points to could be removed. Now the junction
itself is removed, as in os.walk() and shutil.rmtree().
(cherry picked from commit d87ee27)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

…dows (pythonGH-156710)

os.lstat() reports a junction as a directory, so the junction was followed
and files in the directory it points to could be removed.  Now the junction
itself is removed, as in os.walk() and shutil.rmtree().
(cherry picked from commit d87ee279a1f6dfdb478ede5f0ba0360123d85916)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants