已合并
在FileManager.read_json_file和read_csv_file函数中解释文件无法读取的原因 #5455
zhangyin_gitcode创建于 2025年10月3日
在FileManager.read_json_file和read_csv_file函数中解释文件无法读取的原因 #5455
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 zhangyin_gitcode 的贡献)2025年10月3日 创建了 pull request,commit c7eac878
ascend-robot
2025年10月3日 评论:
2025年10月3日 评论:
2025年10月3日 添加了label:ascend-cla/no
zhangyin_gitcode
2025年10月3日 评论:
2025年10月3日 评论:
/check-cla


2025年10月3日 删除了label:ascend-cla/no
2025年10月3日 添加了label:ascend-cla/yes
zhangyin_gitcode
2025年10月3日 评论:
2025年10月3日 评论:
/compile


zhangyin_gitcode
2025年10月3日 评论:
2025年10月3日 评论:
compile


AtlasAccount
2025年10月3日 评论:
2025年10月3日 评论:
✅ 流水线任务触发成功,正在执行,请稍候。 任务链接[912a43040c4e4e18b1c49f42910e17aa]


fanglanyue
2025年10月17日 评论:
2025年10月17日 评论:
compile


AtlasAccount
2025年10月17日 评论:
2025年10月17日 评论:
✅ 流水线任务触发成功,正在执行,请稍候。 任务链接[501e1ac18dc1479483ff3b030cc427da]


2025年10月17日 添加了label:ci-pipeline-running
2025年10月21日 预合并成功(commit_id: 4b31fd66c2c48db7a6a5eff2096465b963953420)
2025年10月21日 预合并成功(commit_id: 5dd4b5911a920c49f3f60c40375fb678a9fc19bc)
ascend-robot
2025年10月21日 评论:
2025年10月21日 评论:
以下是根据您提交的修改文件推荐的Reviewer和Committer序列,需各模块评审通过后方可合入
| Module List | Reviewers | Committers |
|---|---|---|
| profiler/msprof_analyze | Seanesmhxocism, eejiechu | chenhao_1209, xhahn77, aerfaliang |


ascend-robot
2025年10月21日 评论:
2025年10月21日 评论:
CLA Signature Pass
@zhangyin_gitcode, thanks for your pull request. All authors of the commits have signed the CLA. 👍


fanglanyue
2025年10月23日 评论:
2025年10月23日 评论:
compile


AtlasAccount
2025年10月23日 评论:
2025年10月23日 评论:
✅ 流水线任务触发成功,正在执行,请稍候。 任务链接[898ec19804ba4ce799295463da402ee4]


2025年10月23日 删除了label:ci-pipeline-running
2025年10月23日 添加了label:ci-pipeline-passed
fanglanyue
2025年10月23日 评论:
2025年10月23日 评论:
compile


AtlasAccount
2025年10月23日 评论:
2025年10月23日 评论:
✅ 流水线任务触发成功,正在执行,请稍候。 任务链接[ebc3a94f26c44368bc4e35ec32637bf4]


2025年10月23日 删除了label:ci-pipeline-passed
2025年10月23日 添加了label:ci-pipeline-passed
xfeng
2025年10月23日 评论:
2025年10月23日 评论:
/lgtm


WangJie
2025年10月23日 评论:
2025年10月23日 评论:
/lgtm


profiler/msprof_analyze/prof_common/file_manager.py
@@ -69,3 +69,3 @@
6969 result_data.append(row_data)
7070 except Exception as e:
71- msg = f"Failed to read the file: {file_path}"
71+ msg = f"Failed to read the file: {file_path}, reason is {str(e)}"
[review] 这里的file_path和上面的base_name是否有经过路径校验,非法字符校验。确保没有相关转义字符等内容,否则建议使用%r打印,避免相关的转义字符被错误处理。


wangzixuan
2025年10月23日 评论:
2025年10月23日 评论:
/lgtm


2025年10月23日 添加了label:lgtm
chenhao_1209
2025年10月23日 评论:
2025年10月23日 评论:
/approve


2025年10月23日 添加了label:approved
ascend-robot
2025年10月23日 评论:
2025年10月23日 评论:
Review Guide
This Pull-Request Passes Review.
Committers who writed a comment of /approve are: chenhao_1209.
Reviewers who writed a comment of /lgtm are: eejiechu, Seanesmhxocism, chenhao_1209.


2025年10月23日 合入了pull request,合并节点 SHA:2534331d491652b693461c679803c2cacde06286
2025年10月23日 关联了issue:[Bug-Report|缺陷反馈]: FileManager.read_json_file和read_csv_file函数在读取出错时,没有解释原因
2025年10月23日 关联了issue:[Bug-Report|缺陷反馈]: FileManager.read_json_file和read_csv_file函数在读取出错时,没有解释原因
PR 合入模板
注:经过自检不涉及的可标注“不涉及”或直接打勾,特殊情况请文字备注。不符合规范的 PR 不允许合入,请(后备)commit 注意。
1. 修改描述
FileManager.read_json_file和read_csv_file函数在读取出错时,没有解释原因,只是提示“Failed to read the file:”,其行为与read_yaml_file和read_common_file函数不一致。后两者通过reason is {str(e)}给出了出错的原因。
这些原因对于使用者定位可能的错误非常重要。
FileManager.read_json_file和read_csv_file函数中,异常处理部分,均修改为类似如下的形式:
2. 功能验证
3. 分支合并要求
3. 代码检视
要求:
检视意见数:____ 条 (请填写本次检视的意见总数,用于commit合入前审视)
4. 安全自检
Python、C++:
C++:
5. 变更知会