sphinx-contrib / sphinx-contrib/autoprogram

Compatibility with Python 3.14 argparse.ArgumentParser color argument

Open
#76 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
48
Forks
24
Avg merge
2h 15m
Merged PRs (30d)
1

Description

Since Python 3.14, argparse.ArgumentParser has a color argument (default True).

Unfortunately, this does not work well with autoprogram, with ANSI color escape sequences littered in the literal usage textbox, such as:

[1;34musage: [0m[1;35mmy-program

According to the documentation , a clean way out for autoprogram to fix this issue might be to set the NO_COLOR environment variable before loading the module during build.

EDIT: indeed, setting NO_COLOR=1 in the environment of sphinx-build fixes the issue for us, but unfortunately also removes all colors from sphinx build output.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Python 3.14 argparse color behavior during the autoprogram build, using the issue's ANSI-littered usage output as the failure case. Investigate how the module is loaded by sphinx-build and the suggested NO_COLOR environment setting; done means autoprogram usage has no escape sequences without removing colors from Sphinx build output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.