From e00fffc918da5cd6c3c749d1d2e59d8ae6835189 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Tue, 28 Nov 2023 16:51:10 -0500 Subject: [PATCH] Shorten comments on _decode steps This removes the parenthesized examples from the per-step comments in the WinBashStatus._decode helper. --- test/test_index.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/test_index.py b/test/test_index.py index bfdbca867..cd1c37efc 100644 --- a/test/test_index.py +++ b/test/test_index.py @@ -139,10 +139,6 @@ def _decode(stdout): # uses the ASCII subset, so we can safely guess a wrong code page for it. Errors # from such an environment can contain any text, but unlike WSL's own messages, # they go to stderr, not stdout. So we can try the system ANSI code page first. - # (Console programs often use the OEM code page, but the ACP seems more accurate - # here. For example, on en-US Windows with the original system code page but the - # display language set to fr-FR, the message, if not UTF-16LE, is windows-1252, - # same as the ACP, while the OEMCP is 437, which can't decode its accents.) acp = _get_windows_ansi_encoding() try: return stdout.decode(acp) @@ -151,10 +147,7 @@ def _decode(stdout): except LookupError as error: log.warning("%s", str(error)) # Message already says "Unknown encoding:". - # Assume UTF-8. If invalid, substitute Unicode replacement characters. (For - # example, on zh-CN Windows set to display fr-FR, errors from WSL itself, if not - # UTF-16LE, are in windows-1252, even though the ANSI and OEM code pages both - # default to 936, and decoding as code page 936 or as UTF-8 both have errors.) + # Assume UTF-8. If invalid, substitute Unicode replacement characters. return stdout.decode("utf-8", errors="replace")