def remove_safe_file(self, path):
if not SideBarSelection().isNone(path):
try:
os.remove(path)
except:
try:
if not os.access(path, os.W_OK):
import stat
os.chmod(path, stat.S_IWUSR)
os.remove(path)
except:
# raise error in case we were unable to delete.
if os.path.exists(path):
print("Unable to remove file:\n"+path)
os.remove(path)
else:
print('path is none')
print(path)
评论列表
文章目录