29 Star 13 Fork 88

openGauss / Yat

 / 详情

运行结果会报错ValueError:I/O operation on closed file

已完成
缺陷
创建于  
2021-10-27 17:28

输入图片说明
指向的文件为
输入图片说明

评论 (2)

miaaaa 创建了缺陷

Hey @miaaaa, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at https://gitee.com/opengauss/community/blob/master/contributors/command.en.md to find the details.

zhangxubo 添加了
 
sig/tools
标签

这里做开源整改改的有问题,应该改成下面这样,有权限的同学改一下吧

class _DiffCollectHandler:
    # ... other code
    def __call_(self, file, is_dir, base):
        # ... other code
        if file.endswitch(...
            with open(file) as diff:
                content = diff.read()
                self.output.write(self.DIFF_SEPARATOR)
                self.output.write(content)
                self.output.flush()
                # 不能再这里close self.output,这个函数会被反复调用,这里close,下次调用就会写入已经关闭的流了

    def close(self):
        self.output.close()

# 在下面的collect_diff_file函数中使用_DiffCollectHandler完毕后再关闭

def collect_diff_file(suite_dir):
    # ... other code
    if os.path.exists(result_result):
        handler = _DiffCollectionHandler(...)
        try:
            scan_path(result_dir, handler)
        finally:
            # 确保流一定会关闭
            handler.close()

yansong_lee 通过opengauss/Yat Pull Request !7任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
5622128 opengauss bot 1581905080
1
https://gitee.com/opengauss/Yat.git
git@gitee.com:opengauss/Yat.git
opengauss
Yat
Yat

搜索帮助