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 3) #1343

Closed
alex opened this issue Sep 24, 2022 · 6 comments · Fixed by #1345
Closed

ValueError: too many values to unpack (expected 3) #1343

alex opened this issue Sep 24, 2022 · 6 comments · Fixed by #1345
Labels
Bug A bug Needed: replication Bug replication is required

Comments

@alex
Copy link

alex commented Sep 24, 2022

Traceback (most recent call last):
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/builders/html/__init__.py", line 1096, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/jinja2glue.py", line 194, in render
    return self.environment.get_template(template).render(context)
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx_rtd_theme/layout.html", line 13, in top-level template code
    {%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.') | map('int') -%}
ValueError: too many values to unpack (expected 3)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/cmd/build.py", line 279, in build_main
    app.build(args.force_all, filenames)
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/application.py", line 350, in build
    self.builder.build_update()
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 302, in build_update
    self.build(to_build,
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 368, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 563, in write
    self._write_serial(sorted(docnames))
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 573, in _write_serial
    self.write_doc(docname, doctree)
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/builders/html/__init__.py", line 672, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/home/runner/work/cryptography/cryptography/.tox/docs/lib/python3.10/site-packages/sphinx/builders/html/__init__.py", line 1103, in handle_page
    raise ThemeError(__("An error happened in rendering the page %s.\nReason: %r") %
sphinx.errors.ThemeError: An error happened in rendering the page api-stability.

this appears to have been caused by the latest sphinx being version 5.2.0.post0

https://github.com/pyca/cryptography/actions/runs/3119261059/jobs/5060248154

@alex alex added Bug A bug Needed: replication Bug replication is required labels Sep 24, 2022
@WizardCM
Copy link

Confirmed. Occurs on Sphinx v5.2.0.post0

writing output... [  2%] backend-design

Traceback (most recent call last):
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/builders/html/__init__.py", line 1096, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/jinja2glue.py", line 194, in render
    return self.environment.get_template(template).render(context)
  File "/home/wizardcm/.local/lib/python3.8/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/home/wizardcm/.local/lib/python3.8/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx_rtd_theme/layout.html", line 13, in top-level template code
    {%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.') | map('int') -%}
ValueError: too many values to unpack (expected 3)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/cmd/build.py", line 279, in build_main
    app.build(args.force_all, filenames)
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/application.py", line 350, in build
    self.builder.build_update()
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 302, in build_update
    self.build(to_build,
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 368, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 563, in write
    self._write_serial(sorted(docnames))
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 573, in _write_serial
    self.write_doc(docname, doctree)
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/builders/html/__init__.py", line 672, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/home/wizardcm/.local/lib/python3.8/site-packages/sphinx/builders/html/__init__.py", line 1103, in handle_page
    raise ThemeError(__("An error happened in rendering the page %s.\nReason: %r") %
sphinx.errors.ThemeError: An error happened in rendering the page backend-design.
Reason: ValueError('too many values to unpack (expected 3)')

Theme error:
An error happened in rendering the page backend-design.
Reason: ValueError('too many values to unpack (expected 3)')

https://github.com/obsproject/obs-studio/actions/runs/3120097770/jobs/5060455218

WizardCM added a commit to obsproject/obs-studio that referenced this issue Sep 25, 2022
This should be reverted once sphinx_rtd_theme is updated.

See readthedocs/sphinx_rtd_theme#1343
@danielrobbins
Copy link

I have triaged this issue -- please see https://bugs.funtoo.org/browse/FL-10533

The short summary is that the following line in sphinx_rtd_theme assumes that the sphinx version can be split into 3 parts. This is not true with 5.2.0.post0. The relevant line in the traceback is:

File "/usr/lib/python3.7/site-packages/sphinx_rtd_theme/layout.html", line 13, in top-level template code
{%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.') | map('int') -%}
ValueError: too many values to unpack (expected 3)

pypi supports different types of versions besides x.y.z. It is best to parse the version using a more robust version parsing such as packaging.version.Version class.

ericwa added a commit to ericwa/ericw-tools that referenced this issue Sep 25, 2022
stephanosio added a commit to stephanosio/zephyr that referenced this issue Sep 25, 2022
Sphinx 5.2.0.post0 release has a known compatibility issue with the
`sphinx_rtd_theme` (see the issue readthedocs/sphinx_rtd_theme#1343).

Revert this commit once this compatibility issue is resolved.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
lassoan added a commit to Slicer/Slicer that referenced this issue Sep 25, 2022
Readthedocs uses incorrect version parsing, which is not compatible with current sphinx version, see readthedocs/sphinx_rtd_theme#1343.
Implemented workaround until this issue is fixed.
lassoan added a commit to Slicer/Slicer that referenced this issue Sep 25, 2022
Readthedocs uses incorrect version parsing, which is not compatible with current sphinx version, see readthedocs/sphinx_rtd_theme#1343.
Implemented workaround until this issue is fixed.
ghazi-git added a commit to ghazi-git/drf-standardized-errors that referenced this issue Sep 25, 2022
carlescufi pushed a commit to zephyrproject-rtos/zephyr that referenced this issue Sep 25, 2022
Sphinx 5.2.0.post0 release has a known compatibility issue with the
`sphinx_rtd_theme` (see the issue readthedocs/sphinx_rtd_theme#1343).

Revert this commit once this compatibility issue is resolved.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
rkdarst added a commit to coderefinery/sphinx-lesson that referenced this issue Sep 25, 2022
- A four-part version fails with sphinx_rtd_theme:
  readthedocs/sphinx_rtd_theme#1343 While
  this is a problem with sphinx_rtd_theme, the easiest solution is to
  limit Sphinx version (sphinx_rtd_theme updates *slowly*)
- This should be reverted after either sphinx releases again with a
  more normal version number, or sphinx_rtd_theme updates.
- Review: see if CI passes
@rkdarst
Copy link
Contributor

rkdarst commented Sep 25, 2022

Workaround in a project's requirements (as is being done by others in the references above):

sphinx!=5.2.0.post0    # remove after next release

It would be best if sphinx_rtd_theme releases with the fix in #1344, but another workaround is sphinx releasing with a 3-part version number. Or every project does the above, which is definitely not good.

lkiesow added a commit to lkiesow/emissions-api that referenced this issue Sep 25, 2022
This patch temporarily restricts the Sphinx version since the latest one
causes trouble with `sphinx_rtd_theme`. This should be reverted once
that bug is fixed in the theme.

See: readthedocs/sphinx_rtd_theme#1343
lkiesow added a commit to emissions-api/emissions-api that referenced this issue Sep 25, 2022
This patch temporarily restricts the Sphinx version since the latest one
causes trouble with `sphinx_rtd_theme`. This should be reverted once
that bug is fixed in the theme.

See: readthedocs/sphinx_rtd_theme#1343
edsu added a commit to edsu/wayback that referenced this issue Sep 25, 2022
The sphinx doc build run by CircleCI is currently failing:

```
make: Entering directory '/home/circleci/wayback/docs'
Traceback (most recent call last):
  File "/home/circleci/venv/bin/sphinx-build", line 5, in <module>
    from sphinx.cmd.build import main
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/cmd/build.py", line 25, in <module>
    from sphinx.application import Sphinx
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/application.py", line 42, in <module>
    from sphinx.registry import SphinxComponentRegistry
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/registry.py", line 24, in <module>
    from sphinx.builders import Builder
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 26, in <module>
    from sphinx.util import import_object, logging, rst, progress_message, status_iterator
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/util/rst.py", line 22, in <module>
    from jinja2 import environmentfilter
ImportError: cannot import name 'environmentfilter' from 'jinja2' (/home/circleci/venv/lib/python3.8/site-packages/jinja2/__init__.py)
make: *** [Makefile:20: html] Error 1
make: Leaving directory '/home/circleci/wayback/docs'

Exited with code exit status 2

CircleCI
```

It looks like this might be the result of jinja2 imports being
deprecated?

sphinx-doc/sphinx#10291

I tried unpinning all the dependencies, and making a few minor changes
to the sphinx config and the docs seem to build fine locally but maybe
I'm missing some detail about theme/css?

Unfortunately I did have to tell pip to ignore sphinx 5.2.0.post0 which
appears to have a recent bug that hopefully will be fixed shortly:

readthedocs/sphinx_rtd_theme#1343
edsu added a commit to edsu/wayback that referenced this issue Sep 25, 2022
The sphinx doc build run by CircleCI is currently failing:

```
make: Entering directory '/home/circleci/wayback/docs'
Traceback (most recent call last):
  File "/home/circleci/venv/bin/sphinx-build", line 5, in <module>
    from sphinx.cmd.build import main
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/cmd/build.py", line 25, in <module>
    from sphinx.application import Sphinx
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/application.py", line 42, in <module>
    from sphinx.registry import SphinxComponentRegistry
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/registry.py", line 24, in <module>
    from sphinx.builders import Builder
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 26, in <module>
    from sphinx.util import import_object, logging, rst, progress_message, status_iterator
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/util/rst.py", line 22, in <module>
    from jinja2 import environmentfilter
ImportError: cannot import name 'environmentfilter' from 'jinja2' (/home/circleci/venv/lib/python3.8/site-packages/jinja2/__init__.py)
make: *** [Makefile:20: html] Error 1
make: Leaving directory '/home/circleci/wayback/docs'

Exited with code exit status 2

CircleCI
```

It looks like this might be the result of jinja2 imports being
deprecated?

sphinx-doc/sphinx#10291

I tried unpinning all the dependencies, and making a few minor changes
to the sphinx config and the docs seem to build fine locally but maybe
I'm missing some detail about theme/css?

Unfortunately I did have to tell pip to ignore sphinx 5.2.0.post0 which
appears to have a recent bug that hopefully will be fixed shortly:

readthedocs/sphinx_rtd_theme#1343
edsu added a commit to edsu/wayback that referenced this issue Sep 25, 2022
The sphinx doc build run by CircleCI is currently failing:

```
make: Entering directory '/home/circleci/wayback/docs'
Traceback (most recent call last):
  File "/home/circleci/venv/bin/sphinx-build", line 5, in <module>
    from sphinx.cmd.build import main
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/cmd/build.py", line 25, in <module>
    from sphinx.application import Sphinx
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/application.py", line 42, in <module>
    from sphinx.registry import SphinxComponentRegistry
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/registry.py", line 24, in <module>
    from sphinx.builders import Builder
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 26, in <module>
    from sphinx.util import import_object, logging, rst, progress_message, status_iterator
  File "/home/circleci/venv/lib/python3.8/site-packages/sphinx/util/rst.py", line 22, in <module>
    from jinja2 import environmentfilter
ImportError: cannot import name 'environmentfilter' from 'jinja2' (/home/circleci/venv/lib/python3.8/site-packages/jinja2/__init__.py)
make: *** [Makefile:20: html] Error 1
make: Leaving directory '/home/circleci/wayback/docs'

Exited with code exit status 2

CircleCI
```

It looks like this might be the result of jinja2 imports being
deprecated?

sphinx-doc/sphinx#10291

I tried unpinning all the dependencies, and making a few minor changes
to the sphinx config and the docs seem to build fine locally but maybe
I'm missing some detail about theme/css?

Unfortunately I did have to tell pip to ignore sphinx 5.2.0.post0 which
appears to have a recent bug that hopefully will be fixed shortly:

readthedocs/sphinx_rtd_theme#1343
jeandet added a commit to jeandet/speasy that referenced this issue Sep 25, 2022
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
jeandet added a commit to SciQLop/speasy that referenced this issue Sep 25, 2022
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
@mara004

This comment was marked as off-topic.

@CreatingNull
Copy link

Sphinx is pending a 5.2.1 release, this should resolve the issue (for now).

dugalh added a commit to leftfield-geospatial/geedim that referenced this issue Sep 25, 2022
RobinDavid added a commit to quarkslab/qsynthesis that referenced this issue Sep 25, 2022
JOJ0 added a commit to joalla/discogs_client that referenced this issue Sep 25, 2022
tamasgal added a commit to KM3NeT/km3pipe that referenced this issue Sep 26, 2022
coreboot-org-bot pushed a commit to coreboot/zephyr-cros that referenced this issue Sep 27, 2022
Sphinx 5.2.0.post0 release has a known compatibility issue with the
`sphinx_rtd_theme` (see the issue readthedocs/sphinx_rtd_theme#1343).

Revert this commit once this compatibility issue is resolved.

(cherry picked from commit f503847)

Original-Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
GitOrigin-RevId: f503847
Change-Id: I20e1f285d8dec4eaf549cd55fe0df239a1afa8a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/3916773
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: CopyBot Service Account <copybot.service@gmail.com>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
@pelson
Copy link
Contributor

pelson commented Sep 27, 2022

I proposed a fix in #1345.
(posting here for visibility)

RytoEX pushed a commit to RytoEX/obs-studio that referenced this issue Sep 27, 2022
This should be reverted once sphinx_rtd_theme is updated.

See readthedocs/sphinx_rtd_theme#1343
jp9000 pushed a commit to obsproject/obs-studio that referenced this issue Sep 29, 2022
This should be reverted once sphinx_rtd_theme is updated.

See readthedocs/sphinx_rtd_theme#1343
JOJ0 added a commit to joalla/discogs_client that referenced this issue Sep 29, 2022
RobinDavid added a commit to quarkslab/qsynthesis that referenced this issue Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: replication Bug replication is required
Projects
None yet
7 participants