[issue5300] Distutils ignores file permissions

George Sakkis report at bugs.python.org
Tue Feb 17 22:54:54 CET 2009


New submission from George Sakkis <george.sakkis at 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 <report at bugs.python.org>
<http://bugs.python.org/issue5300>
_______________________________________


More information about the Python-bugs-list mailing list