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.
Since Python 3.14,
argparse.ArgumentParserhas acolorargument (defaultTrue).Unfortunately, this does not work well with
autoprogram, with ANSI color escape sequences littered in the literal usage textbox, such as:According to the documentation , a clean way out for autoprogram to fix this issue might be to set the
NO_COLORenvironment variable before loading the module during build.EDIT: indeed, setting
NO_COLOR=1in the environment ofsphinx-buildfixes the issue for us, but unfortunately also removes all colors from sphinx build output.