diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-11-10 16:27:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 16:27:02 (GMT) |
commit | c745b36ee3786fabc9231a43c085218df27dcd47 (patch) | |
tree | c9c90841f7ab751ff5e115b7fc2aefbd1ec1cab3 /Lib | |
parent | 109c17315af124b25853c248f4a9bf00f03036f6 (diff) | |
download | cpython-c745b36ee3786fabc9231a43c085218df27dcd47.zip cpython-c745b36ee3786fabc9231a43c085218df27dcd47.tar.gz cpython-c745b36ee3786fabc9231a43c085218df27dcd47.tar.bz2 |
bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585)
The onerror is supposed to be called with failed function, but in this case lstat is wrongly used instead of open.
Not sure if this needs bug or not...
Automerge-Triggered-By: GH:hynek
(cherry picked from commit e59b2deffde61e5641cabd65034fa11b4db898ba)
Co-authored-by: Michal Čihař <michal@cihar.com>
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/shutil.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index 9d15149..6986bce 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -711,7 +711,7 @@ def rmtree(path, ignore_errors=False, onerror=None): try: fd = os.open(path, os.O_RDONLY) except Exception: - onerror(os.lstat, path, sys.exc_info()) + onerror(os.open, path, sys.exc_info()) return try: if os.path.samestat(orig_st, os.fstat(fd)): |