Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chevron crash with minimal parameters #126

Open
Pyrrha opened this issue Jan 4, 2024 · 1 comment
Open

chevron crash with minimal parameters #126

Pyrrha opened this issue Jan 4, 2024 · 1 comment

Comments

@Pyrrha
Copy link

Pyrrha commented Jan 4, 2024

Hello,

I just installed the executable from pip and tried to run it.

The chevron command works fine:

$ chevron
usage: chevron [-h] [-v] [-d DATA] [-p PARTIALS_PATH] [-e PARTIALS_EXT] [-l DEF_LDEL] [-r DEF_RDEL] [-w] template
chevron: error: the following arguments are required: template

But adding only the mandatory argument make it crash:

$ chevron template.mustache
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/chevron", line 8, in <module>
    sys.exit(cli_main())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chevron/main.py", line 100, in cli_main
    sys.stdout.write(main(**args))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chevron/main.py", line 19, in main
    with io.open(data, 'r', encoding='utf-8') as data_file:
TypeError: expected str, bytes or os.PathLike object, not dict

I'm expecting the command result to not crash, and render the template without any data instead of tokens, according to current behaviour when tokens keys are missing in json file.

What do you think?

@FaridFArab
Copy link

Hi @Pyrrha, Would you tell me which Python version do you use ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants