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

cgi.escape was removed in Python 3.8 #3309

Open
tirkarthi opened this issue Jan 8, 2020 · 2 comments
Open

cgi.escape was removed in Python 3.8 #3309

tirkarthi opened this issue Jan 8, 2020 · 2 comments
Labels

Comments

@tirkarthi
Copy link

@tirkarthi tirkarthi commented Jan 8, 2020

I just stumbled across this grepping for cgi.escape . I am not sure Tempita is public and documented for usage but found a usage causing AttributeError. cgi.escape was removed in Python 3.8 with python/cpython#7662 . Usage of html.escape is recommended.

value = cgi.escape(value.decode('latin1'), 1)

Python 3.8.0 (default, Nov  6 2019, 21:49:08) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Cython.Tempita
>>> Cython.Tempita.HTMLTemplate("a")._repr(1, 2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Cython/Tempita/_tempita.py", line 489, in Cython.Tempita._tempita.HTMLTemplate._repr
  File "Cython/Tempita/_tempita.py", line 446, in Cython.Tempita._tempita.html_quote
AttributeError: module 'cgi' has no attribute 'escape'

Thanks for Cython!

@auvipy

This comment has been minimized.

Copy link

@auvipy auvipy commented Jan 18, 2020

I want to contribute on this

@scoder scoder added the defect label Jan 18, 2020
@scoder

This comment has been minimized.

Copy link
Contributor

@scoder scoder commented Jan 18, 2020

That part isn't really intended for use, more of a left-over from the original Tempita code base.
Still, PR welcome to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.