[issue2663] shutil.copytree glob-style filtering [patch]

Georg Brandl report at bugs.python.org
Fri May 23 12:03:16 CEST 2008


Georg Brandl <georg at python.org> added the comment:

Hi Tarek,

here's a review:

* The new docs are not very clear about ignore_patterns being a function
factory. E.g.:

"""The callable must return a list of folder and file names relative to
the path, that will be ignored in the copy process.
:func:`ignore_patterns` is an example of such callable."""

Rather, the *return value* of ignore_patterns is an example of such a
callable.

* The new docs should also note that copytree is called recursively, and
therefore the ignore callable will be called once for each directory
that is copied.

* Instead of "path and its elements" the terminology should be
"directory" and "the list of its contents, as returned by os.listdir()".
Likewise, "folder" should be "directory".

* The second new example makes me wonder if *ignore* is the correct name
for the parameter. Is *filter* better?

* A nit; the signature should be "copytree(src, dst[, symlinks[, ignore]])".

* The patch adds a space in the definition of rmtree().

----------
nosy: +georg.brandl

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2663>
__________________________________


More information about the Python-bugs-list mailing list