Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-42014: shutil.rmtree: call onerror with correct function #22585

Merged
merged 2 commits into from
Nov 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
shutil.rmtree: call onerror with correct function
The onerror is supposed to be called with failed function, but in this case lstat is wrongly used instead of open.
nijel authored Oct 7, 2020
commit 7424b4543315efaa35b6337cdcc27e572193eabc
2 changes: 1 addition & 1 deletion Lib/shutil.py
Original file line number Diff line number Diff line change
@@ -708,7 +708,7 @@ def onerror(*args):
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)):