Tachyon's `pstats_collector` does not respect "no-color" modes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
- gh-154344
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the python -m profiling.sampling run --pstats test.py entry point and inspect the color-handling helper in Lib/_colorize.py. Verify the pstats collector respects NO_COLOR=1 and that redirected output contains no ANSI escape sequences.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100