-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
I'm working with a read-only source directory on Windows and running into access denied errors when calling python setup.py bdist_wheel. I noticed that it was only files included in package_data that were causing this, which helped me track it down to:
setuptools/setuptools/command/build_py.py
outf, copied = self.copy_file(srcfile, target)
which is slightly different from its distutils version:
cpython/Lib/distutils/command/build_py.py
self.copy_file(os.path.join(src_dir, filename), target, preserve_mode=False)
So it looks like it comes down to this preserve_mode flag.
I don't know if there is a good reason to preserve things like read-only flags? There's a comment about preserving mode further up in the distutils code, which seems to suggest not preserving is the way to go.