mirror of https://github.com/python/cpython
35e998f560
Add `pathlib.Path.copytree()` method, which recursively copies one directory to another. This differs from `shutil.copytree()` in the following respects: 1. Our method has a *follow_symlinks* argument, whereas shutil's has a *symlinks* argument with an inverted meaning. 2. Our method lacks something like a *copy_function* argument. It always uses `Path.copy()` to copy files. 3. Our method lacks something like a *ignore_dangling_symlinks* argument. Instead, users can filter out danging symlinks with *ignore*, or ignore exceptions with *on_error* 4. Our *ignore* argument is a callable that accepts a single path object, whereas shutil's accepts a path and a list of child filenames. 5. We add an *on_error* argument, which is a callable that accepts an `OSError` instance. (`Path.walk()` also accepts such a callable). Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com> |
||
---|---|---|
.. | ||
2.0.rst | ||
2.1.rst | ||
2.2.rst | ||
2.3.rst | ||
2.4.rst | ||
2.5.rst | ||
2.6.rst | ||
2.7.rst | ||
3.0.rst | ||
3.1.rst | ||
3.2.rst | ||
3.3.rst | ||
3.4.rst | ||
3.5.rst | ||
3.6.rst | ||
3.7.rst | ||
3.8.rst | ||
3.9.rst | ||
3.10.rst | ||
3.11.rst | ||
3.12.rst | ||
3.13.rst | ||
3.14.rst | ||
changelog.rst | ||
index.rst |