build_filtered_chunks.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:sigir2017-bitfunnel 作者: BitFunnel 项目源码 文件源码
def cleanup(self):
        print("Cleaning up")
        if os.path.exists(self.temp):
            # The check for "tempxxx" is to guard against bugs with path operations
            # and command-line arguments which might lead to the accidental deletion
            # of an important directory.
            if "tempxxx" in self.temp:
                def handleRemoveReadonly(func, path, exc):
                    excvalue = exc[1]
                    if excvalue.errno == errno.EACCES:
                        os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)  # 0777
                        func(path)
                    else:
                        raise

                print("rmtree {0}".format(self.temp));
                shutil.rmtree(self.temp, ignore_errors=False, onerror=handleRemoveReadonly)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号