chevron icon indicating copy to clipboard operation
chevron copied to clipboard

chevron crash with minimal parameters

Open Pyrrha opened this issue 1 year ago • 1 comments

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?

Pyrrha avatar Jan 04 '24 13:01 Pyrrha

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

FaridFArab avatar May 14 '24 10:05 FaridFArab