[FIX] core/github_link: deprecated werkzeug method

Latest versions of werkzeug do not provide url_unparse anymore,
leading to an error during the build:

AttributeError: module 'werkzeug.urls' has no attribute 'url_unparse'

This commit replaces the use of url_unparse by the urllib counterpart.

closes odoo/documentation#12246

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Victor Feyens
2025-03-04 10:56:22 +01:00
parent 27df9ce957
commit b27431c271

View File

@@ -23,8 +23,8 @@ import importlib
import inspect import inspect
import os.path import os.path
import werkzeug
import contextlib import contextlib
from urllib.parse import urlunsplit
def setup(app): def setup(app):
@@ -93,7 +93,7 @@ def make_github_link(app, project, path, line=None, mode="blob"):
branch = 'master' branch = 'master'
urlpath = f"/{app.config.github_user}/{project}/{mode}/{branch}/{path}" urlpath = f"/{app.config.github_user}/{project}/{mode}/{branch}/{path}"
return werkzeug.urls.url_unparse(( return urlunsplit((
'https', 'https',
'github.com', 'github.com',
urlpath, urlpath,