fix: replace deprecated flask.escape with markupsafe.escape
What changed, and why it matters
This is a routine maintenance change in a test helper file. It swaps one HTML-escaping function for an equivalent one to stay compatible with future Flask releases. There is no security issue here.
No action needed. This is a benign deprecation fix in test infrastructure.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates tests/rkls_github_canned_server.py to import escape from markupsafe and use it instead of flask.escape. Both functions perform the same HTML escaping; Flask’s own escape is deprecated and will be removed. The file is a canned test server used to simulate GitHub API responses during tests, not production code. The change is forward-compatibility cleanup with no functional or security effect.
Changed components
tests/rkls_github_canned_server.pyInspect captured patch +3 / −2
diff --git a/tests/rkls_github_canned_server.py b/tests/rkls_github_canned_server.py
index 138054a6..a01366f9 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/<github_user>/<github_repo>/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)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.