Skip to content

Compatibility with Python 3.14 argparse.ArgumentParser color argument #76

@dieterd-sentea

Description

@dieterd-sentea

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions