python / python/cpython

`shutil.copytree` fails due to `os.setxattr` Permission denied on lustre filesystem

Open
#121,524 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

When running shutil.copytree on a lustre filesystem with a source dir containing files with 440 permissions, os.setxattr fails with permission denied.
This seems to be related to #68726.
The file are copied with the original read-only permission and the copy/setting of extended attributes is failing afterwards

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the shutil.copytree failure on Linux with a Lustre source containing files with 440 permissions. Read the copytree handling around os.setxattr and compare the related discussion in issue #68726. Done means the reported copy operation no longer fails when the copied file remains read-only.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.