From bc8f9236117553862074fe735057d1306960de30 Mon Sep 17 00:00:00 2001 From: Ian Hunt-Isaak Date: Mon, 4 Aug 2025 17:34:37 -0400 Subject: [PATCH] Fix git encoding issues with encoding test files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mark wrongenc.inc files as binary in .gitattributes to prevent encoding conversion issues on different platforms. These files contain intentional Latin-1 encoded content for testing Sphinx's encoding handling and should remain byte-for-byte identical. Fixes git errors like: - "failed to encode from UTF-8 to latin-1" - "patch does not apply" in pre-commit hooks - stash/unstash failures with these files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .gitattributes | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index c8acd10815a..40c912fb830 100644 --- a/.gitattributes +++ b/.gitattributes @@ -51,8 +51,11 @@ tests/roots/test-pycode/cp_1251_coded.py dos # Non UTF-8 encodings tests/roots/test-pycode/cp_1251_coded.py working-tree-encoding=windows-1251 -tests/roots/test-root/wrongenc.inc working-tree-encoding=latin-1 -tests/roots/test-warnings/wrongenc.inc working-tree-encoding=latin-1 + +# Encoding test files - treated as binary to prevent encoding conversion issues +# These files contain intentional Latin-1 encoded content for testing Sphinx's encoding handling +tests/roots/test-root/wrongenc.inc binary +tests/roots/test-warnings/wrongenc.inc binary # Generated files # https://github.com/github/linguist/blob/master/docs/overrides.md