Miro Hrončok
96f496a949
gh-141570: can_colorize: Expect fileno() to raise OSError, as documented ( #141716 )
...
In Fedora, we've been given a slightly incomplete reproducer for a problematic
Python 3.14 color-related change in argparse that leads to an exception when
Python is used from mod_wsgi: https://bugzilla.redhat.com/2414940
mod_wsgi replaces sys.stdout with a custom object that raises OSError on .fileno():
8460dbfcd5/src/server/wsgi_logger.c (L434-L440)
This should be supported, as the documentation of fileno explicitly says:
> An OSError is raised if the IO object does not use a file descriptor.
https://docs.python.org/3.14/library/io.html#io.IOBase.fileno
The previously expected exception inherits from OSError,
so it is still expected.
Fixes https://github.com/python/cpython/issues/141570
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-19 15:02:52 +01:00
Savannah Ostrowski
40096da95a
GH-139946: Colorize error and warning messages in argparse ( #140695 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-04 16:31:35 +00:00
Bénédikt Tran
387ac2d2f3
gh-133346: make _colorize.Argparse kw-only constructible ( #140620 )
...
Other themes are kw-only constructible.
2025-10-26 11:33:57 +00:00
yihong
8ef7735c53
gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value for macOS (GH-138089)
...
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-09-15 18:26:23 +02:00
Stan Ulbrych
a5b9d0b8b2
gh-134953: Expand theming for True/False/None ( #135000 )
...
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-09-15 16:36:17 +02:00
Douglas Thor
34d7351ac7
gh-133722: Add Difflib theme to _colorize and 'color' option to difflib.unified_diff ( #133725 )
2025-08-08 18:34:02 +03:00
Łukasz Langa
f610bbdf74
gh-133346: Make theming support in _colorize extensible (GH-133347)
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-05 23:45:25 +02:00
Łukasz Langa
fac41f56d4
gh-131507: Add support for syntax highlighting in PyREPL (GH-133247)
...
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-02 20:22:31 +02:00
Hugo van Kemenade
4701ff92d7
gh-130645: Add color to argparse help (GH-132323)
2025-05-02 15:06:10 +02:00
Łukasz Langa
5d8e981c84
gh-131507: Clean up tests and type checking for _pyrepl ( #131509 )
2025-03-21 15:48:10 +01:00
Hugo van Kemenade
9546fe2ef2
gh-129061: Fix FORCE_COLOR and NO_COLOR when empty strings ( #129140 )
2025-01-27 16:24:10 +02:00
Hugo van Kemenade
05d12eecbd
gh-127873: Only check sys.flags.ignore_environment for PYTHON* env vars ( #127877 )
2025-01-21 16:10:08 +00:00
Hugo van Kemenade
6f167d7134
gh-128595: Default to stdout isatty for colour detection instead of stderr ( #128498 )
...
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-20 12:52:42 +02:00
Hugo van Kemenade
f21af186bf
gh-128317: Highlight today in colour in calendar CLI output ( #128318 )
...
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-01-03 14:56:24 +02:00
Andrey Efremov
0ac40acec0
gh-127353: Allow to force color output on Windows V2 ( #127926 )
2024-12-14 17:25:49 +02:00
Hugo van Kemenade
a8ffe66154
Revert "gh-127353: Allow to force color output on Windows ( #127354 )" ( #127889 )
...
This reverts commit 365451e283 .
2024-12-12 21:11:20 +00:00
Andrey Efremov
365451e283
gh-127353: Allow to force color output on Windows ( #127354 )
2024-12-12 22:17:39 +02:00
Hugo van Kemenade
3b3f8dea57
gh-117225: Move colorize functionality to own internal module ( #118283 )
2024-05-01 12:27:06 -06:00