Skip to content

Remove click strip_ansi monkey patch #172

Description

@bckohan

This is a patch to fix lazy translation failure in some circumstances when Argument helps are gettext_lazy proxies.

This will require an upstream patch on Typer. The attribute error is caused by this function attempting to call a str function on a lazy string object.

# this is a patch to fix lazy translation failure in some circumstances
# when Argument helps are gettext_lazy proxies. This is I think actually
# a problem with typer that can be fixed in a number of different ways
# but this is the easiest
from typer._click import _compat
strip_ansi = _compat.strip_ansi
_compat.strip_ansi = lambda value: strip_ansi(str(value))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions