From: Oleg Broytman Date: Thu, 16 Nov 2023 05:26:52 +0000 (+0300) Subject: Fix(Py3): Fix `unescape` X-Git-Tag: 5.0.0~26 X-Git-Url: https://git.phdru.name/?p=bookmarks_db.git;a=commitdiff_plain;h=03d2e88efc7b2046a404679a36a8a65d6faae98c Fix(Py3): Fix `unescape` --- diff --git a/bkmk_objects.py b/bkmk_objects.py index b9dabff..7415670 100644 --- a/bkmk_objects.py +++ b/bkmk_objects.py @@ -228,8 +228,13 @@ def quote_title(title): def unquote_title(title): if BKMK_FORMAT == "MOZILLA": - from HTMLParser import HTMLParser - title = HTMLParser().unescape( + try: + from HTMLParser import HTMLParser + except ImportError: + from html import unescape + else: + unescape = HTMLParser().unescape + title = unescape( title.replace("&", '&')) title = title.replace("'", "'") return title