copytree

How do I copy an entire directory of files into an existing directory using Python?

Run the following code from a directory that contains a directory named bar (containing one or more files) and a directory named baz (also containing one or more files). Make sure there is not a directory named foo. import shutil shutil.copytree('bar', 'foo') shutil.copytree('baz', 'foo') It will fail with: $ python copytree_test.py...

Python: shutil.copytree , lack of ignore arg in python 2.5

Short of essentially rewriting copytree to accept an ignore callback, what is a simple way to achieve this in versions prior to python 2.6? (I don't want to stray from my debian packages) ...