From 0126568b48aacce6381ce714d1797be7b76eacce Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 16:24:48 +0000 Subject: [PATCH] Fix NO_COLOR spec compliance and transposed letters typo in test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - NO_COLOR check now disables color when the variable is present regardless of value, per the no-color.org spec. Previously only NO_COLOR=1 was honored. - Fix transposed "ji" → "ij" in test_clean_ascii alphabet string. - Update test_pty_color to expect no-color output when NO_COLOR=0, matching the corrected behavior. https://claude.ai/code/session_014Qvwfhuw1DH4BJNdzrM6x1 --- .../python3/dist-packages/unicode_show/tests/unicode_show.py | 4 ++-- usr/lib/python3/dist-packages/unicode_show/unicode_show.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/lib/python3/dist-packages/unicode_show/tests/unicode_show.py b/usr/lib/python3/dist-packages/unicode_show/tests/unicode_show.py index dff4ff3e..110092bc 100644 --- a/usr/lib/python3/dist-packages/unicode_show/tests/unicode_show.py +++ b/usr/lib/python3/dist-packages/unicode_show/tests/unicode_show.py @@ -374,7 +374,7 @@ def test_clean_ascii(self) -> None: test_string: str = ( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]" - + "^_`abcdefghjiklmnopqrstuvwxyz{|}~\n" + + "^_`abcdefghijklmnopqrstuvwxyz{|}~\n" ) self._test_stdin( main_func=unicode_show_main, @@ -480,7 +480,7 @@ def test_pty_color(self) -> None: self._test_stdin_pty( main_func=unicode_show_main, argv0=self.argv0, - stdout_string=expect_string_color, + stdout_string=expect_string_nocolor, exit_code=1, args=[], stdin_string=test_string, diff --git a/usr/lib/python3/dist-packages/unicode_show/unicode_show.py b/usr/lib/python3/dist-packages/unicode_show/unicode_show.py index 6a5c01a3..671586f9 100644 --- a/usr/lib/python3/dist-packages/unicode_show/unicode_show.py +++ b/usr/lib/python3/dist-packages/unicode_show/unicode_show.py @@ -174,7 +174,7 @@ def main() -> int: global USE_COLOR USE_COLOR = ( not os.getenv("NOCOLOR") - and os.getenv("NO_COLOR") != "1" + and os.getenv("NO_COLOR") is None and os.getenv("TERM") != "dumb" and sys.stdout.isatty() )