AttributeError HTMLParser object has no attribute unescape every time try to use any web page tools

Every time I try to use any of the tools that post web page content I’m getting error: "AttributeError: 'HTMLParser' object has no attribute 'unescape'"

So far we see this happens with: Blog Post, Help Article, Web Page, and TODO. This prevents being able to post any of these items, and indeed being able to finish setting up the site.

We are new to ERPNext, we’re trying to migrate away from Odoo and Plone, and hoping that ERPNext might be a good solution, it looks promising in the online demos/trials, now if we could just get it fully working on our own servers. :slight_smile:

This is a fresh install of ERPNext on Debian 11 (we are required to use this IS version, we may not downgrade to Ubuntu or older versions of Debian lower than 11).
OS Version: Debian 11 Bullseye

uname -a
Linux erpnext-stg-deb11 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux

ERPNext version:

(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench/erpnext$ bench version
erpnext 12.30.1
frappe 12.27.0

Python version:

(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench/erpnext$ python --version
Python 3.9.2

Pip version:

pip --version
pip 22.1.2 from /srv/bench3/lib/python3.9/site-packages/pip (python 3.9)

Bench version:

(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench$ bench --version
5.8.1
(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench$ node --version
v14.19.3
(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench$ npm --version
6.14.17

console shows:
16:36:47 web.1 | 127.0.0.1 - - [03/Jun/2022 16:36:47] "POST /api/method/[frappe.desk.form.save](http://frappe.desk.form.save/).savedocs HTTP/1.0" 500 - 16:36:47 web.1 | INFO:werkzeug:127.0.0.1 - - [03/Jun/2022 16:36:47] "POST /api/method/[frappe.desk.form.save](http://frappe.desk.form.save/).savedocs HTTP/1.0" 500 - at that time.

Browser (on console shows on client side Debian 11 Firefox 96.0.1):

XHRPOSThttp://[hostname/api/method/frappe.desk.form.save.savedocs](http://hostname/api/method/frappe.desk.form.save.savedocs)
[HTTP/1.1 500 INTERNAL SERVER ERROR 206ms]

Traceback (most recent call last):
File "/srv/bench3/erpnext/apps/frappe/frappe/desk/form/[save.py](http://save.py/)", line 21, in savedocs
[doc.save](http://doc.save/)()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 273, in save
return self._save(*args, **kwargs)
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 296, in _save
self.insert()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 260, in insert
[self.run](http://self.run/)_post_save_methods()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 950, in run_post_save_methods
update_global_search(self)
File "/srv/bench3/erpnext/apps/frappe/frappe/utils/global_[search.py](http://search.py/)", line 247, in update_global_search
content.append(get_formatted_value(doc.get(field.fieldname), field))
File "/srv/bench3/erpnext/apps/frappe/frappe/utils/global_[search.py](http://search.py/)", line 348, in get_formatted_value
value = h.unescape([frappe.safe](http://frappe.safe/)_decode(value))
AttributeError: 'HTMLParser' object has no attribute 'unescape'
request.js:387:14
Traceback (most recent call last):
File "/srv/bench3/erpnext/apps/frappe/frappe/[app.py](http://app.py/)", line 67, in application
response = frappe.api.handle()
File "/srv/bench3/erpnext/apps/frappe/frappe/[api.py](http://api.py/)", line 59, in handle
return frappe.handler.handle()
File "/srv/bench3/erpnext/apps/frappe/frappe/[handler.py](http://handler.py/)", line 24, in handle
data = execute_cmd(cmd)
File "/srv/bench3/erpnext/apps/frappe/frappe/[handler.py](http://handler.py/)", line 64, in execute_cmd
return [frappe.call](http://frappe.call/)(method, **frappe.form_dict)
File "/srv/bench3/erpnext/apps/frappe/frappe/**init**.py", line 1105, in call
return fn(*args, **newargs)
File "/srv/bench3/erpnext/apps/frappe/frappe/desk/form/[save.py](http://save.py/)", line 21, in savedocs
[doc.save](http://doc.save/)()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 273, in save
return self._save(*args, **kwargs)
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 296, in _save
self.insert()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 260, in insert
[self.run](http://self.run/)_post_save_methods()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 950, in run_post_save_methods
update_global_search(self)
File "/srv/bench3/erpnext/apps/frappe/frappe/utils/global_[search.py](http://search.py/)", line 247, in update_global_search
content.append(get_formatted_value(doc.get(field.fieldname), field))
File "/srv/bench3/erpnext/apps/frappe/frappe/utils/global_[search.py](http://search.py/)", line 348, in get_formatted_value
value = h.unescape([frappe.safe](http://frappe.safe/)_decode(value))
AttributeError: 'HTMLParser' object has no attribute 'unescape'
request.js:387:14

Appreciate any suggestions on how to resolve this, it is a show stopper.
Thanks!