summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2020-11-10 16:06:02 (GMT)
committerGitHub <noreply@github.com>2020-11-10 16:06:02 (GMT)
commite59b2deffde61e5641cabd65034fa11b4db898ba (patch)
treec8f4405fcd90bbd902797987f817277fc4f8c92b /Lib/shutil.py
parent3eb284622579d04289d0e3b2e97fbf56df6e845e (diff)
downloadcpython-e59b2deffde61e5641cabd65034fa11b4db898ba.zip
cpython-e59b2deffde61e5641cabd65034fa11b4db898ba.tar.gz
cpython-e59b2deffde61e5641cabd65034fa11b4db898ba.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
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 223e9a8..f0e833d 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)):