[issue25930] os.unlink != os.remove in python3.5

Anthony Sottile report at bugs.python.org
Tue Dec 22 19:11:51 EST 2015


Anthony Sottile added the comment:

Breaks this function:

```
def rmtree(path):
    """On windows, rmtree fails for readonly dirs."""
    def handle_remove_readonly(func, path, exc):  # pragma: no cover (windows)
        excvalue = exc[1]
        if func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES:
            os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
            func(path)
        else:
            raise
    shutil.rmtree(path, ignore_errors=False, onerror=handle_remove_readonly)
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25930>
_______________________________________


More information about the Python-bugs-list mailing list