pyfpdf icon indicating copy to clipboard operation
pyfpdf copied to clipboard

Workaround

Open SmartManoj opened this issue 4 years ago • 3 comments

AttributeError: 'HTML2FPDF' object has no attribute 'unescape'

SmartManoj avatar Apr 28 '21 19:04 SmartManoj

+1

HTMLParser.unescape is deprecated since Python 3.4, and was removed from 3.9:

https://github.com/pypa/setuptools/commit/53b8db359378f436bfd88f90a90aaf01b650d3a6

eriktelepovsky avatar May 13 '21 13:05 eriktelepovsky

fpdf2 uses

import html
html.unescape(text)

as seen below:

https://github.com/PyFPDF/fpdf2/blob/aa86a0f28ad1955b78a01381635cac5c11c20d82/fpdf/html.py#L9

https://github.com/PyFPDF/fpdf2/blob/aa86a0f28ad1955b78a01381635cac5c11c20d82/fpdf/html.py#L522

alexp1917 avatar May 14 '21 21:05 alexp1917

see #171

alexp1917 avatar May 14 '21 21:05 alexp1917