Bug 2325502
| Summary: | python3-idle not dealing with Python3.13 interpreter colors | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Wolfgang Maier <maierw> |
| Component: | python3.13 | Assignee: | Python Maintainers <python-maint> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 41 | CC: | ksurma, mhroncok, python-maint, python-packagers-sig, vstinner |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| URL: | https://discussion.fedoraproject.org/t/fix-idle3-not-dealing-with-python3-13-interpreter-colors/136590 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2025-02-26 13:07:49 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Wolfgang Maier
2024-11-12 14:52:08 UTC
I can reproduce this with Python 3.13. It is fixed in Python 3.14.0a1. When I build Python 3.13.0 from git source, I cannot reproduce this :/ When I build Python 3.13.0 from our RPM, I can still reproduce this. IDLE has a different code path depending on sys.excepthook. On Fedora, ABRT installs a special hook in sys.excepthook. (A) ABRT case: * IDLE replaces sys.stderr with a idlelib.run.StdOutputFile object at startup. * _colorize.can_colorize() returns True because StdOutputFile.isatty() always return True. (B) Default case: * IDLE replaces sys.stderr with io.StringIO() to call the "excepthook". * _colorize.can_colorize() returns False. ABRT comes python3-abrt-addon package, main files: * /usr/lib/python3.13/site-packages/abrt3.pth * /usr/lib/python3.13/site-packages/abrt_exception_handler3.py I'm not sure why IDLE StdOutputFile pretends to be a TTY, whereas it's not. I reported the issue to Python upstream: https://github.com/python/cpython/issues/127060 > I reported the issue to Python upstream: https://github.com/python/cpython/issues/127060 I fixed the issue. The 3.13 fix: https://github.com/python/cpython/commit/f8b4e20137b5c5d1e99cbf6c8f35f7041785b4c1. The fix will be part of the next Python 3.13 release (3.13.2, scheduled at 2025-02-04). > A simple fix is to pass PYTHON_COLORS=0 to idle through its .desktop file.
Another workaround is to set TERM environment variable to "dumb" when running IDLE.
This was fixed in https://github.com/python/cpython/pull/128052 -- it did not make it into 3.13.1. We can backport it if needed. |