Use copy()
instead, which is willing to overwrite destination files. If you then want the first tree to go away, just rmtree()
it separately once you are done iterating over it.
http://docs.python.org/library/shutil.html#shutil.copy
http://docs.python.org/library/shutil.html#shutil.rmtree
Update:
Do an os.walk()
over the source tree. For each directory, check if it exists on the destination side, and os.makedirs()
it if it is missing. For each file, simply shutil.copy()
and the file will be created or overwritten, whichever is appropriate.