Change in docker-playground[master]: cgit: osmo-commit-filter.py: migrate from deprecated cgi.escape to ht...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Oct 3 11:12:40 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/20415 )

Change subject: cgit: osmo-commit-filter.py: migrate from deprecated cgi.escape to html.escape
......................................................................

cgit: osmo-commit-filter.py: migrate from deprecated cgi.escape to html.escape

Our error.log is full of:

/usr/local/lib/cgit/filters/osmo-commit-filter.py:18: DeprecationWarning: cgi.escape is deprecated, use html.escape instead
  return '<a href="%s">%s</a>' % (url, cgi.escape(txt))

Change-Id: I97707519029d4f8d703d2df1b8beab15665d49b1
---
M cgit/osmo-commit-filter.py
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  laforge: Looks good to me, approved; Verified



diff --git a/cgit/osmo-commit-filter.py b/cgit/osmo-commit-filter.py
index 7488bb5..2172840 100755
--- a/cgit/osmo-commit-filter.py
+++ b/cgit/osmo-commit-filter.py
@@ -12,26 +12,26 @@
 
 import re
 import sys
-import cgi
+import html
 
 def hyperlink(txt, url):
-    return '<a href="%s">%s</a>' % (url, cgi.escape(txt))
+    return '<a href="%s">%s</a>' % (url, html.escape(txt))
 
 def chgid_repl(matchobj):
     chg_id = matchobj.group(1)
-    url = GERRIT_URL % cgi.escape(chg_id)
+    url = GERRIT_URL % html.escape(chg_id)
     return hyperlink(chg_id, url)
 
 def relates_repl(matchobj):
     def process_item(x):
         def repl_os(m):
-            url = REDMINE_OS_URL % cgi.escape(m.group(1))
+            url = REDMINE_OS_URL % html.escape(m.group(1))
             return hyperlink(m.group(0), url)
         def repl_sys(m):
-            url = REDMINE_SYS_URL % cgi.escape(m.group(1))
+            url = REDMINE_SYS_URL % html.escape(m.group(1))
             return hyperlink(m.group(0), url)
         def repl_rt(m):
-            url = RT_URL % cgi.escape(m.group(1))
+            url = RT_URL % html.escape(m.group(1))
             return hyperlink(m.group(0), url)
         x = re.sub(r"OS#(\d+)", repl_os, x)
         x = re.sub(r"SYS#(\d+)", repl_sys, x)

-- 
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/20415
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I97707519029d4f8d703d2df1b8beab15665d49b1
Gerrit-Change-Number: 20415
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201003/651e4a8b/attachment.htm>


More information about the gerrit-log mailing list