-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesOS-windowsstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
In can_colorize function, nt._supports_virtual_terminal call takes precedence over checking of environment variables. If the terminal emulator does not support this mode, the environment variables are not checked. This is contrary to the behavior on POSIX OSes, where variables are checked first.
There are third-party terminal emulators that support ANSI color codes, but do not support the new API added in Windows 10. For example, ConEmu and Cmder.
Also, the current behavior makes it impossible to output errors with ANSI codes to a file or through a pipe.
Screenshot of exception in ConEmu terminal:
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
- gh-127353: Allow to force color output on Windows #127354
- [3.13] gh-127353: Allow to force color output on Windows (GH-127354) #127886
- Revert "gh-127353: Allow to force color output on Windows (#127354)" #127889
- gh-127353: Allow to force color output on Windows V2 #127926
- [3.13] gh-127353: Allow to force color output on Windows V2 (GH-127926) #127944
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesOS-windowsstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error