> On 13 May 2021, at 02:09, Mike Miller <[email protected]> wrote: > > >> On 2021-05-11 16:12, Guido van Rossum wrote: >> On Tue, May 11, 2021 at 4:07 PM Gregory P. Smith <[email protected] >> There's a difference between tracebacks dumped as plain text (utf-8) by >> traceback.print_exc() appearing on stderr or directed into log files and >> what can be displayed within a terminal. It is highly unusual to emit >> terminal control characters into log files. >> And yet it happens all the time. :-( Let's not risk that happening. > > > os.isatty() is helpful in that situation,
Most tools that support colour output allow you to customise the colours and have a always-colour, never-colour, auto-colour option. Isatty() is useful for the auto. Barry > > -Mike > > _______________________________________________ > Python-Dev mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/QT2CTAPV7BVUHEUR6OY6DKWTNX6WM5MF/ > Code of Conduct: http://python.org/psf/codeofconduct/ _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/I5A6JSFVERDC6YG6CNHSJQTY4CDUTSY6/ Code of Conduct: http://python.org/psf/codeofconduct/
