Skip to content

refactor(core): remove whitespace trimming from path normalization and rename#7801

Open
erickguan wants to merge 2 commits into
mainfrom
path-norm
Open

refactor(core): remove whitespace trimming from path normalization and rename#7801
erickguan wants to merge 2 commits into
mainfrom
path-norm

Conversation

@erickguan

@erickguan erickguan commented Jun 19, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Implements RFC 7799's path normalization part.

Also closes #6577

Rationale for this change

  • Improve readability and documentation
  • More defined path normalization conventions, rules, and who should use what.

What changes are included in this PR?

  • Remove .trim() from normalize_path to preserve whitespace in path components, aligning with POSIX, URI, and object-store conventions where whitespace is significant content.
  • Add . segment filtering to both normalize_path and normalize_root so that ./a/./b normalizes to a/b.
  • Introduce build_absolute_path, build_rooted_absolute_path, and build_relative_path as the canonical names; deprecate the old build_abs_path, build_rooted_abs_path, build_rel_path aliases.
  • Use doctests when possible
  • Update services to use the new function names.

Are there any user-facing changes?

No

AI Usage Statement

GPT-5.5 with codex implements some code.

@erickguan erickguan changed the title WIP refactor(core): remove whitespace trimming from path normalization refactor(core): remove whitespace trimming from path normalization and rename Jun 21, 2026
@erickguan erickguan marked this pull request as ready for review June 21, 2026 12:23
@erickguan erickguan requested a review from Xuanwo as a code owner June 21, 2026 12:23
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor" labels Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor" size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: fail to read files with trailing whitespaces

1 participant