[New-bugs-announce] [issue40486] pathlib's iterdir doesn't expecify what happens if directory content change

Facundo Batista report at bugs.python.org
Sun May 3 12:36:28 EDT 2020


New submission from Facundo Batista <facundo at taniquetil.com.ar>:

Documentation for Path.iterdir ( https://docs.python.org/3/library/pathlib.html#pathlib.Path.iterdir ) doesn't specify what happens when the directory change.

This is important, as the function does NOT return a list (which would imply that a "snapshot" of the directory will be returned).

Also, it's not only relevant what would happen if somebody else changes the directory after the iteration is started (will that change be reflected?) but also if it's ALLOWED for the same code that iterates the dir content to change it (or problems would arise, like when changing a dictionary while being iterated).

----------
assignee: docs at python
components: Documentation
messages: 367981
nosy: docs at python, facundobatista
priority: normal
severity: normal
status: open
title: pathlib's iterdir doesn't expecify what happens if directory content change
versions: Python 3.9

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


More information about the New-bugs-announce mailing list