[issue43657] shutil.rmtree fails on readonly files in Windows, onerror not called

2021-03-29 Thread Eryk Sun
Eryk Sun added the comment: > The doc on rmtree states > Exceptions raised by onerror will not be caught. > Does this mean I can't use try/exept inside of onerro rmtree() does not call onerror() in a try/except statement. An exception raised in onerror() will propagate to the scope that

[issue43657] shutil.rmtree fails on readonly files in Windows, onerror not called

2021-03-29 Thread Walter White
Change by Walter White : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43657] shutil.rmtree fails on readonly files in Windows, onerror not called

2021-03-29 Thread Walter White
Walter White added the comment: I tried to add a try/except that handles a PermissionError to my onerror function. But that did not work. The doc on rmtree states Exceptions raised by onerror will not be caught. Does this mean I can't use try/exept inside of onerror? -- status:

[issue43657] shutil.rmtree fails on readonly files in Windows, onerror not called

2021-03-29 Thread Walter White
Change by Walter White : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue43657] shutil.rmtree fails on readonly files in Windows, onerror not called

2021-03-29 Thread Walter White
Walter White added the comment: Just saw: class PermissionError(OSError) -- ___ Python tracker ___ ___ Python-bugs-list

[issue43657] shutil.rmtree fails on readonly files in Windows, onerror not called

2021-03-29 Thread Walter White
New submission from Walter White : shutil.rmtree fails on readonly files in Windows. Usually people are using the onerror callback to handle file permissions and retry, but that is not possible in this case because it is not triggerd. onerror is only triggered if a OSError is found. In my