Skip to content

Preserving read-only flags on package data causing access denied when building #1424

@miuliano

Description

@miuliano

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions