From f61ba5d73465f689c394af507ba36cb99eb3cf6c Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Tue, 4 Mar 2025 09:56:22 +0000 Subject: [PATCH] [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#12254 X-original-commit: b27431c2717b0daefac2e8a1867fdcf3607ffd18 Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Victor Feyens (vfe) --- extensions/github_link/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/github_link/__init__.py b/extensions/github_link/__init__.py index baa9c0077..4b8ba221c 100644 --- a/extensions/github_link/__init__.py +++ b/extensions/github_link/__init__.py @@ -23,8 +23,8 @@ import importlib import inspect import os.path -import werkzeug import contextlib +from urllib.parse import urlunsplit def setup(app): @@ -93,7 +93,7 @@ def make_github_link(app, project, path, line=None, mode="blob"): branch = 'master' urlpath = f"/{app.config.github_user}/{project}/{mode}/{branch}/{path}" - return werkzeug.urls.url_unparse(( + return urlunsplit(( 'https', 'github.com', urlpath,