Skip to content

Recognize standard control separators in line iteration - #693

Open
Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/splitlines-control-boundaries
Open

Gambit-Checkmate wants to merge 1 commit into
mahmoud:masterfrom
Gambit-Checkmate:fix/splitlines-control-boundaries

Conversation

@Gambit-Checkmate

@Gambit-Checkmate Gambit-Checkmate commented Oct 31, 2026 •

Copy link
Copy Markdown

The change

Closes #692.

Recognize U+001C/U+001D/U+001E (file/group/record separators) in iter_splitlines' line-ending pattern, matching the corresponding str.splitlines boundaries. indent uses the same iterator and now indents each logical line for these inputs. The documented terminal empty-line behavior remains unchanged.

Ten regression/control cases cover leading/interior/trailing boundaries for all three separators, indentation, existing CRLF/Unicode/other line endings and empty input. On pristine d31d821, nine fail and one control passes. This complements #475's Unicode escape correction rather than duplicating it.

Validation on Windows / CPython 3.13.13:

  • Full tests/module doctests: 784 passed, 1 skipped, 22 subtests passed.
  • New-test Ruff E9/F and format, Python3.7 syntax parsing, compileall and git diff checks passed.
  • Full strutils Ruff E9/F reports two pre-existing issues (unused builtins import and duplicate formula dictionary key), independently reproduced on pristine master; not changed here.
  • Wheel and sdist builds passed. Other platforms/interpreters await hosted CI; no coverage percentage claimed.
  • Unreleased changelog updated, no version bump.

The backstory

My earlier #601 was acknowledged and incorporated in #609. Comparing the existing line iterator with builtin str.splitlines during code inspection exposed these missing control boundaries. This was verified with small executable examples, not a claim of personal production usage. Existing issues/PRs, including #475, were checked before filing the linked report.

AI assistance

  • Harness/tooling: OpenAI Codex, Git, GitHub CLI/API, Python, pytest and Ruff. Codex performed investigation, implementation, testing and submission.
  • Model(s): GPT-6 family; the exact deployment identifier is not exposed in this session.
  • Original prompt(s), relevant verbatim excerpts from the daily automation (the mailbox workflow and local memory path are omitted):

每天早上 8 点在本会话实际提交两个高质量的开源贡献 PR,把创建并获得 GitHub PR 链接作为每日完成目标。首批候选不合适时必须继续扩大仓库与问题搜索范围,不因候选重复、单个问题困难或尚未发现合适 issue 就结束;没有合适公开 issue 时可以检查代码、复现真实缺陷,确认无重复后报告问题并提交独立修复。

只有改动真实、有依据、验证充分且账号有权限时才推送分支并创建 PR;绝不降低 star 门槛,不提交空改动、无关改动、未经验证或重复 PR,尊重上游 AI 贡献和认领规则。

Hosted CI: Actions run41148298751 is action_required for external-contribution approval; no hosted tests have executed for this head.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iter_splitlines omits file, group and record separators

1 participant