[issue1666318] shutil.copytree doesn't give control over directory permissions
Catherine Devlin added the comment: Attaching new patch incorporating Vajrasky's suggestion -- Added file: http://bugs.python.org/file31316/test1666318.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Roundup Robot added the comment: New changeset c388e93879c4 by Antoine Pitrou in branch '3.3': Issue #1666318: Add a test that shutil.copytree() retains directory permissions. http://hg.python.org/cpython/rev/c388e93879c4 New changeset 8906713d5704 by Antoine Pitrou in branch 'default': Issue #1666318: Add a test that shutil.copytree() retains directory permissions. http://hg.python.org/cpython/rev/8906713d5704 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Antoine Pitrou added the comment: Patch committed to 3.3 and 3.4. Thank you very much! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Antoine Pitrou added the comment: Hey Catherine, Do you want to update your patch to include Vajrasky's suggestion? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Catherine Devlin added the comment: Thanks, Antoine - I've signed and submitted the Contributor's Agreement. -- Added file: http://bugs.python.org/file31104/Python Contributor Agreement Form - signed.pdf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Changes by Christian Heimes li...@cheimes.de: Removed file: http://bugs.python.org/file31104/Python Contributor Agreement Form - signed.pdf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Christian Heimes added the comment: Hi Catherine, the contributor agreement must go through proper channels. The bug tracker is not the right place to post your agreement. Please follow the instructions at http://www.python.org/psf/contrib/ . You can submit the agreement electronically, too. -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Vajrasky Kok added the comment: Hi Catherine, I saw your patch. It looks good, except you are trying to copy the directory onto its subdirectory. src_dir = tempfile.mkdtemp() dst_dir = os.path.join(tempfile.mkdtemp(), 'destination') I prefer it if you copy it to somewhere else. This would be better: tmp_dir = self.mkdtemp() src = os.path.join(tmp_dir, 'foo') dst = os.path.join(tmp_dir, 'bar') -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Catherine Devlin added the comment: Attaching a test that verifies that shutil.copytree is, in fact, preserving permissions (as of Python 3.4.0a0 (default:66a3dc613627, Jul 27 2013, 21:23:10) ) As far as I can tell this can be closed. -- nosy: +catherinedevlin Added file: http://bugs.python.org/file31081/test1666318.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Antoine Pitrou added the comment: Catherine, I think it would be nice to apply your patch to avoid any further regressions. However, you should first sign a contributor's agreement (http://www.python.org/psf/contrib/). Could you please do so and post here once it is done? -- assignee: tarek - components: +Tests nosy: +pitrou stage: test needed - patch review type: behavior - enhancement versions: +Python 3.4 -Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Jeff McNeil j...@jmcneil.net added the comment: I made the change suggested in the last comment, patch is attached. Trying to clean up any bugs I've got my name on! -- keywords: +patch Added file: http://bugs.python.org/file24816/makedirs_function.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Éric Araujo mer...@netwok.org added the comment: Patch looks good. I don’t know if I should fix this in 3.3 with your patch or go back to the first idea of adding a copystat(src, dst) after the mkdir call. I just don’t know if it’s important that this behavior does not change in stable versions, or if it’s clearly a bug and we can change it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Jeff McNeil j...@jmcneil.net added the comment: Ah, understood. I kind of like the idea of having the added functionality behind a custom callable, but if it's generally just a bug then copystat is a good solution, too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Changes by Ugra Dániel daniel.u...@gmail.com: -- nosy: +daniel.ugra ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1666318] shutil.copytree doesn't give control over directory permissions
Éric Araujo mer...@netwok.org added the comment: The result should be uniform; either preserve permissions across the board, or leave it to the mercy of the caller. I’m surprised by this report, as the code does a copystat(sourcedir, targetdir) since 2004 (#1048878). Anyhow, I think the second option would be better. I know there's an enhancement request already open to supply a 'func=' kw argument to copytree. This is now implemented (copy_function argument), but does not help with directories, only with files. Recently I needed to call copytree and change the permissions of the destination, so I wanted to use a two-line custom copy_function (one line to call shutil.copy, one line for os.chmod), but I hadn’t understood that the custom function was not used for directory creation. I found out that shutil does a copystat on the created directories behind my back. So, I think this problem can be solved in a nice and b/w-compatible way by adding a new keyword argument, makedirs_func. I would like to fix this in stable versions too, but if another core developer argues that it should be considered a new feature, I won’t argue. -- nosy: +eric.araujo, georg.brandl, jlgijsbers title: shutil.copytree doesn't preserve directory permissions - shutil.copytree doesn't give control over directory permissions versions: +Python 3.3 -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1666318 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com