Feature Requests item #1540112, was opened at 2006-08-14 09:49 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1540112&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tony (arandrea) Assigned to: Nobody/Anonymous (nobody) Summary: Allow choice of copy function in shutil.copytree Initial Comment: It would be nice to be able to choose which of the copy functions is used in copytree. I am currently working on a project where I would like to copy a tree, but I do not want to preserve permissions so I'd like copytree to use copyfile instead of copy2. Here is a snippet of copytree from shutil.py that I modified by adding a func parameter and defaulting it to copy2. def copytree(src, dst, symlinks=False, func=copy2): . . . try: if symlinks and os.path.islink(srcname): linkto = os.readlink(srcname) os.symlink(linkto, dstname) elif os.path.isdir(srcname): copytree(srcname, dstname, symlinks) else: func(srcname, dstname) . . . ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1540112&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com