[New-bugs-announce] [issue36602] Recursive directory list with pathlib.Path.iterdir

Laurie Opperman report at bugs.python.org
Thu Apr 11 06:59:34 EDT 2019


New submission from Laurie Opperman <laurie_opperman at hotmail.com>:

Currently, 'pathlib.Path.iterdir' can only list the contents of the instance directory. It is common to also want the contents of subdirectories recursively.

The proposal is for 'pathlib.Path.iterdir' to have an argument 'recursive' which when 'True' will cause 'iterdir' to yield contents of subdirectories recursively.

This would be trivial to implement as 'iterdir' can simply yield from subdirectories' 'iterdir'.

A decision would have to be made whether to continue to yield the subdirectories, or skip them. Another decision would be for whether each path should be resolved before checking if it is a directory to be recursed into.

----------
components: Library (Lib)
messages: 339959
nosy: Epic_Wink
priority: normal
severity: normal
status: open
title: Recursive directory list with pathlib.Path.iterdir
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36602>
_______________________________________


More information about the New-bugs-announce mailing list