New submission from George Sakkis <george.sak...@gmail.com>: Distutils ignores file permissions when copying modules and package_data files to the build directory, and consequently to the installation directory too. According to an XXX comment at distutils/command/build_py.py, this is deliberate so that the built files are not read-only, which would be a nuisance when rebuilding. This problem though could be solved by just setting the write flag for the user (chmod u+w) instead of overwriting all the flags. In my case, some executable files ceased to be executable after installation.
I believe that the default behavior should be changed to preserve all permissions, with the possible exception of setting u+w. Even that might be unnecessary; AFAIK to delete a file you need write permissions only to its parent directory, not to the file itself. Even if the current behavior is deemed correct, at the very least the code should be refactored to allow easy overriding. Currently build_module and build_package_data pass preserve_mode=False in their body, so I had to copy and paste the whole methods just to set preserve_mode=True. ---------- assignee: tarek components: Distutils messages: 82372 nosy: gsakkis, tarek severity: normal status: open title: Distutils ignores file permissions type: behavior _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5300> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com