From d428998d5d85c456756e9083fcb40f0c75080704 Mon Sep 17 00:00:00 2001 From: Lakshya Singh Date: Sat, 21 Jun 2025 07:52:26 +0530 Subject: [PATCH] fix: replace deprecated flask.escape with markupsafe.escape Updates tests/rkls_github_canned_server.py to use markupsafe.escape instead of the deprecated flask.escape function. The flask.escape function is now deprecated and will be removed in a future Flask release, so this change ensures forward compatibility. --- tests/rkls_github_canned_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/rkls_github_canned_server.py b/tests/rkls_github_canned_server.py index 138054a6f..a01366f9a 100644 --- a/tests/rkls_github_canned_server.py +++ b/tests/rkls_github_canned_server.py @@ -1,6 +1,7 @@ import flask import json import os +from markupsafe import escape def create_app(test_config=None): @@ -9,8 +10,8 @@ def create_app(test_config=None): @app.route("/api/repos///contents/") def github_plugins_repo_api(github_user, github_repo): '''This emulates api.github.com calls to lightningd/plugins''' - user = flask.escape(github_user) - repo = flask.escape(github_repo) + user = escape(github_user) + repo = escape(github_repo) canned_api = os.environ.get('REDIR_GITHUB') + f'/rkls_api_{user}_{repo}.json' with open(canned_api, 'rb') as f: canned_data = f.read(-1)