Bug report
Bug description:
The Tachyon sampling profiler always emits colored output when used with the pstats collector. For example, the NO_COLOR environment variable is currently not respected:
NO_COLOR=1 python -m profiling.sampling run --pstats test.py
Enabling this would be useful e.g. in cases where the output is redirected into a file for further processing, as it avoids including ANSI escape sequences in the file.
There is already a helper function available in the project that could be used to enable this functionality:
https://github.com/python/cpython/blob/main/Lib/_colorize.py#L564-L605
If you think this would be a useful addition/fix, I'd be happy to work on a patch PR.
Best, Peter
CPython versions tested on:
3.15
Operating systems tested on:
No response
Linked PRs
Bug report
Bug description:
The Tachyon sampling profiler always emits colored output when used with the
pstatscollector. For example, theNO_COLORenvironment variable is currently not respected:Enabling this would be useful e.g. in cases where the output is redirected into a file for further processing, as it avoids including ANSI escape sequences in the file.
There is already a helper function available in the project that could be used to enable this functionality:
https://github.com/python/cpython/blob/main/Lib/_colorize.py#L564-L605
If you think this would be a useful addition/fix, I'd be happy to work on a patch PR.
Best, Peter
CPython versions tested on:
3.15
Operating systems tested on:
No response
Linked PRs
pstats_collectormodule #154344