You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On macOS, shutil.copystat() uses chflags() to try to copy filesystem flags from the source to destination.
In recent years, Apple introduced System Integrity Protection, which prevents modification of system files. These files have the non-standard SF_RESTRICTED flag set, which only the superuser can set.
Thus, unprivileged users can no longer use shutil.copy2() et al. to copy system files, which is a regression from previous releases of the OS.
It's unclear what the correct behavior should be: It some cases, it would be desirable to attempt to copy the bit.
It might be informative to look at the behavior of Apple's copyfile_stat function, which unsets these two flags:
/* * File flags that are not preserved when copying stat information. */#defineCOPYFILE_OMIT_FLAGS (UF_TRACKED | SF_RESTRICTED)
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: