ome / omero-figure

An OMERO.web app for creating Figures from images in OMERO
http://figure.openmicroscopy.org
GNU Affero General Public License v3.0
15 stars 30 forks source link

Replace cgi.escape by html.escape. #396

Closed gouttegd closed 3 years ago

gouttegd commented 4 years ago

The escape function in the cgi module has been deprecated since Python 3.2 [1] and has finally been removed in Python 3.8 [2], resulting in the Figure_To_Pdf.py script failing to run under Python 3.8.

This patch replaces the call to cgi.escape by html.escape, as recommended by the Python developers.

[1] https://docs.python.org/3.7/library/cgi.html#cgi.escape [2] https://docs.python.org/3.8/whatsnew/3.8.html#api-and-feature-removals

will-moore commented 4 years ago

Thanks - looks good. cc @knabar

NB: we haven't looked at supporting Python 3.8 yet (see https://docs.openmicroscopy.org/omero/5.6.1/sysadmins/version-requirements.html#python) but happy to receive any help in that direction.

gouttegd commented 4 years ago

For what it’s worth, I’ve been running OMERO under Python 3.8 for a little bit more than one month, and the problem with the Figure_To_Pdf.py script is the only issue I’ve run into so far.