[issue13336] packaging.command.Command.copy_file doesn't implement preserve_mode and preserve_times
Éric Araujo
report at bugs.python.org
Sat Nov 12 12:39:18 CET 2011
Éric Araujo <merwok at 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’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
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13336>
_______________________________________
More information about the Python-bugs-list
mailing list