Repository navigation
Write Markdown coverage reports as UTF-8 - #774
Open
anticipate218 wants to merge 1 commit into
Open
anticipate218 wants to merge 1 commit into
anticipate218 wants to merge 1 commit into
Conversation
Use UTF-8 for Markdown report files so non-ASCII source filenames cannot crash reporting under a legacy locale encoding. Assisted-by: OpenAI Codex
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.
Write both Markdown report modes as UTF-8. On a Windows process with UTF-8 mode disabled, a passing test in a source file with an emoji filename currently ends with an internal
UnicodeEncodeErrorand exit code 3 while generating eithermarkdownormarkdown-append. The report streams use the locale encoding becausePath.open()has no explicit encoding.This changes only the encoding of those two report streams. The regression exercises real report generation with an ASCII default opener and checks the Unicode filename and append preservation. Changelog and author credits are included as requested by the contribution guide. Existing non-UTF-8 Markdown files are not transcoded.
Related: #772 updates precision in the neighboring reporting calls; this change leaves precision and coverage calculations unchanged.
Validation: the final regression fails in both modes on the original source. The full local suite passes (214 passed, 6 existing Windows skips), as do Ruff, applicable configured file checks, Sphinx HTML, sdist/wheel builds and twine strict. The complete tox/prek wrappers and other Python/OS combinations were not run. Sphinx linkcheck was stopped at 240 seconds after repeated GitHub connection timeouts and is not claimed as passing. Independent Windows CLI checks covered UTF-8 mode on/off, ASCII/emoji source filenames, a Unicode report path, and preservation/replacement of an existing UTF-8 prefix. Other platforms, Python versions, and the full tox environment matrix were not run.
AI assistance: Codex prepared this change and tests. A separate agent reviewed the implementation and ran independent CLI checks.