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

Fails when passing pathlib.Path object #35

Open
stefan6419846 opened this issue Mar 25, 2024 · 1 comment · May be fixed by #38
Open

Fails when passing pathlib.Path object #35

stefan6419846 opened this issue Mar 25, 2024 · 1 comment · May be fixed by #38

Comments

@stefan6419846
Copy link

Passing a pathlib.Path object as the filenames parameter raises some error:

Traceback (most recent call last):
  File "/home/stefan/temp/run.py", line 57, in <module>
    print(reader.decode(path))
  File "/home/stefan/temp/venv/lib/python3.9/site-packages/zxing/__init__.py", line 80, in decode
    for fn_or_im in filenames:
TypeError: 'PosixPath' object is not iterable

if isinstance(filenames, (str, IOBase, Image) if have_pil else (str, IOBase)):
one_file = True
filenames = filenames,
else:
one_file = False
seems to be incomplete and probably should check for the inverse, id est for known iterables.

@dlenski
Copy link
Owner

dlenski commented Mar 25, 2024

seems to be incomplete and probably should check for the inverse, id est for known iterables

Want to submit a PR to do it this way instead?

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

Successfully merging a pull request may close this issue.

2 participants