fix: use normalized path in ClassifiedFile for cross-platform consistency#574
Merged
qin-ctx merged 1 commit intovolcengine:mainfrom Mar 13, 2026
Merged
fix: use normalized path in ClassifiedFile for cross-platform consistency#574qin-ctx merged 1 commit intovolcengine:mainfrom
qin-ctx merged 1 commit intovolcengine:mainfrom
Conversation
qin-ctx
approved these changes
Mar 13, 2026
|
|
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When creating
ClassifiedFileobjects indirectory_scan.py, the unnormalizedrel_pathwas used instead of the already-computedrel_path_norm. This caused inconsistent path formats on Windows systems (backslashes vs forward slashes).在
directory_scan.py中创建ClassifiedFile对象时,使用了未规范化的rel_path而不是已经计算好的rel_path_norm。这导致 Windows 系统上的路径格式不一致(反斜杠与正斜杠混用)。Solution
Changed line 272 to use
rel_path_norminstead ofrel_path:修改第 272 行,使用
rel_path_norm替代rel_path:Related Issue
fixed #540
Type of Change
Changes Made
Testing
The fix has been verified with a mocked Windows path integration test. The test uses
PureWindowsPathto simulate Windows-style path separators and confirms that directory structure is preserved correctly.此修复已通过模拟 Windows 路径的集成测试验证。测试使用
PureWindowsPath模拟 Windows 风格的路径分隔符,确认目录结构被正确保留。🔗 Test Script: test_issue_540.py
run
python test_issue_540.pyChecklist
Screenshots (if applicable)
Additional Notes