开发者

What is a complete list of Exceptions that can be thrown by shutil.rmtree

开发者 https://www.devze.com 2023-03-04 20:59 出处:网络
I am using the rmtree method 开发者_JAVA技巧from shutil in Python (2.7). What are all possible exceptions that can occur while calling this method?According to the implementation, you\'ll have to che

I am using the rmtree method 开发者_JAVA技巧from shutil in Python (2.7).

What are all possible exceptions that can occur while calling this method?


According to the implementation, you'll have to check OSError. But you can use the argument ignore_errors=True on call to...ignore errors ;) or give a callback onerror that will check the exceptions during the execution of file removal. (cf shutil.rmtree documentation)


Unless you do something very funky, os.error and OSError

0

精彩评论

暂无评论...
验证码 换一张
取 消