Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version_information not compatible with python 3.8 (cgi.escape) #15

Open
wjcapehart opened this issue May 21, 2020 · 2 comments
Open

version_information not compatible with python 3.8 (cgi.escape) #15

wjcapehart opened this issue May 21, 2020 · 2 comments

Comments

@wjcapehart
Copy link
Contributor

wjcapehart commented May 21, 2020

Hello Robert:

I have run into a problem with your version_information resource when moving to Python 3.8 under JupyterLab 2.1.2 (it's not giving the error when working in a simple IPython terminal window).

The error seems to be related to cgi.escape no longer being used in Python 3.8
Supervisor/supervisor#1257

Example of error is here:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/Cellar/jupyterlab/2.1.2/libexec/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj)
    343             method = get_real_method(obj, self.print_method)
    344             if method is not None:
--> 345                 return method()
    346             return None
    347         else:

/usr/local/Cellar/jupyterlab/2.1.2/libexec/lib/python3.8/site-packages/version_information/version_information.py in _repr_html_(self)
    126         html += "<tr><th>Software</th><th>Version</th></tr>"
    127         for name, version in self.packages:
--> 128             _version = cgi.escape(version)
    129             html += "<tr><td>%s</td><td>%s</td></tr>" % (name, _version)
    130 

AttributeError: module 'cgi' has no attribute 'escape'

Regards,
Bill Capehart
SD Mines

@pamag
Copy link

pamag commented Jun 15, 2020

cgi.escape is deprecated since Python version 3.2: This function is unsafe because quote is false by default, and therefore deprecated. html.escape() should be use instead.

This function has been removed in Python 3.8

lrettig added a commit to lrettig/monetary-base that referenced this issue Jan 10, 2021
bjmorgan added a commit to bjmorgan/version_information that referenced this issue Mar 22, 2021
@leebrian
Copy link
Collaborator

This should now be resolved with PR #19 . Would you please give it a test and let me know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants