New submission from Michal Čihař <mic...@cihar.com>:

The onerror callback is called with os.lstat when the actual failing function 
is os.open.

To reproduce create directory that can not be listed:

import os
import shutil

def onerror(func, path, exc_info):
    print(func)

os.mkdir("test")
os.chmod("test", 0)
shutil.rmtree("test", onerror=onerror)

----------
components: Library (Lib)
messages: 378495
nosy: nijel
priority: normal
pull_requests: 21642
severity: normal
status: open
title: shutil.rmtree calls onerror with different function than failed
type: behavior
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42014>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to