Skip to content

Preserve atomic Cython output for write-only streams - #2721

Merged
DanielNoord merged 2 commits into
PyCQA:mainfrom
xiehuanyi:fix-atomic-cython-output
Oct 18, 2026
Merged

DanielNoord merged 2 commits into
PyCQA:mainfrom
xiehuanyi:fix-atomic-cython-output

Conversation

@xiehuanyi

Copy link
Copy Markdown
Contributor

Atomic sorting of Cython into stdout or another write-only stream currently emits no content. The validation read consumes the buffer; the deliberately ignored Python syntax error for Cython skips the rewind, so the subsequent copy reads EOF.

Rewind after the validation block for all accepted output. Add .pyx/.pxd regressions with non-atomic controls and a changelog entry.

Validation: the two atomic cases fail before and all four cases pass afterward. Real python -m isort --atomic --stdout restores the sorted output for both extensions; invalid Python still raises ExistingSyntaxErrors without output. The 20 API/IO tests and default unit suite pass (676 passed, one existing skip). Changed-file mypy/Flake8, Ruff check/format, the hug profile, repository pre-commit checks and Bandit pass.

Prepared and verified with Codex (GPT-6.1-sol) assistance.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 19:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread CHANGELOG.md Outdated
@DanielNoord
DanielNoord enabled auto-merge October 18, 2026 15:17
@codecov

codecov Bot commented Oct 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.37%. Comparing base (92c5685) to head (7169382).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2721      +/-   ##
==========================================
- Coverage   99.38%   99.37%   -0.01%     
==========================================
  Files          41       40       -1     
  Lines        3230     3224       -6     
  Branches      690      689       -1     
==========================================
- Hits         3210     3204       -6     
  Misses         12       12              
  Partials        8        8              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DanielNoord
DanielNoord added this pull request to the merge queue Oct 18, 2026
Merged via the queue into PyCQA:main with commit 1745766 Oct 18, 2026
37 checks passed
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.

3 participants