Skip to content

after 3.0.52 questions using a "when" expression and selecting "no" triggers a VSplit crash #2013

@ur-anbu

Description

@ur-anbu

Copier uses questionary 2.1.0 which which looks like it have a open ended dependency on prompt_toolkit. Running a simple questionary in Copier that uses a "when" criteria when answering "no", crashes in 3.0.52. 3.0.51 and earlier is working fine.

Copier template example:

copier.yml

includeFrontend:
    type: bool
    help: Do you want to include a Web frontend
    default: true

includeDocker:
    type: bool
    help: Do you want to include a Container Backend
    default: true

frontendType:
    type: str
    help: What type of frontend
    choices:
        - angular
        - javascript
    when: "{{ includeFrontend }}"

running " copier copy . ." in the folder with the copier.yml, and selecting "no" trigger a crash.

File ".../python3.9/site-packages/questionary/prompts/common.py", line 591, in _fix_unecessary_blank_lines
default_container.get_children()[0].content.get_children()[1].content # type: ignore[attr-defined]
AttributeError: 'VSplit' object has no attribute 'content'

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