Skip to content

CLI: SyntaxError: f-string expression part cannot include a backslash #19

Description

@matgille

Hi @mittagessen,

There seem to be an error with the CLI, I've got a
SyntaxError: f-string expression part cannot include a backslash with the following command:
party -d cuda:0 ocr -i ../entrainements_htr/front_justice/front_justice_150_p_htr/11_J_76-0633.xml out_fra.xml --load-from-repo 10.5281/zenodo.15075344 -l fra.

Party was installed following the instructions on the README, on python 3.10.

Problematic line is in party/cli/pred.py:

@click.command('ocr',
               epilog=f"""
\b
Language codes known to party:
{'\n'.join(' -> '.join((k.replace("_", " ").title(), v)) for k, v in LANG_TO_ISO.items())}
                       """)

Replacing the \n char with any other character fixes the problem. I can provide a fix if you want.

Best,

Matthias

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions