Issue 13336: packaging.command.Command.copy_file doesn't implement preserve_mode and preserve_times (original) (raw)

Issue13336

Created on 2011-11-03 18:06 by vinay.sajip, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg146957 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2011-11-03 18:06
The packaging.command.Command.copy_file method does not honour the preserve_mode and preserve_times keyword arguments. Likewise, packaging.command.Command.copy_tree does not honour the preserve_mode, preserve_times and preserve_symlinks keyword arguments.
msg147476 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-12 11:39
Thanks for the report. Have you found the bug with a real setup.cfg or hook, or were you just reading the code? I’m not sure how hard to fix this will be. The copy_file method delegates to shutil.copyfile, but this does not have the arguments we need, contrary to the former distutils file_util.copy_file function. Currently it’s only build_py that uses this parameter: # if a file is read-only in the working # directory, we want it to be installed read/write so that the next # installation of the same module distribution can overwrite it # without problems. (This might be a Unix-specific issue.) Thus # we turn off 'preserve_mode' when copying to the build directory, # since the build directory is supposed to be exactly what the # installation will look like (ie. we preserve mode when # installing). Depending on whether shutil supports what we need, different patches could be made: - Change code to use the right shutil function - Add code in copy_file to walk and chmod - Remove the preserve_* arguments and add another method for build_py
msg147506 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2011-11-12 15:48
> > > Éric Araujo <merwok@netwok.org> added the comment: > > Thanks for the report.  Have you found the bug with a real setup.cfg or hook, or > were you just reading the code? > I found the bug with a real setup.cfg (executable permission not set IIRC) and tracked it to copy_file. The copy_tree function wasn't used, I was just making an observation from scanning the code.
History
Date User Action Args
2022-04-11 14:57:23 admin set github: 57545
2014-03-13 03:33:16 eric.araujo set status: open -> closedresolution: out of datestage: resolved
2011-11-12 15:48:56 vinay.sajip set messages: +
2011-11-12 11:39:17 eric.araujo set messages: +
2011-11-03 18:06:36 vinay.sajip create