Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Pywal crashes in empty directory with iterative argument #504

Open
MTBorg opened this issue Apr 7, 2020 · 1 comment · May be fixed by #505
Open

Pywal crashes in empty directory with iterative argument #504

MTBorg opened this issue Apr 7, 2020 · 1 comment · May be fixed by #505

Comments

@MTBorg
Copy link

MTBorg commented Apr 7, 2020

Running pywal with the iterative argument in an empty directory, .e.g.

wal -i <empty directory> --iterative

produces the stacktrace

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pywal/image.py", line 54, in get_next_image
    image = images[next_index]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/wal", line 11, in <module>
    load_entry_point('pywal==3.3.0', 'console_scripts', 'wal')()
  File "/usr/lib/python3.8/site-packages/pywal/__main__.py", line 208, in main
    parse_args(parser)
  File "/usr/lib/python3.8/site-packages/pywal/__main__.py", line 162, in parse_args
    image_file = image.get(args.i, iterative=args.iterative)
  File "/usr/lib/python3.8/site-packages/pywal/image.py", line 69, in get
    wal_img = get_next_image(img)
  File "/usr/lib/python3.8/site-packages/pywal/image.py", line 57, in get_next_image
    image = images[0]
IndexError: list index out of range

It does not happen when the --iterative flag isn't used.
The error does not really matter as it has no effect, but a clean exit should be prefered.

@MTBorg
Copy link
Author

MTBorg commented Apr 7, 2020

Got a fix in #505.

@MTBorg MTBorg linked a pull request Apr 7, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant