[issue24538] os.setxattr PermissionError on panfs propagates up causing `copystat`, `copytree`, and `pip install .` to fail unhepfully

Giampaolo Rodola' report at bugs.python.org
Thu May 9 23:20:02 EDT 2019


Giampaolo Rodola' <g.rodola at gmail.com> added the comment:

Patch LGTM. I'd like to point out one thing for posterity. Current shutil code catches EPERM but not EACCES. While reviewing the patch I wondered whether simply catching (and ignoring) both error codes instead, but it turns out they are supposed to have 2 different meanings:
https://stackoverflow.com/a/35879961/376587
Especially after _copyxattr is moved before chmod() EACCES (permission denied) should propagate instead of being silenced, and EPERM should be left in place because in this case EPERM acts more like an ENOTSUP (operation not supported) than EACCES (permission denied) and as such should rightly be ignored.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24538>
_______________________________________


More information about the Python-bugs-list mailing list