llm icon indicating copy to clipboard operation
llm copied to clipboard

TypeError: 'PosixPath' object is not iterable when running llm templates edit

Open iqbalabd opened this issue 11 months ago • 1 comments

I'm getting a TypeError: 'PosixPath' object is not iterable error when I try to edit a template via llm:

$ python --version
Python 3.10.12
$ llm --version
llm, version 0.25

When I try to edit a template:

$ llm templates edit cleanup-manuscript
Traceback (most recent call last):
  File "/home/iqbal/.venv/pyllm/bin/llm", line 8, in <module>
    sys.exit(cli())
  File "/home/iqbal/.venv/pyllm/lib/python3.10/site-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
  File "/home/iqbal/.venv/pyllm/lib/python3.10/site-packages/click/core.py", line 1363, in main
    rv = self.invoke(ctx)
  File "/home/iqbal/.venv/pyllm/lib/python3.10/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/iqbal/.venv/pyllm/lib/python3.10/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/iqbal/.venv/pyllm/lib/python3.10/site-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/iqbal/.venv/pyllm/lib/python3.10/site-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
  File "/home/iqbal/.venv/pyllm/lib/python3.10/site-packages/llm/cli.py", line 1909, in templates_edit
    click.edit(filename=path)
  File "/home/iqbal/.venv/pyllm/lib/python3.10/site-packages/click/termui.py", line 772, in edit
    ed.edit_files(filenames=filename)
  File "/home/iqbal/.venv/pyllm/lib/python3.10/site-packages/click/_termui_impl.py", line 591, in edit_files
    exc_filename = " ".join(f'"{filename}"' for filename in filenames)
TypeError: 'PosixPath' object is not iterable

The cleanup-manuscript template exists, though, and I can edit it directly from the file if I need to:

$ llm templates
cleanup-manuscript : Hogehoge

iqbalabd avatar May 21 '25 23:05 iqbalabd

I just encountered this as well.

chriscarrollsmith avatar May 23 '25 21:05 chriscarrollsmith