def rm_read_only(fn, tmp, info):
    if os.path.isfile(tmp):
        os.chmod(tmp, stat.S_IWRITE)
        os.remove(tmp)
    elif os.path.isdir(tmp):
        os.chmod(tmp, stat.S_IWRITE)
        shutil.rmtree(tmp)
 
tmp = 'out'
if os.path.isdir(tmp):
    shutil.rmtree(tmp, onerror=rm_read_only)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-10-02
  • 2021-05-25
  • 2022-12-23
猜你喜欢
  • 2021-09-26
  • 2022-12-23
  • 2022-02-26
  • 2021-09-30
  • 2021-09-27
相关资源
相似解决方案