gh-150880: Normalize paths on Windows before appending wildcard (GH-1… · python/cpython@1b4135a · GitHub
Skip to content

Commit 1b4135a

Browse files
gh-150880: Normalize paths on Windows before appending wildcard (GH-152906)
This ensures that we don't turn a "valid" path with trailing spaces into an invalid path with embedded spaces.
1 parent 87120d3 commit 1b4135a

3 files changed

Lines changed: 78 additions & 29 deletions

File tree

Lib/test/test_os/test_os.py

Lines changed: 24 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Normalize non-extended Windows paths before appending the wildcard used by
2+
``os.listdir()`` and ``os.scandir()``, making paths with trailing spaces
3+
behave consistently with other filesystem APIs.

Modules/posixmodule.c

Lines changed: 51 additions & 29 deletions

0 commit comments

Comments
 (0)