Skip to content

Conversation

JulienPalard
Copy link
Member

@JulienPalard JulienPalard commented Oct 21, 2025

With tuples I get a sphinx warning:

WARNING: The config value `ogp_custom_meta_tags' has type `tuple', defaults to `list'.

followed by a crash:

Traceback (most recent call last):
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/sphinx/events.py", line 404, in emit
    results.append(listener.handler(self.app, *args))
                   ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/sphinxext/opengraph/__init__.py", line 266, in html_page_context
    context["metatags"] += get_tags(app, context, doctree, app.config)
                           ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/sphinxext/opengraph/__init__.py", line 250, in get_tags
    [make_tag(p, c) for p, c in tags.items()]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + [make_tag(p, c, "name") for p, c in meta_tags.items()]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + config["ogp_custom_meta_tags"]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate list (not "tuple") to list

📚 Documentation preview 📚: https://cpython-previews--140424.org.readthedocs.build/

Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using the latest version of sphinxext-opengraph? See sphinx-doc/sphinxext-opengraph#141, this was resolved in 0.13.

A

@bedevere-app
Copy link

bedevere-app bot commented Oct 21, 2025

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@StanFromIreland
Copy link
Member

Per the documentation, it has to be Sequence[str], and only defaults to a tuple.

@StanFromIreland
Copy link
Member

The build now fails:

WARNING: The config value ogp_custom_meta_tags' has type list', defaults to `tuple'.

With tuples I get:

```pytb
Traceback (most recent call last):
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/sphinx/events.py", line 404, in emit
    results.append(listener.handler(self.app, *args))
                   ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/sphinxext/opengraph/__init__.py", line 266, in html_page_context
    context["metatags"] += get_tags(app, context, doctree, app.config)
                           ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/sphinxext/opengraph/__init__.py", line 250, in get_tags
    [make_tag(p, c) for p, c in tags.items()]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + [make_tag(p, c, "name") for p, c in meta_tags.items()]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + config["ogp_custom_meta_tags"]
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate list (not "tuple") to list
```
@JulienPalard JulienPalard force-pushed the mdk-ogp_custom_meta_tags branch from 5dbf4bf to a4c0034 Compare October 21, 2025 15:56
@AA-Turner
Copy link
Member

#140425 -- I forgot to update the requirement in CPython, sorry.

A

@JulienPalard
Copy link
Member Author

Are you using the latest version of sphinxext-opengraph? See sphinx-doc/sphinxext-opengraph#141, this was resolved in 0.13.

Checking that.

Per the documentation, it has to be Sequence[str], and only defaults to a tuple.

Ohhh it changed then.

#140425 -- I forgot to update the requirement in CPython, sorry.

OOKKK :)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes docs Documentation in the Doc dir

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants