From a4c0034e2f41b6f55c16e7420e4acdfdfb355c75 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Tue, 21 Oct 2025 17:50:18 +0200 Subject: [PATCH] Docs: fix ogp_custom_meta_tags should be a list. 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 ``` --- Doc/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/conf.py b/Doc/conf.py index a8e376c0ae44fe..5c34250c5e34f3 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -576,11 +576,11 @@ 'image': '_static/og-image.png', 'line_color': '#3776ab', } -ogp_custom_meta_tags = ('',) +ogp_custom_meta_tags = [''] if 'create-social-cards' not in tags: # noqa: F821 # Define a static preview image when not creating social cards ogp_image = '_static/og-image.png' - ogp_custom_meta_tags += ( + ogp_custom_meta_tags += [ '', '', - ) + ]