diff --git a/changelog.d/1424.change.rst b/changelog.d/1424.change.rst new file mode 100644 index 0000000000..361997ddd6 --- /dev/null +++ b/changelog.d/1424.change.rst @@ -0,0 +1 @@ +Prevent keeping files mode for package_data build. It may break a build if user's package data has read only flag. \ No newline at end of file diff --git a/setuptools/command/build_py.py b/setuptools/command/build_py.py index b0314fd413..6fc0a4e46d 100644 --- a/setuptools/command/build_py.py +++ b/setuptools/command/build_py.py @@ -120,7 +120,7 @@ def build_package_data(self): target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(target)) srcfile = os.path.join(src_dir, filename) - outf, copied = self.copy_file(srcfile, target) + outf, copied = self.copy_file(srcfile, target, preserve_mode=False) srcfile = os.path.abspath(srcfile) if (copied and srcfile in self.distribution.convert_2to3_doctests):