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

ValueError: too many values to unpack (expected 2) #144

Open
alicedb2 opened this issue Jan 26, 2022 · 0 comments
Open

ValueError: too many values to unpack (expected 2) #144

alicedb2 opened this issue Jan 26, 2022 · 0 comments

Comments

@alicedb2
Copy link

Ran prosopopee directly in the example/ directory and it throws the following error

Traceback (most recent call last):
  File "/Users/alice/miniconda3/bin/prosopopee", line 33, in <module>
    sys.exit(load_entry_point('prosopopee==1.1.4', 'console_scripts', 'prosopopee')())
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/prosopopee-1.1.4-py3.8.egg/prosopopee/prosopopee.py", line 856, in main
    process_directory(gallery.normpath(), settings, templates)
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/prosopopee-1.1.4-py3.8.egg/prosopopee/prosopopee.py", line 570, in process_directory
    process_directory(
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/prosopopee-1.1.4-py3.8.egg/prosopopee/prosopopee.py", line 547, in process_directory
    build_gallery(settings, gallery_settings, gallery_path, parent_templates)
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/prosopopee-1.1.4-py3.8.egg/prosopopee/prosopopee.py", line 647, in build_gallery
    html = template_to_render.render(
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/prosopopee-1.1.4-py3.8.egg/prosopopee/themes/exposure/templates/gallery-index.html", line 30, in top-level template code
    {% include "sections/" + section.type + ".html" %}
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/prosopopee-1.1.4-py3.8.egg/prosopopee/themes/exposure/templates/sections/pictures-group.html", line 13, in top-level template code
    {% set ratio = video.ratio %}
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 474, in getattr
    return getattr(obj, attribute)
  File "/Users/alice/miniconda3/lib/python3.8/site-packages/prosopopee-1.1.4-py3.8.egg/prosopopee/prosopopee.py", line 215, in ratio
    width, height = out.decode("utf-8").split(",")
ValueError: too many values to unpack (expected 2)

out.decode("utf-8") returns 1920,1080, so naturally the second comma makes it so that that out.decode("utf-8").split(",") returns ['1920', '1080', ''].

As a stopgap I change the line to

width, height = out.decode("utf-8").split(",")[:2]

and prosopopee terminated normally.

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

1 participant