This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients PeterFS, eryksun
Date 2021-03-17.20:14:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616012044.04.0.371725685466.issue39340@roundup.psfhosted.org>
In-reply-to
Content
> What I would expect is a consistent behaviour and as a 
> user I am not interested in inner guts of differences 
> between filesystems.

It's already consistent. msg360033 contains a misunderstanding about what write permission on a file means in Unix. The parent directory controls whether a file can be unlinked -- except for immutable files. For example:

    $ mkdir test; touch test/file.txt; chmod -w test
    $ python3.8 -c "import shutil; shutil.rmtree('test')"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.8/shutil.py", line 715, in rmtree
        _rmtree_safe_fd(fd, path, onerror)
      File "/usr/lib/python3.8/shutil.py", line 672, in _rmtree_safe_fd
        onerror(os.unlink, fullname, sys.exc_info())
      File "/usr/lib/python3.8/shutil.py", line 670, in _rmtree_safe_fd
        os.unlink(entry.name, dir_fd=topfd)
    PermissionError: [Errno 13] Permission denied: 'file.txt'
History
Date User Action Args
2021-03-17 20:14:04eryksunsetrecipients: + eryksun, PeterFS
2021-03-17 20:14:04eryksunsetmessageid: <1616012044.04.0.371725685466.issue39340@roundup.psfhosted.org>
2021-03-17 20:14:04eryksunlinkissue39340 messages
2021-03-17 20:14:03eryksuncreate