Skip to content

Commit 013ddc6

Browse files
committed
Add comment explaining why we access the filesystem via Path objects in glob selectors
1 parent d07f465 commit 013ddc6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/pathlib.py

+4
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ def __init__(self, pat, child_parts, flavour):
349349

350350
def _select_from(self, parent_path, is_dir, exists):
351351
try:
352+
# bpo-24132: a future version of pathlib will support subclassing
353+
# of pathlib.Path to customize how the filesystem is accessed. We
354+
# must honour those customizations here, rather than calling
355+
# os.scandir() directly.
352356
with parent_path._scandir() as scandir_it:
353357
entries = list(scandir_it)
354358
for entry in entries:

0 commit comments

Comments
 (0)