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

Valid GitLab link yields an error #1602

Open
cblegare opened this issue Dec 19, 2023 · 1 comment
Open

Valid GitLab link yields an error #1602

cblegare opened this issue Dec 19, 2023 · 1 comment
Labels
kind: bug Something isn't working needs: more information Needs more information from the author before we can move forward tag: component Issues or improvements associated with a given component in the theme

Comments

@cblegare
Copy link

cblegare commented Dec 19, 2023

Example failed pipeline: https://gitlab.com/fjordlynn/sphinx-pf2srd/-/jobs/5785411903

RST triggering this error:

Open a ticket with your feedback here: https://gitlab.com/fjordlynn/sphinx-pf2srd/-/issues.

Log

Traceback (most recent call last):
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/cmd/build.py", line 298, in build_main
    app.build(args.force_all, args.filenames)
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/application.py", line 355, in build
    self.builder.build_update()
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 2[93](https://gitlab.com/fjordlynn/sphinx-pf2srd/-/jobs/5785411903#L93), in build_update
    self.build(to_build,
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 363, in build
    self.write(docnames, list(updated_docnames), method)
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 571, in write
    self._write_serial(sorted(docnames))
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 578, in _write_serial
    doctree = self.env.get_and_resolve_doctree(docname, self)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/environment/__init__.py", line 635, in get_and_resolve_doctree
    self.apply_post_transforms(doctree, docname)
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/environment/__init__.py", line 688, in apply_post_transforms
    transformer.apply_transforms()
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/transforms/__init__.py", line 83, in apply_transforms
    super().apply_transforms()
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/docutils/transforms/__init__.py", line 182, in apply_transforms
    transform.apply(**kwargs)
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/sphinx/transforms/post_transforms/__init__.py", line 41, in apply
    self.run(**kwargs)
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/pydata_sphinx_theme/short_link.py", line 50, in run
    node.children[0] = nodes.Text(self.parse_url(uri))
                                  ^^^^^^^^^^^^^^^^^^^
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/pydata_sphinx_theme/short_link.py", line [99](https://gitlab.com/fjordlynn/sphinx-pf2srd/-/jobs/5785411903#L99), in parse_url
    url_type, element_number, *_ = parts
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected at least 2, got 1)
Exception occurred:
  File "/builds/fjordlynn/sphinx-pf2srd/.nox/docs/lib/python3.11/site-packages/pydata_sphinx_theme/short_link.py", line 99, in parse_url
    url_type, element_number, *_ = parts
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected at least 2, got 1)

Workaround

Adding a trailing slash fixes the issue (see commit https://gitlab.com/fjordlynn/sphinx-pf2srd/-/commit/f14cfa8757ebab46a5444a510dc8527257555e64)

Possibly Related

@12rambau 12rambau added kind: bug Something isn't working tag: component Issues or improvements associated with a given component in the theme labels Jan 4, 2024
@12rambau
Copy link
Collaborator

12rambau commented Jan 6, 2024

I checked our test and normally this edge case has already been solved here: https://github.com/pydata/pydata-sphinx-theme/pull/1186/files

which version of theme are you using ?

@12rambau 12rambau added the needs: more information Needs more information from the author before we can move forward label Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working needs: more information Needs more information from the author before we can move forward tag: component Issues or improvements associated with a given component in the theme
Projects
None yet
Development

No branches or pull requests

2 participants