From 66f8138ba9f3eaa6318a166f1815512ee7559242 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Fri, 23 Feb 2024 09:59:13 -0600 Subject: [PATCH] Switch from the depreciated cgi module to the html module --- src/pgwui_core/exceptions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pgwui_core/exceptions.py b/src/pgwui_core/exceptions.py index b79bac9..c90536c 100644 --- a/src/pgwui_core/exceptions.py +++ b/src/pgwui_core/exceptions.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013, 2014, 2015, 2018, 2020, 2021 The Meme Factory, Inc. +# Copyright (C) 2013, 2014, 2015, 2018, 2020, 2021, 2024 The Meme Factory, Inc. # http://www.karlpinc.com/ # This file is part of PGWUI_Core. @@ -23,7 +23,7 @@ '''Exceptions ''' -from cgi import escape as cgi_escape +from html import escape as html_escape class PGWUIError(Exception): @@ -197,17 +197,17 @@ class DBError(SetupError): Produce an html formatted message from a psycopg2 DatabaseError exception. ''' - primary = cgi_escape(ex.diag.message_primary) + primary = html_escape(ex.diag.message_primary) if ex.diag.message_detail is None: detail = '' else: - detail = '
DETAIL: ' + cgi_escape(ex.diag.message_detail) + detail = '
DETAIL: ' + html_escape(ex.diag.message_detail) if ex.diag.message_hint is None: hint = '' else: - hint = '
HINT: ' + cgi_escape(ex.diag.message_hint) + hint = '
HINT: ' + html_escape(ex.diag.message_hint) return '

{0}: {1}{2}{3}

'.format( ex.diag.severity, -- 2.34.1