Skip to content

[BUG] spaces stripped from password #3931

@ncanceill

Description

@ncanceill

Describe the bug

Using prompt.Prompt.ask(...) to require a password will call str.strip() on the input. Therefore any leading or trailing spaces will be deleted from the provided password.

>>> from rich.prompt import Prompt
>>> foo = Prompt.ask("Pass?", password=True)
Pass?:  # Enter '123 ' at the prompt
>>> repr(foo)
"'123'"  # Trailing space is missing

See pull request #3932 for more details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions