views:

496

answers:

1

Python's shutil.copytree is not very flexible; what is the simplest way to add support for ignoring permissions while copying in copytree (without having to re-write its implementation)?

Otherwise, copytree fails like this:

(…)”[Errno 45] Operation not supported: ‘/path/foo/bar’”
+3  A: 

You have shutil.py in your standard Python distribution (on Ubuntu, mine is under /usr/lib/python2.6 for instance; Windows might be C:\Python26\lib?). The copytree function is only 38 lines long (34 if you don't count comments), and the end of the docstring explicitly states:

XXX Consider this example code rather than the ultimate tool.

So the simplest way really would be to change/add a couple lines to copytree, or find another library, to be honest.

Mark Rushakoff
That's what I did before posting this question.
Sridhar Ratnakumar